Book a Demo

Author Topic: c++ exported class reengineering  (Read 4051 times)

z.kadlec

  • EA User
  • **
  • Posts: 22
  • Karma: +0/-0
    • View Profile
c++ exported class reengineering
« on: January 03, 2004, 11:15:30 pm »
Hi,

I write a dynamic libraries in C++ usable on Win32 and UNIX.
There are exported classes in that libraries.
Because UNIX and Win32 are in this not compatible, I use my macro (named MY_DLLEXPORTCLASS).

class MY_DLLEXPORTCLASS CState
{
...
}

class MY_DLLEXPORTCLASS CMove
{
...
}

When I'm importing classes form a source (*.h), EA create lot of classes named MY_DLLEXPORTCLASS   ;-(

I thing, to solve this problem, there could be a list of MACROs (or simply any text phrases), which should be
ingnored on source parsing.

Z.Kadlec
     
 

benc

  • EA Administrator
  • EA User
  • *****
  • Posts: 200
  • Karma: +0/-0
    • View Profile
Re: c++ exported class reengineering
« Reply #1 on: January 12, 2004, 02:13:10 pm »
Hi Z.Kadlec,

You might find EA's macro definition feature useful here. It is available from: Configuration | Language Macros.

You can define such macros as MY_DLLEXPORTCLASS which occur within class/member declarations. There is a built-in syntax with this feature that allows you to specify more complex macros that include conditionals- refer to the existing C++ macros. Once defined, EA will ignore these macros during import.

Note: You need not define macros that are used in place of a type, such as LPCSTR. Also, macros that occur within function bodies will be ignored.

I hope this helps.

Regards,
Ben