Solved

MIDL-Error

Posted on 2004-09-01
4
297 Views
Last Modified: 2010-04-17
Hi all,
 I developed COM Component using ATLCOM AppWizard.I added a simple ATL Object and tried adding a function to that object.When i add fucntion that works with numbers (i.e both in and out parameter are long numbers),then no problem, the component is getting compiled but when tried adding a function that takes char* as in parameter its giving me the following errors.

d:\vc6\atl\include\atlcom.h(1827) : error C2259: 'CComObject<class CATL_COM>' : cannot instantiate abstract class due to following members:

   d:\vc6\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class ATL::CComObject<class CATL_COM> >::CreateInstance(void *,const struct _GUID &,void ** )'

d:\vc6\atl\include\atlcom.h(1827) : warning C4259: 'long __stdcall IATL_COM::Display(unsigned char *,int *)' : pure virtual function was not defined

c:\com\simpleatlcom\simpleatlcom.h(80) : see declaration of 'Display'

 d:\vc6\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class ATL::CComObject<class CATL_COM> >::CreateInstance(void *,const struct _GUID &,void ** )'

d:\vc6\atl\include\atlcom.h(1827) : error C2259: 'CComObject<class CATL_COM>' : cannot instantiate abstract class due to following members:
        d:\vc6\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class ATL::CComObject<class CATL_COM> >::CreateInstance(void *,const struct _GUID &,void ** )'

d:\vc6\atl\include\atlcom.h(1827) : warning C4259: 'long __stdcall IATL_COM::Display(unsigned char *,int *)' : pure virtual function was not defined
c:\com\simpleatlcom\simpleatlcom.h(80) : see declaration of 'Display'


d:\vc6\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class ATL::CComObject<class CATL_COM> >::CreateInstance(void *,const struct _GUID &,void ** )'


Can any one tell me y ami  getting these errors???

Thanx in advance
0
Comment
Question by:ArunaK
  • 2
4 Comments
 

Author Comment

by:ArunaK
ID: 11979465
Hi all,
 I finally got the answer myself..whenever we r  using char datatype in the parameter we have to make the following entry in the MIDL tab under Project->Settings Option:
                    /char unsigned

Thats becoz the MIDL Compiler treats char as signed while the VC++ compiler treat char as unsigned so this entry should be made .After making this entry my code worked fine



0
 

Author Comment

by:ArunaK
ID: 12014506
hi,
 i have given the solution myself so u can remove this question from open section
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12342779
PAQed, with points refunded (125)

Computer101
E-E Admin
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question