Book a Demo

Author Topic: about eaGUID macro , how to keep it value in code?  (Read 2989 times)

freekiller

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
about eaGUID macro , how to keep it value in code?
« on: December 24, 2009, 06:34:57 pm »
EA is a good tool , I'm studying to use it construct some interface definition.
 
I want to add some UUID define within class declaration,
like as :
class __declspec(uuid("7D4A167E-D3A3-49c7-B6DA-F2F5728607B7")) IMyInterface : public IUnknown

I had used the eaGUID macro in "Class Declaration Template" for c++ , add the code below:
%if classStereotype=="com_interface"%
$declspec_uuid = "__declspec(uuid(" + %qt% + %TRIM(eaGUID,"{}")% + %qt% + "))"
$declspec_uuid
%endIf%

but I found that each time generate the header file , the guid will be re-generate .
I hope I can fix it after the first generation.

Can give me more advice ?

And the at the head of .h file , EA will build the #define in "File Template" :
$guid = "EA_" + %TRIM(eaGUID,"{}")%
$guid = %REPLACE($guid,"-","_")%
$guid += "__INCLUDED_"
#if !defined($guid)
#define $guid\n

It also use eaGUID , but not changed after re-generation , why ??

Takeshi K

  • EA User
  • **
  • Posts: 632
  • Karma: +43/-1
    • View Profile
    • Sparx Systems Japan
Re: about eaGUID macro , how to keep it value in c
« Reply #1 on: December 28, 2009, 05:10:53 pm »
Hello,

I do not know why the eaGUID sometimes changes and sometimes not, but I recommend you to try classGUID instead of eaGUID.

I think this classGUID will be not changed.

Hope this helps you.
--
t-kouno