Solved

MIDL-Error

Posted on 2004-09-01
4
286 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
Comment Utility
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
Comment Utility
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
Comment Utility
PAQed, with points refunded (125)

Computer101
E-E Admin
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
A short article about problems I had with the new location API and permissions in Marshmallow
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

772 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

12 Experts available now in Live!

Get 1:1 Help Now