COM + link with .Net with variable GUID

We have a project that references COM + components (written in VB6). Components are added to our .Net solution using Add Link. This works well, and even intellisense works.

From time to time, the interfaces (compatibility) of the components are broken, and our .Net code no longer works. A component has been added with a specific GUID that the GUID is no longer registered.

Question: Is it possible to call COM + components in the same way as we are used to (without reflection), without the need to update links in our .Net solution. For example, creating a wrapper for a COM + component based on a file name?

Regards, M.

+3
source share
3 answers

,.NET( ) COM-, GUID.

, GUID, . , , . , .NET , , , .

+3

COM-, Visual Studio "Interop". interop -, COM-, p-invoke .

COM - , COM- , Interop .

, tlbimp:

TlbImp.exe "MyCOMClass.dll" /out:Interop.MyCOMClass.dll

, Interop.MyCOMClass.dll COM-, , COM- , Interop COM-.

+2

: http://support.microsoft.com/kb/161137

  • VB6.
  • DllName.cmp
  • DLL .cmp .

VB6 DLL GUID ;)

> a >

0
source

Source: https://habr.com/ru/post/1755729/


All Articles