How to get 64-bit MIDL files to work right?  
Author Message
barchamb





PostPosted: 64-Bit .NET Framework Development., How to get 64-bit MIDL files to work right? Top

I have an IDL file that I wrote that builds and runs fine.  Now, we have a requirement to make our server run on 64-bit.  According to the MIDL compiler docs:

"Use the /env win64 switch to generate 64-bit stubs only. The default is to generate dual stubs that run on both platforms."

However, I do not find that to be true.  If I specify /env win64, I get 64-bit stubs.  But, if I don't specify anything, I do not get dual stubs, I get 32-bit stubs that have this:

#if !defined(_M_IA64) && !defined(_M_AMD64)

So, they won't build 64-bit.

Help!


.NET Development24  
 
 
Amir Duany





PostPosted: 64-Bit .NET Framework Development., How to get 64-bit MIDL files to work right? Top

I Have the same problem do U have a solution for that

Thanks

Amir



 
 
barchamb





PostPosted: 64-Bit .NET Framework Development., How to get 64-bit MIDL files to work right? Top

No, I never did find a solution to this. So, what we did was run the MIDL compiler for 32-bit, then run it again for 64-bit and put it all in one file, separated by #ifdefs...

 
 
Amir Duany





PostPosted: 64-Bit .NET Framework Development., How to get 64-bit MIDL files to work right? Top

Did U run midl xxx.sln

 
 
barchamb





PostPosted: 64-Bit .NET Framework Development., How to get 64-bit MIDL files to work right? Top

We ran "MIDL /app_config xxx.idl" for the 32-bit files and then "MIDL /app_config /x64 xxx.idl" for the 64-bit files. Then we combined them into one xxx.h file, one xxx_c.c file, and one xxx_s.c file.

 
 
JessieLiu





PostPosted: 64-Bit .NET Framework Development., How to get 64-bit MIDL files to work right? Top

Which version of midl.exe and Visual studio are you using

I found if using 6.00.0347 /Win64 means compling supporting AMD64 and IA64,
but in 6.0.366.1, /Win64 means compling only supporting AMD64.

I am afraid there is any special thing changed.


 
 
JessieLiu





PostPosted: 64-Bit .NET Framework Development., How to get 64-bit MIDL files to work right? Top

Which version of midl.exe and Visual studio are you using

I found if using 6.00.0347 /Win64 means compling supporting AMD64 and IA64,
but in 6.0.366.1, /Win64 means compling only supporting IA64.

I am afraid there is any special thing changed.


 
 
Ahsan Ali





PostPosted: 64-Bit .NET Framework Development., How to get 64-bit MIDL files to work right? Top

I found out the hard way that you have to specify "/x64" as additional options to the midl compiler to generate 64-bit tlbs. Simply specifying "/env x64" as the MSDN help suggests isn't enough.

Hope that helps.
Ahsan