Ankit_S

Hello,

I have an MFC application that has been built using VC++ 6.0. It is a 'full server' executable. I import a COM dll into my VC++ project by using the following:

# import <COM_DLL> no_namespace no_implementation raw_interfaces_only named_guids

This creates the type library for the dll (with the name COM_DLL.tlh). The COM_DLL that I am importing has an interface. This (dual) interface is being exposed as a "struct __declspec " in the .tlh file. I want to implement this interface, as this is essentially for a callback.
I am new to the world of VC++ and don't know how to proceed ahead :( Searching over MSDN did not help much either - perhaps I am not searching for the right thing. I would highly appreciate if someone could give me some pointers on how to proceed ahead with implementing the interface.

Thanks,
Ankit


Re: Visual C++ General Problem while trying to implement an interface exposed by a type library in VC++

Holger Grund

What's your concrete problem

You just need to create your own class derived from the COM interface and implement methods (including IUnknown methods) there. In case you're getting errors in the IDe, that don't given you much info, feel free to take a look at the "output window" instead of the "error Window".

-gf





Re: Visual C++ General Problem while trying to implement an interface exposed by a type library in VC++

Ankit_S

hello gf,

Thanks for the help. I was missing implementing the methods of IUnknown and IDispatch and hence the code was giving errors on compilation. After I did that, I could get the callback to work.

Thanks again for the help.

Regards,
Ankit