SDK Question

Joined
Sep 15, 2006
Messages
511
Is the difference between the DllExport and non DllExport function whether or not its exposed to Python??

-ClassicThunder
 
Is the difference between the DllExport and non DllExport function whether or not its exposed to Python??

-ClassicThunder

I believe the difference is what is exposed to the exe. That is, the parts of the code that firaxis writes will sometimes directly call functions in the DLL, and those parts are hit with DllExport. I'm not 100% on this though.

All the functions exported to python are found in the Cy* files.
 
I concur:

The dllexport and dllimport storage-class attributes are Microsoft-specific extensions to the C and C++ languages. They enable you to export and import functions, data, and objects to and from a DLL.

...

These attributes explicitly define the DLL's interface to its client, which can be the executable file or another DLL. Declaring functions as dllexport eliminates the need for a module-definition (.DEF) file, at least with respect to the specification of exported functions.

http://msdn2.microsoft.com/en-us/library/3y1sfaz2.aspx
 
DLL export is necessary to have another cpp file call upon a function defined on another cpp file, if you don't DLL export it is just local to that file and if you try to compile with an outside reference to it you get a linker error (remember that when you compile each cpp file you get an object file and these are then Linked together to create a Dynamically LINKED Library, DLL export tells the compiler to create attachment points for the linker, then a 'hook' from another file can grab onto it and call the function). At least thats my experience and understanding. Naturally everything thats exposed to Python is DLL exported because it has to be referenced on the PythonInterface.cpp type files. I don't think the exe is involved with most of these functions but a few are presumably being called in the exe because their completely uncalled in the code yet we can be assured they are run at some point.
 
Impaler[WrG];5280483 said:
DLL export is necessary to have another cpp file call upon a function defined on another cpp file, if you don't DLL export it is just local to that file and if you try to compile with a reference to it you get a linker error, atleast I do. Naturally everything thats exposed to Python is DLL exported because it has to be referenced on the PythonInterface.cpp type files. I don't think the exe is involved with most of these functions but a few are presumably being called in the exe because their completely uncalled in the code yet we can be assured they are run at some point.

Excellent. Thanks Impaler that explains a lot of my problems.

-ClassicThunder
 
Back
Top Bottom