Click here to Skip to main content
15,897,187 members

Dynamic GUIDS @ build time?

Ron Anders asked:

Open original thread
Hi,

I have a com dll where the source code is the same for both it's 32 bit build and it's 64 bit build.

I found an instance where it is necessary to deploy both the x86 and x64 versions on customer boxes but need the GUIDS of the x86 and x64 versions to be obviously different.

Right now I am attempting at build time to "adjust" the GUIDs on the fly, but this is not working.

I am running a command line build script to rebuild and package it all.

Here is what I am doing that does not work (Always evaluates to WIN32). Perhaps because I am
building it using a WIN32 box.

What I need is a preproccesor directive that can detect that I am BUILDING an x64 dll
and choose the GUID I have "assigned" to the x64 dll. Or that I am BUIDLING an x86 dll
and choose that GUID.

I have read about conditional compilation symbols but I am running VS2008 and can't find that in there to even test it.



C++
#ifdef WIN64
const GUID CLSID_BCRSlave = { 0x617a3262, 0x19a3, 0x44b4, { 0xae, 0x38, 0xd2, 0x51, 0xe2, 0x63, 0x02, 0x64 } };
#endif
#ifdef WIN32
const GUID CLSID_BCRSlave = { 0x617a3262, 0x19a3, 0x44b4, { 0xae, 0x38, 0xd2, 0x51, 0xe2, 0x63, 0x02, 0x32 } };
#endif


Thanks a bunch to anyone that can help.
Beta tester awaits.

:Ron
Tags: C++, Setup

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



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