views:

76

answers:

2

I'm not sure I've setup everything I've needed to in my C# class to properly, but it does work in COM. I've been looking for an example of a C# class that was successfully used in a C/C++ project, but haven't come across anything.

I've tried using the OLE/COM Object View app to open the .tlb file and save as .h, but it gives some errors: MIDL1009: unknown argument ignored; MIDL1001: cannot open input file Studio

"Studio" isn't the name of the file, it's Syslog, so that raises a red flag to me.

Any ideas?

+2  A: 

If you have already exposed your C# class to COM, then you should be using COM interop to access the COM Callable Wrapper from your C++ code.

There is no need to try and generate a header file.

If you have the option of running managed code in your C++ project, then you don't even need COM, you can just reference your C# class directly and access it like you would any other .NET object from C++.

casperOne
+4  A: 

If you have a tlb you do not need a header file. #import of the tlb will generate it for you automatically.

#import "my.tlb" named_guids raw_interfaces_only

See more about #import here.

smink