I was wondering if there is a catch when you use a win32 compiled Managed C++
asssembly on XP 64bit. (2.0 Framework)

My app runs on 32 bit systems fine! But it says that there is a
BadImageFormatException when I try to run it on XP 64bit. It doesn't matter
if the application is compiled for an x64 system or the standard 'mixed
platforms'.

I realize I am basically saying, "It doesn't work." Therefore, I am
specifically asking if you can use a win32 Managed C++ assembly on XP 64bit.
I didn't see an option to compile a Managed C++ project for x64.

Re: Managed C++ by James

James
Sun Oct 02 18:47:25 CDT 2005

http://blogs.msdn.com/joshwil/archive/2005/04/08/406567.aspx

"Steven" <Steven@discussions.microsoft.com> wrote in message
news:D47CA113-2377-4784-BDF8-79331B9FCA56@microsoft.com...
>I was wondering if there is a catch when you use a win32 compiled Managed
>C++
> asssembly on XP 64bit. (2.0 Framework)
>
> My app runs on 32 bit systems fine! But it says that there is a
> BadImageFormatException when I try to run it on XP 64bit. It doesn't
> matter
> if the application is compiled for an x64 system or the standard 'mixed
> platforms'.
>
> I realize I am basically saying, "It doesn't work." Therefore, I am
> specifically asking if you can use a win32 Managed C++ assembly on XP
> 64bit.
> I didn't see an option to compile a Managed C++ project for x64.



Re: Managed C++ by Ken

Ken
Sun Oct 02 18:50:47 CDT 2005

Hi,

Do you have the same version of the dot net framework 2.0
installed on both computers? By that I mean beta 1, 2, a ctp, or rc not 32
or 64bit versions.

Ken
-----------
"Steven" <Steven@discussions.microsoft.com> wrote in message
news:D47CA113-2377-4784-BDF8-79331B9FCA56@microsoft.com...
>I was wondering if there is a catch when you use a win32 compiled Managed
>C++
> asssembly on XP 64bit. (2.0 Framework)
>
> My app runs on 32 bit systems fine! But it says that there is a
> BadImageFormatException when I try to run it on XP 64bit. It doesn't
> matter
> if the application is compiled for an x64 system or the standard 'mixed
> platforms'.
>
> I realize I am basically saying, "It doesn't work." Therefore, I am
> specifically asking if you can use a win32 Managed C++ assembly on XP
> 64bit.
> I didn't see an option to compile a Managed C++ project for x64.



Re: Managed C++ by Tim

Tim
Sun Oct 02 22:27:53 CDT 2005

OP:

Before you compiled for X64 did you create a new configuration for the
project and copy it from an existing one? This seems to be an important step
as often people change a setting here or there to create a new config for EG
Managed code and forget some of the other switches. The switches are
supposed to cross check each other, but this did not always seem to work
100%.

This was certainly the case with Beta 2. The latest RC version seems to have
fixed the BIFE's I was getting for other reasons (excessively large image
being generated - 36 mb!).

I suggest if you have difficulty on this front you plod on over to the VC
Technical Forums...

http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=29

Regards,
- Tim



"Ken Tucker [MVP]" <vb2ae@bellsouth.net> wrote in message
news:eli3hw6xFHA.3772@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> Do you have the same version of the dot net framework 2.0
> installed on both computers? By that I mean beta 1, 2, a ctp, or rc not
> 32 or 64bit versions.
>
> Ken
> -----------
> "Steven" <Steven@discussions.microsoft.com> wrote in message
> news:D47CA113-2377-4784-BDF8-79331B9FCA56@microsoft.com...
>>I was wondering if there is a catch when you use a win32 compiled Managed
>>C++
>> asssembly on XP 64bit. (2.0 Framework)
>>
>> My app runs on 32 bit systems fine! But it says that there is a
>> BadImageFormatException when I try to run it on XP 64bit. It doesn't
>> matter
>> if the application is compiled for an x64 system or the standard 'mixed
>> platforms'.
>>
>> I realize I am basically saying, "It doesn't work." Therefore, I am
>> specifically asking if you can use a win32 Managed C++ assembly on XP
>> 64bit.
>> I didn't see an option to compile a Managed C++ project for x64.
>
>



RE: Managed C++ by Steven

Steven
Wed Oct 05 13:37:05 CDT 2005

I don't even see an option to compile the Managed C++ project for anything
but Win32. I have been told I won't be able to compile for x64 until the
actual VS release. I don't know if that is true or not.

That doesn't explain why the normal 32 bit build won't work. I would have
thought it would run just be like every other 32 bit program that runs on 64
bit.

"Steven" wrote:

> I was wondering if there is a catch when you use a win32 compiled Managed C++
> asssembly on XP 64bit. (2.0 Framework)
>
> My app runs on 32 bit systems fine! But it says that there is a
> BadImageFormatException when I try to run it on XP 64bit. It doesn't matter
> if the application is compiled for an x64 system or the standard 'mixed
> platforms'.
>
> I realize I am basically saying, "It doesn't work." Therefore, I am
> specifically asking if you can use a win32 Managed C++ assembly on XP 64bit.
> I didn't see an option to compile a Managed C++ project for x64.

Re: Managed C++ by James

James
Wed Oct 05 14:58:21 CDT 2005

If you are using /clr:safe, the compiled exe will be platform-independent,
meaning it will run as 32-bit on x86 and as 64-bit on x64 . If you are
dependent on a 32-bit dll, it will work fine on x86 because the app will run
as 32-bit, but will throw a BIFE if you run it on x64 (can't mix "bitness").

On another topic, VC++ 2005 can already compile for x64 unless you are using
the Express beta. I think I had read that it would be added in the release
version but later read that it wouldn't be. I guess we'll find out in about
a month.

"Steven" <Steven@discussions.microsoft.com> wrote in message
news:DA04DC07-CBAC-4022-9710-D3CCCCD3CF9E@microsoft.com...
>I don't even see an option to compile the Managed C++ project for anything
> but Win32. I have been told I won't be able to compile for x64 until the
> actual VS release. I don't know if that is true or not.
>
> That doesn't explain why the normal 32 bit build won't work. I would have
> thought it would run just be like every other 32 bit program that runs on
> 64
> bit.
>
> "Steven" wrote:
>
>> I was wondering if there is a catch when you use a win32 compiled Managed
>> C++
>> asssembly on XP 64bit. (2.0 Framework)
>>
>> My app runs on 32 bit systems fine! But it says that there is a
>> BadImageFormatException when I try to run it on XP 64bit. It doesn't
>> matter
>> if the application is compiled for an x64 system or the standard 'mixed
>> platforms'.
>>
>> I realize I am basically saying, "It doesn't work." Therefore, I am
>> specifically asking if you can use a win32 Managed C++ assembly on XP
>> 64bit.
>> I didn't see an option to compile a Managed C++ project for x64.