查看.net应用程序中COM DLL的内容

本文关键字:DLL COM net 应用程序 查看 | 更新日期: 2023-09-27 18:05:15

我是C#的新手,需要在我的应用程序中使用COM DLL

我已经对原始的DLL执行了tlbimp,用regsvr32注册了我的新DLL,用ildasm查看了DLL的内容,然后使用/ilasm /res /dll /key重新创建并签署了DLL(使用与我的c#项目相同的密钥)。然后,我将新的、签名的DLL添加到我的GAC中。

我在我的应用程序中添加了referenceDLL,并且能够在DLL结构中输出每个methodType

我期望DLL具有array(s)的值,但无法执行get方法,并且在结构转储文件中没有看到任何数组。

我期望的两个数组类型将是INTSTRING。这个DLL应该能够填充combobox

下面是使用ildasm

转储的DLL

有人能告诉我,如果实际上有一个数组的值在这个DLL或如果我应该停止旋转我的车轮?

___[MOD] 
   |      M A N I F E S T
   |___[NSP] CSCICom_Usable
   |   |___[INT] CSCICom_Usable.Class1
   |   |   |     .class interface public abstract auto ansi import 
   |   |   |      implements CSCICom_Usable._Class1 
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 32 34 42 33 31 37 34 37 2D 41 46 42 36   // ..$24B31747-AFB6 ...
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.CoClassAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 1A 43 53 43 49 43 6F 6D 5F 55 73 61 62 6C   // ...CSCICom_Usabl ...
   |   |
   |   |___[CLS] CSCICom_Usable.Class1Class
   |   |   |     .class public auto ansi import 
   |   |   |      implements CSCICom_Usable._Class1 
   |   |   |      implements CSCICom_Usable.Class1 
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.TypeLibTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.TypeLibTypeFlags) = ( 01 00 02 00 00 00 00 00 )  ...
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 37 32 43 45 36 35 44 45 2D 46 30 42 38   // ..$72CE65DE-F0B8 ...
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.ClassInterfaceAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ClassInterfaceType) = ( 01 00 00 00 00 00 00 00 )  ...
   |   |   |___[MET] .ctor : void()
   |   |   |___[MET] GetIncidentCodes : class [VBA]VBA.Collection()
   |   |
   |   |___[INT] CSCICom_Usable.Class2
   |   |   |     .class interface public abstract auto ansi import 
   |   |   |      implements CSCICom_Usable._Class2 
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 41 38 38 36 33 32 42 42 2D 41 46 46 31   // ..$A88632BB-AFF1 ...
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.CoClassAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 1A 43 53 43 49 43 6F 6D 5F 55 73 61 62 6C   // ...CSCICom_Usabl ...
   |   |
   |   |___[CLS] CSCICom_Usable.Class2Class
   |   |   |     .class public auto ansi import 
   |   |   |      implements CSCICom_Usable._Class2 
   |   |   |      implements CSCICom_Usable.Class2 
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.TypeLibTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.TypeLibTypeFlags) = ( 01 00 02 00 00 00 00 00 )  ...
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 41 30 43 39 46 42 45 45 2D 42 36 45 38   // ..$A0C9FBEE-B6E8 ...
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.ClassInterfaceAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ClassInterfaceType) = ( 01 00 00 00 00 00 00 00 )  ...
   |   |   |___[MET] .ctor : void()
   |   |   |___[MET] get_Code : int16()
   |   |   |___[MET] get_Name : string()
   |   |   |___[MET] set_Code : void(int16)
   |   |   |___[MET] set_Name : void(string)
   |   |   |___[PTY] Code : int16()
   |   |   |___[PTY] Name : string()
   |   |
   |   |___[INT] CSCICom_Usable._Class1
   |   |   |     .class interface public abstract auto ansi import 
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.TypeLibTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.TypeLibTypeFlags) = ( 01 00 D0 10 00 00 00 00 )  ...
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 32 34 42 33 31 37 34 37 2D 41 46 42 36   // ..$24B31747-AFB6 ...
   |   |   |___[MET] GetIncidentCodes : class [VBA]VBA.Collection()
   |   |
   |   |___[INT] CSCICom_Usable._Class2
   |   |   |     .class interface public abstract auto ansi import 
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.TypeLibTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.TypeLibTypeFlags) = ( 01 00 D0 10 00 00 00 00 )  ...
   |   |   |     .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 41 38 38 36 33 32 42 42 2D 41 46 46 31   // ..$A88632BB-AFF1 ...
   |   |   |___[MET] get_Code : int16()
   |   |   |___[MET] get_Name : string()
   |   |   |___[MET] set_Code : void(int16)
   |   |   |___[MET] set_Name : void(string)
   |   |   |___[PTY] Code : int16()
   |   |   |___[PTY] Name : string()
   |   |
   |

查看.net应用程序中COM DLL的内容

所以在继续实现我的COM DLL之后,同时替换我自己的方法。后来有人告诉我。意识到两件事

  1. 在上面的代码中,你可以看到[MET] GetIncidentCodes返回一个VBA.Collection(),即一个数组。

  2. 我被告知在集合中有两个项目。我真诚地希望他们不是0和空白.....

继续学习c#