I want to call an COM object which have been created in c++.
I got an OLD file which contains an interface:
import "oaidl.idl";
import "ocidl.idl";
[oleautomation,uuid(D4F82FE1-E58E-11d1-9D47-006008098294)]
interface INotifier : IUnknown
{
//...
}
The component is created like this in the C++ app:
CreateInstance( __uuidof(CObjectServer),
__uuidof(INotifier),
(void**)&m_pINotifier,
"CObjectServer INotifier");
So I tried to generate a TLB by using the MIDL compiler:
MIDL /tlb notifier.tlb /h notifierTest.h notifier.odl
It runs and no error messages are shown, but it doesn't generate a TLB file.
- How can I find out why it fails?
- Is there any other way to be able to create and invoke that component from C#?
Edit
There was a odl file ObjectServer.odl
which contained the interface ODL inside a library
clause. So I run MIDL on that ODL and got a TLB file.
however, when I try to reference that TLB in my C# project I get: