Link to home
Start Free TrialLog in
Avatar of Marvin Rowe
Marvin RoweFlag for United States of America

asked on

Need to link C++ service to C# DLL

Need to access C# DLL from C++ Have looked into Google and this YouTube Site

https://www.youtube.com/watch?v=M4F6Z4-NAos and have set the [assembly: ComVisible(true)] in the called DLL -- Have all related DLL's strongly signed -- Have an interface and called class with a [ComVisible(true)] attribute and have a GUID attribute for the Interface

The C# solution compiles clean and an associated tbl file is created


The #Imports command in C++ seems OK but the simple C++  basic console does not compile because it can not find the file.  The directory was copied straight from file employer

#import "CC:\Users\<My Name>\source\repos\<projectName>\<DLL Name>\bin\Debug\<DLL Name>.tlb" raw_interfaces_only


Any ideas?

ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Marvin Rowe

ASKER

Thanks but that was not the issue but I have gotten further  

Here is where I am now -- Added #include <tchar.h> to the C++ program and it saw the file

Not done yet but getting further -- May have this issue resolved -- Testing now -- Will get back to you if I need more assistance
Andy's initial answer is correct.  Adding "#include <tchar.h>"  to the module and keeping with single \'s in the directory path also worked.