[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

MIDL-Error

Posted on 2004-09-01
4
Medium Priority
?
303 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
3 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Six Sigma Control Plans
Screencast - Getting to Know the Pipeline

872 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