Reputation: 152
The dll I am working with is called RGAComms.dll(It is unmanaged) According to my understanding of unmanaged dll, unless the function names are decorated all that should be available is the function names(not the actual signature). I have the following question about the below pictures.
In the VS object browser after I added the dll to the program references, it displays the actual methods names plus the method signature. How could it possibly show the method signature.(My guess is that method names are decorated)
This is my main question. When I run dumpbin on RGAComms.dll it only displays four method names that I believe have to do with Microsoft's COM.(See pic below) Why does it not display the actual method names in dll.(For example: "Connect" - This method can be seen in the VS object viewer of RGACommsLib)
I know that this DLL DOES include the method "Connect".(As previously stated) When I execute the following code I get a exception that states that the entry point does not exist in the DLL. How could it not exist if one can clearly see it exists in the VS object viewer of the dll.(My guess is that because these method names are decorated the entry point will be something like "Connect@@@8" or something)
[DllImport(@"PathOnMyLocalComputerToTheDll\RGAComms.dll")]
public static extern void Connect(string strAddress);
public MainMethod() {
Connect("localhost");
}
I almost sure all my questions probably boil down to one major misconception.
Dumpbin output:
Upvotes: 2
Views: 639
Reputation: 152
That DLL is in fact a in-processes COM server. Here is a great page about it: https://msdn.microsoft.com/en-us/library/windows/desktop/ms683835(v=vs.85).aspx
The reason why only four methods are found from dumpbin are because it is a COM server. In this case all you have to do to use the classes from the DLL is the following code after you added the DLL to the references and set the embedded interop to false for that DLL.
public RGACommsLib.RGAConnectionClass GA = new RGACommsLib.RGAConnectionClass();
Upvotes: 3
Reputation: 8706
While RGAComms.dll might be unmanaged, RGACommsLib.dll is managed and VS is showing you the classes and methods from that dll. I can see you have referenced this in your solution. Only managed dlls will show up in your references, not unmanaged.
Upvotes: 1