Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I new to com.
I have a com project where in the project settings the following values are given
"configuration properties-->c/c++-->Preprocessor-->preprocessor definitions" _ATL_ATTRIBUTES

"configuration properties-->Linker-->Embedded IDL-->merged IDL Base File name" _cfgcachecallback.idl

"configuration properties-->;Linker-->Advanced--> Target machine" MACHINE:X64

When compiling this project there are files created _cfgcachecallback.idl,_cfgcachecallback.h,_cfgcachecallback.tlb,_cfgcachecallback_i.c,_cfgcachecallback_p.c .
When i compile this project in a 32 bit machine targeting 64bit machine the file "_cfgcachecallback_p.c" generated is having a #if defined(_M_AMD64) in it.Which sees to be proper. But when i try to compile the same project in Windows 2003 64 bit machine the file "_cfgcachecallback_p.c" is having a #if defined(_M_IA64) .

what chnage i have to do in project settings to make sure that the file _cfgcachecallback_p.c generated is targeting the AMD 64.

I want to make sure that i target AMD 64 .
can any one help me in getting a proper AMD 64 build.
WBR,
Sabu.
Posted
Updated 19-Apr-10 1:15am
v2

I had the similar situation here when I port our application to x64 environment. What I did to fix it is to set Target Environment to x64 for all IDL files in the project except the same setting in the Project level. Then proxy stub code generated by MIDL comipler should target to "env=Win64"

Hope this help.

Congjin
 
Share this answer
 
Hi,
The IDL files where using custom build.
In the IDL files properties General -->Tools "custom build tool" was selected.
And in the Custom Build Step -->Command line the mild command was given with some options. I had to do the platform specification here ie
VB
midl /amd64 /Oicf /h "CSObjectCache.h" /iid "CSObjectCache_i.c" "CSObjectCache.idl"


Giving the platform switch solved my problem.
 
Share this answer
 
v2
Hi,
As i dont have an IDL file in the project i dont get an MIDL tab .
So its not possible to set any thing there.
i tried the command line "/env win64" in "configuration properties-->Linker-->Embedded IDL-->MIDL commands".

the file "_cfgcachecallback_p.c" is having the following comments in it.



/* this ALWAYS GENERATED file contains the proxy stub code */


/* File created by MIDL compiler version 6.00.0366 */
/* at Tue Apr 20 07:55:22 2010
*/
/* Compiler settings for _cfgcachecallback.idl:
Oicf, W1, Zp8, env=Win64 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )


WBR,
sabu
 
Share this answer
 
v3
Look at the Target environment under the MIDL property page on your project properties: the files you are talking about are generated by the MIDL compiler!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900