Solved

ActiveX midl error confusion

Posted on 2000-03-30
5
428 Views
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...
motorola1.odl
oaidl.idl
objidl.idl
unknwn.idl
wtypes.idl
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?

Thanks
0
Comment
Question by:winkle
[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
  • 3
5 Comments
 

Expert Comment

by:vinodkarande
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.


Steps:

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.

regards,
        Vinod

0
 

Author Comment

by:winkle
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.
0
 
LVL 1

Expert Comment

by:kkarunakar
ID: 2694330
can u send the work space to me......
kkarunakar@hotmail.com
0
 
LVL 1

Accepted Solution

by:
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
0
 
LVL 1

Expert Comment

by:kkarunakar
ID: 2695549
Thanks for accepting answer..
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

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 …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

734 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