Solved

MIDL-Error

Posted on 2004-09-01
4
298 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

726 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