Go Premium for a chance to win a PS4. Enter to Win


ActiveX midl error confusion

Posted on 2000-03-30
Medium Priority
Last Modified: 2013-11-20
I'm on NT 4.0 and using DevStudio C++ version 5.0. I'm figuring out how to create an ActiveX control. I generate the project, go to Class Wizard and add a method. The method returns void and has three arguments. I select from the drop down list:

inStr    as   LPCSTR
outStr   as   BSTR*
outLong  as   long*

The code that Developer studio drops into my source file is as follows:

void CIQTMtrlaCtrl::IQTStringConv(LPCTSTR inStr, BSTR FAR* outStr, long FAR* outLong)
      // TODO: Add your dispatch handler code here


If I try to compile at this point I get the following:

Creating Type Library...
Error executing midl.exe.


There's no information as to why I'm getting the midl.exe error message. I've inserted no code. I'm just trying to compile generated code here. Does anyone have any clue why the compiler is dying on code that was generated by devstudio?

Question by:winkle
  • 3

Expert Comment

ID: 2672670
do u mean that ur just getting the message "Error executing midl.exe" without any error code.?

Usually if u dont have any midl compiler installed on ur system then u get the error message
"Error spawning midl.exe"

U can do one thing u search for the midl.exe file in ur VC install directory. if it does not exits then u will have to reinstall it.....

if it exits then may be the command line options specified in ur
Project Settings\MIDL tab are not proper.

U first clear all the options in this tab. And try again.

if this does not work then try compiling ur .idl file from command prompt.


1. Change to the directory that contains the .idl file to be compiled.

2. Type at the command prompt

"midl file.idl /h file.h /idd file_i.c /tlb file.tlb"

where file = your .idl filename

if this does not work then
try out this command

"midl file.idl /mktyplib203 /h file.h /idd file_i.c /tlb file.tlb"

Try out these options and hope it works out fine for u.......

Reply back with ur comments ASAP.



Author Comment

ID: 2685798
Yes.  I am getting this error message with no error code.  I did do a "find," I have midl.exe; it runs if I make no changes to the generated code.  I do not understand why I am getting this error message, and the lack of a code explaining it is the problem.  Thank you.

Expert Comment

ID: 2694330
can u send the work space to me......

Accepted Solution

kkarunakar earned 800 total points
ID: 2694858
Hi there,
Thanks for providing ur workspace..
I just complied ur workspace and got same error.
Then I did some steps and it works fine.U can try it..
1. Delete ur methods ....from ctrl class and from declaration from interface.
I mean all functions other than about box.
2.Rebuild  ur workspace..
3.Then add methods again..
Hope it will work..
give me comment also if not work
Regards keshav

Expert Comment

ID: 2695549
Thanks for accepting answer..

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

971 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