Solved

MIDL-Error

Posted on 2004-09-01
4
292 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now