Book a Demo

Author Topic: C++ Import and __declspec (dllexport)  (Read 2995 times)

Karl.Gaize

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
C++ Import and __declspec (dllexport)
« on: December 15, 2004, 03:32:58 am »
Hi all, I'm new here, having just downloaded the eval version to test things as Visio is crap ;)

I'm having a problem with importing my c++ source code though.... we use a #define to allow classes to be exported from one DLL to another in the following way

#ifdef COREDEF
 #define DLLIMPEXP __declspec (dllexport)
#else
 #define DLLIMPEXP
#endif

class DLLIMPEXP MyClass {...};

when compiling the core dll, COREDEF is define in project settings so the class gets dllexport'ed, then in other (linked) DLL's COREDEF is not defined, so the class just gets referenced. we have to do it this way as we have some vtable problems if done any other way.

problem is.... the C++ import names all my classes DLLIMPEXP..... is there anyway to make the import ignore this definition and populate the project with the correct class names?

hope you can help, otherwise we'll not be able to use EA that extensively, as we need to keep the code and the design synchronised, and there's no way in hell I'm going to rebuild the entire design from scratch :-/

Karl

mikewhit

  • EA User
  • **
  • Posts: 608
  • Karma: +0/-0
  • Accessing ....
    • View Profile
Re: C++ Import and __declspec (dllexport)
« Reply #1 on: December 15, 2004, 05:35:29 am »
I don't know whether this allows you to fix things, but have a look in the Help file under "Language Macros" (in the Code Engineering / Settings / Options section).

It would be more flexible if EA allowed the macro to expand to a textual value, rather than just to be ignored, but you can at least kill your DLLIMPEXP.
« Last Edit: December 15, 2004, 05:41:07 am by mikewhit »