Link to a COM assembly in Visual Studio and to convert a COM assembly through tlbimp.exe

When I import a COM assembly (dll) into a Visual Studio project, adding it as a reference, I can easily use the generated equivalent general language runtime.

However, if I try to convert the same COM assembly to a common runtime assembly using tlbimp, I run all kinds of problems.

Is there a way to replicate the settings that Visual Studio uses with tlbimp? Or, to put it another way, is there a way to generate the same interaction class as visual studio using tlbimp?

+3
source share
2 answers

. , Visual Studio tlbimp, /out /namespace.

out "Interop". , COM.

.

tlbimp /out:Interop.MyCom.dll /namespace:MyCom MyCom.dll
+2

, /sysarray, , EngineExceptions, .

, .

/namespace, ( ) tlb. ( oleview.exe tlbs).

[ ] tlbimp, msbuild script, , 64 32- .

64- , tlbs, regsvr32'd, , , 32- COM- 32- .

64 32 , /reference /tlbreference, interops tlbs, , .

+2

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


All Articles