Hello folks,
I am newbie to ATL/COM programming!!!! I am trying to add a COM dll in Visual C++ for PocketPC 2002. So i took a simple hello world program and tried to instantiate an object of one of the interfaces in the dll. I am not able to compile. Looks like I am getting an error in trying to initialize using CComPtr. Would really appreciate your help.!!!!
I have attached the code here and also the compile errors. I am hard pressed with time to finish this. I am not able to proceed further. Would really appreciate any help you can give.
I have also included atlbase.h
CComPtr <IReader> pMobileObj;
// creating a MobileObj object
HRESULT hr =pMobileObj.CoCreateInstance(CLSID_Reader);
Compile errors:
Test.cpp
C:\SMM6.4\POCKETPC\VC++\Test\Test.cpp(159) : error C2065: 'IReader' : undeclared identifier
C:\SMM6.4\POCKETPC\VC++\Test\Test.cpp(159) : error C2955: 'CComPtr' : use of class template requires template argument list
C:\Windows CE Tools\wce300\Pocket PC 2002\atl\include\atlbase.h(674) : see declaration of 'CComPtr'
C:\SMM6.4\POCKETPC\VC++\Test\Test.cpp(159) : error C2133: 'pMobileObj' : unknown size
C:\SMM6.4\POCKETPC\VC++\Test\Test.cpp(159) : error C2512: 'CComPtr' : no appropriate default constructor available
C:\SMM6.4\POCKETPC\VC++\Test\Test.cpp(159) : error C2262: 'pMobileObj' : cannot be destroyed
C:\SMM6.4\POCKETPC\VC++\Test\Test.cpp(161) : error C2065: 'CLSID_Reader' : undeclared identifier
-sunijam
I am newbie to ATL/COM programming!!!! I am trying to add a COM dll in Visual C++ for PocketPC 2002. So i took a simple hello world program and tried to instantiate an object of one of the interfaces in the dll. I am not able to compile. Looks like I am getting an error in trying to initialize using CComPtr. Would really appreciate your help.!!!!
I have attached the code here and also the compile errors. I am hard pressed with time to finish this. I am not able to proceed further. Would really appreciate any help you can give.
I have also included atlbase.h
CComPtr <IReader> pMobileObj;
// creating a MobileObj object
HRESULT hr =pMobileObj.CoCreateInstance(CLSID_Reader);
Compile errors:
Test.cpp
C:\SMM6.4\POCKETPC\VC++\Test\Test.cpp(159) : error C2065: 'IReader' : undeclared identifier
C:\SMM6.4\POCKETPC\VC++\Test\Test.cpp(159) : error C2955: 'CComPtr' : use of class template requires template argument list
C:\Windows CE Tools\wce300\Pocket PC 2002\atl\include\atlbase.h(674) : see declaration of 'CComPtr'
C:\SMM6.4\POCKETPC\VC++\Test\Test.cpp(159) : error C2133: 'pMobileObj' : unknown size
C:\SMM6.4\POCKETPC\VC++\Test\Test.cpp(159) : error C2512: 'CComPtr' : no appropriate default constructor available
C:\SMM6.4\POCKETPC\VC++\Test\Test.cpp(159) : error C2262: 'pMobileObj' : cannot be destroyed
C:\SMM6.4\POCKETPC\VC++\Test\Test.cpp(161) : error C2065: 'CLSID_Reader' : undeclared identifier
-sunijam