Using the .tlb file into the C++ is not straightforward at as you do into the VB. However you can use the following code which would demo how can you use the type libraries into the VC++.
Code:
#import "MyPath\MyTypeLib.tlb" rename_namespace("SmthLooksMeNice") using namespace SmthLooksMeNice;
#include <objbase.h>
int main()
{
CoInitialize(NULL);
// Assume your COM object is named MyComObjectName
// and there is an interface IMyComObject.
// #import generated a smart pointer over that interface.
IMyComObjectPtr pObject(_uuidof(MyComObjectName));
BSTR temp = pObject->SomeProp;
pObject->DoSmth();
//...
CoUninitialize();
return 0;
}
I am hoing that the coding example which i have mentioned over here would be useful to get the requirement of yours.
Bookmarks