2

I have two C++ WinApi(only x64 arch) dlls of the same names, which contain API of some project, for example C:\first\MyDll.dll and C:\second\MyDll.dll. I can't rename it in my case. So they can't be loaded in Reference Manager beacause they have the same names.

DLLImport can load only method, but i need to load some COM intefaces, guids, etc

What ideas you have?

Thanks in advance everyone

Artem
  • 21
  • 2
  • create two class projects and put one in each class. – jdweng Sep 23 '20 at 17:12
  • 1
    Not sure the right way to do what you want but the ````Assembly.Load*```` methods (and the Assembly type itself) are for loading managed assemblies. You want to load a natove assembly. Maybe something in the System.Runtime, or System.Runtime.InteropServices namespaces could help. – Paramecium13 Sep 23 '20 at 18:43
  • Alternatively, you can create another unmanaged dll and use it to load the dll you want... Or maybe use unmanaged/native stuff in a C++/CLI project to load them. – Paramecium13 Sep 23 '20 at 18:44
  • As @paramecium points out, only managed assemblies (i.e. those that have an assembly manifest) can be loaded using `Assembly.Load*`. Generally, if you want to call into *unmanaged* code, you either use COM Interop or P/Invoke (calling exported C functions). What are you trying to call, and how? – Flydog57 Sep 23 '20 at 21:53
  • P/Invoke export only methods, i need all data from dll(interfaces, uuids etc) About COM Interop will read – Artem Sep 24 '20 at 00:24

0 Answers0