views:

147

answers:

1

I have a vb.net dll which I imported in an unmanaged c++ project.

I successfully created an object of the class object using:

CComPtr< IWSconnection > pIWSconnection; 
pIWSconnection.CoCreateInstance( __uuidof(IWSconnection ) ); 

Then, when I tried to call a method from the dll: pIWSconnection.connect(...); I am getting an error: pIWSconnection undeclared identifier.

Why would the object work with 'CoCreateInstance', and not with 'connect'?

TIA

+1  A: 

Your pIWSconnection variable is probably out of the scope when you call connect. You need to use -> to call methods of the interface wrapped by CComPtr, by the way, . is for members of the CComPtr class.

Sheng Jiang 蒋晟