Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC8.0 COM 64-bit
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 19-Apr-10 2:14am
Edited 19-Apr-10 2:15am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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!
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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
  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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
midl /amd64 /Oicf /h "CSObjectCache.h" /iid "CSObjectCache_i.c" "CSObjectCache.idl"
 
Giving the platform switch solved my problem.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 5,130
1 DamithSL 4,237
2 Maciej Los 3,700
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,846


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 15 Jun 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100