Simple ATL Com object problem on simplest examples 
Author Message
 Simple ATL Com object problem on simplest examples

I have been playing with the ATL Com Wizard

When I first do a demo the project compiles and works fine

If I make any changed I get 2 error on the build of the DLL with these
messages

ideas?

c:\program files\microsoft visual
studio\vc98\atl\include\atlcom.h(1827) : error C2259:
'CComObject<class CGet>' : cannot instantiate abstract class due to
following members:
        c:\program files\microsoft visual
studio\vc98\atl\include\atlcom.h(1823) : while compiling
class-template member function 'long __stdcall ATL::CComCreator<class
ATL::CComObject<class CGet> >::CreateInstance(void *,const struct
_GUID &,void *
* )'
c:\program files\microsoft visual
studio\vc98\atl\include\atlcom.h(1827) : warning C4259: 'long
__stdcall IGet::Get(int,unsigned char *,int *)' : pure virtual
function was not defined
        d:\temp\client\client.h(86) : see declaration of 'Get'
        c:\program files\microsoft visual
studio\vc98\atl\include\atlcom.h(1823) : while compiling
class-template member function 'long __stdcall ATL::CComCreator<class
ATL::CComObject<class CGet> >::CreateInstance(void *,const struct
_GUID &,void *
* )'
c:\program files\microsoft visual
studio\vc98\atl\include\atlcom.h(1827) : error C2259:
'CComObject<class CGet>' : cannot instantiate abstract class due to
following members:
        c:\program files\microsoft visual
studio\vc98\atl\include\atlcom.h(1823) : while compiling
class-template member function 'long __stdcall ATL::CComCreator<class
ATL::CComObject<class CGet> >::CreateInstance(void *,const struct
_GUID &,void *
* )'
c:\program files\microsoft visual
studio\vc98\atl\include\atlcom.h(1827) : warning C4259: 'long
__stdcall IGet::Get(int,unsigned char *,int *)' : pure virtual
function was not defined
        d:\temp\client\client.h(86) : see declaration of 'Get'
        c:\program files\microsoft visual
studio\vc98\atl\include\atlcom.h(1823) : while compiling
class-template member function 'long __stdcall ATL::CComCreator<class
ATL::CComObject<class CGet> >::CreateInstance(void *,const struct
_GUID &,void *
* )'



Tue, 17 Feb 2004 05:41:33 GMT  
 Simple ATL Com object problem on simplest examples
Dave,

Have a look at MSDN article Q201094. It talks about an inconsistency around
the defaults for the char datatype in the MIDL and C++ compilers. Try
removing this method by editing it out of the idl file, the .h file and the
.cpp file. Then add it back again, but this time specifically type your
second parameter to Get as "unsigned char *" in the parameter field of the
add method dialog.

Dave Smith


Quote:
> I have been playing with the ATL Com Wizard

> When I first do a demo the project compiles and works fine

> If I make any changed I get 2 error on the build of the DLL with these
> messages

> ideas?

> c:\program files\microsoft visual
> studio\vc98\atl\include\atlcom.h(1827) : error C2259:
> 'CComObject<class CGet>' : cannot instantiate abstract class due to
> following members:
>         c:\program files\microsoft visual
> studio\vc98\atl\include\atlcom.h(1823) : while compiling
> class-template member function 'long __stdcall ATL::CComCreator<class
> ATL::CComObject<class CGet> >::CreateInstance(void *,const struct
> _GUID &,void *
> * )'
> c:\program files\microsoft visual
> studio\vc98\atl\include\atlcom.h(1827) : warning C4259: 'long
> __stdcall IGet::Get(int,unsigned char *,int *)' : pure virtual
> function was not defined
>         d:\temp\client\client.h(86) : see declaration of 'Get'
>         c:\program files\microsoft visual
> studio\vc98\atl\include\atlcom.h(1823) : while compiling
> class-template member function 'long __stdcall ATL::CComCreator<class
> ATL::CComObject<class CGet> >::CreateInstance(void *,const struct
> _GUID &,void *
> * )'
> c:\program files\microsoft visual
> studio\vc98\atl\include\atlcom.h(1827) : error C2259:
> 'CComObject<class CGet>' : cannot instantiate abstract class due to
> following members:
>         c:\program files\microsoft visual
> studio\vc98\atl\include\atlcom.h(1823) : while compiling
> class-template member function 'long __stdcall ATL::CComCreator<class
> ATL::CComObject<class CGet> >::CreateInstance(void *,const struct
> _GUID &,void *
> * )'
> c:\program files\microsoft visual
> studio\vc98\atl\include\atlcom.h(1827) : warning C4259: 'long
> __stdcall IGet::Get(int,unsigned char *,int *)' : pure virtual
> function was not defined
>         d:\temp\client\client.h(86) : see declaration of 'Get'
>         c:\program files\microsoft visual
> studio\vc98\atl\include\atlcom.h(1823) : while compiling
> class-template member function 'long __stdcall ATL::CComCreator<class
> ATL::CComObject<class CGet> >::CreateInstance(void *,const struct
> _GUID &,void *
> * )'



Tue, 17 Feb 2004 08:48:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Returns a ATL Simple object by a method of another ATLSimple object

2. Simple ATL Object-Returning a value to the calling object

3. simple example of com in c++

4. Simple example of importing com methods

5. ATL simple object wizard

6. How to delete simple ATL object.

7. Simple ATL Object in my Windows Service

8. I need a HWND in a ATL Simple Object

9. ATL Simple Object in AcitveX Component

10. Cannot Create SIMPLE Atl object

11. Cannot Create SIMPLE Atl object

12. passing COM object pointers to another COM object in ATL

 

 
Powered by phpBB® Forum Software