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

Dan Breslau
  • 11,472
  • 2
  • 35
  • 44
user228058
  • 465
  • 1
  • 7
  • 22

1 Answers1

1

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 蒋晟
  • 15,125
  • 2
  • 28
  • 46