Re: build C++ COM for 64-bit platform
- From: "Norman Diamond" <ndiamond@xxxxxxxxxxxxxxxx>
- Date: Mon, 15 Oct 2007 18:24:11 +0900
Half of a correction. I wrote:
If client code uses type IntPtr (or if you have 64-bit clients which need
64-bit pointers) then the idl type is __int3264.
MSDN says that the MIDL and VC++ code should use INT_PTR instead of
__int3264.
Half of a correction. I wrote:
In my experience, things still break with some clients. I'm still
experimenting.
In my experience, things still break with clients AND servers.
On the server side (VC++ COM DLL), MSDN says:
* To copy Win32 project settings into a 64-bit project configuration
[...]
* The following project settings are automatically updated on the project
* level:
[...]
* Values of WIN32 are replaced by WIN64 for /D (Preprocessor Definitions).
http://msdn2.microsoft.com/en-us/library/9yb4317s(VS.80).aspx
But that tells two lies. For one, that setting is not automatically
updated. You have to update it manually. And if you update it manually to
WIN64, it still breaks. You have to update it manually to _WIN64.
On the client side (C#), I get error messages like this:
Error CS1503: Parameter '6': cannot convert from 'out System.IntPtr'
to 'out long'.
I can't find any way to fix this. In x86 we get out IntPtr converted to
IntPtr just fine, and they're all 32-bits. In x64, if we change C# source
code to say long instead of IntPtr, then they'll work, they'll all be
64-bits, but they won't work in x86 any more.
"Norman Diamond" <ndiamond@xxxxxxxxxxxxxxxx> wrote in message
news:%23%23KKufuDIHA.6012@xxxxxxxxxxxxxxxxxxxxxxx
Starting point:
http://msdn2.microsoft.com/en-us/library/h2k70f3s(VS.80).aspx
In my experience, additional tweaking is necessary after changing Visual
Studio 2005's settings. Some changes which were supposed to be made to
individual project configurations weren't made automatically. Also
someone has to remind both MSDN and Visual Studio managers that C++
identifiers WIN64 and _WIN64 are not identical.
If client code uses type IntPtr (or if you have 64-bit clients which need
64-bit pointers) then the idl type is __int3264. In my experience, things
still break with some clients. I'm still experimenting.
"George" <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C5017AFE-8A11-4D88-988F-CFB196078AB9@xxxxxxxxxxxxxxxx
Hello everyone,
I am developing C++ COM native code (unmanaged C++) using Visual Studio
2005. I do not take any new features of 64-bit platform, and currently my
code runs fine on 32-bit platform (e.g. Windows XP SP2).
Now I am researching how to build my code for 64-bit platform (e.g.
Windows
2003 Server 64-bit R2)? Any options I need to specify in Visual Studio
2005?
The best solution to me is to make a single build for both 32-bit and
64-bit
platforms, is that possible?
thanks in advance,
George
.
- Follow-Ups:
- Re: build C++ COM for 64-bit platform
- From: George
- Re: build C++ COM for 64-bit platform
- References:
- Re: build C++ COM for 64-bit platform
- From: Norman Diamond
- Re: build C++ COM for 64-bit platform
- Prev by Date: VC++ IntelliSense
- Next by Date: Re: build C++ COM for 64-bit platform
- Previous by thread: Re: build C++ COM for 64-bit platform
- Next by thread: Re: build C++ COM for 64-bit platform
- Index(es):
Relevant Pages
|