Hi, Not to sure why you are getting a problem. Here is an example of how to use it in VC++ (see if it differs to yours) First, the #import
#import "D:\My Projects\C++\MyObj\MyObj.tlb"
using namespace MyObjLib;
Add the namespace to avoid any conflicts with other COM objects you may use that will have the same name. Now when using it:
MyObjLib::IMyObjPtr pMyObj = NULL;
try
{
if (SUCCEEDED(pMyObj.CreateInstance(\_\_uuidof(MyObjLib::MyObj))) && pMyObj != NULL)
{
pMyObj->MyString = \_T("Hello");
}
}
catch(\_com\_error &e)
{
}
This ultimately will use the wrapper method PutMyString( _bstr_t pVal ) that is defined in the two new files generated by the #import statement. These should be in your Debug/Release directories and called MyObj.tlh and MyObj.tli. Ones the header file, the other the implementation file. Have a look through them to see how your COM object has been wrapped. Hope this has helped, Andy