ActiveX midl error confusion

Posted on 2000-03-30
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 200 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Separate files macro - Errors on larger data set 18 69
Generic progress indicator 6 115
deburging in oracle form 12 98
Change to event 1 111
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

813 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

18 Experts available now in Live!

Get 1:1 Help Now