- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
The attached solution contains a module with two variables that are exported from a DLL and the main program, which should access these variables.
I cannot get the main program to build. I am probably doing something silly. Any help is greatly appreciated.
Daniel.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Daniel,
I beleive you misunderstand what DLLEXPORT does - this provides an entry point in the DLL for a routine to be accessed by the calling program. You cannot EXPORT a variable in this way.
Why do you want the Module in a DLL? You can build the app simply with the Module code in the main build.
David
I beleive you misunderstand what DLLEXPORT does - this provides an entry point in the DLL for a routine to be accessed by the calling program. You cannot EXPORT a variable in this way.
Why do you want the Module in a DLL? You can build the app simply with the Module code in the main build.
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What error message do you get/compiler version are you using/steps are you taking? Your example builds here...
I'm pretty sure DLLEXPORT on variables is "ok". As an operating system concept it is definitely supported (though perhaps discouraged - consider get/set procedures instead), and tests show it works with the compiler too.
I'm pretty sure DLLEXPORT on variables is "ok". As an operating system concept it is definitely supported (though perhaps discouraged - consider get/set procedures instead), and tests show it works with the compiler too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DLLEXPORTing variables is fine. There is a worked example of doing exactly this in the sample DLL\DLL_Shared_Data installed with the compiler (unzip DLL.zip into a writable folder to use.) If it's a module variable, even better, as that will automatically turn into a DLLIMPORT. If you are sharing data between processes, you also need to set the data image section to RWS. See the sample for details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you all for your suggestions.
Steve,
I found the sample and adapted my code. The whole solution builds fine but I still cannot get my program to work properly.
The solution consists of two executables and one DLL. The "shared-data.exe" launches the "writer.exe", using RUNQQ. "writer.exe" updates the integer in the module. "shared-data.exe" prints the updated integer variable. The problem is that I cannot get past the RUNQQ statement: I get the following message from Windows:
writer.exe The application was unable to start correctly (0xc0000005).
The returned result from RUNQQ is 5.
I alsoget the following warning when I build the DLL:
LINK : warning LNK4092: shared writable section '.data' contains relocations; image may not run correctly
(DLL-BuildLog.htm is attached). But the output from DUMPBIN /HEADERS (dumpbin.txt) does not show any relocations for .data Section.
I have attached the source andthe builds.
I am running on Windows 7 64bit. IVF 9.1.039. VS2005
Any ideas?
Steve,
I found the sample and adapted my code. The whole solution builds fine but I still cannot get my program to work properly.
The solution consists of two executables and one DLL. The "shared-data.exe" launches the "writer.exe", using RUNQQ. "writer.exe" updates the integer in the module. "shared-data.exe" prints the updated integer variable. The problem is that I cannot get past the RUNQQ statement: I get the following message from Windows:
writer.exe The application was unable to start correctly (0xc0000005).
The returned result from RUNQQ is 5.
I alsoget the following warning when I build the DLL:
LINK : warning LNK4092: shared writable section '.data' contains relocations; image may not run correctly
(DLL-BuildLog.htm is attached). But the output from DUMPBIN /HEADERS (dumpbin.txt) does not show any relocations for .data Section.
I have attached the source andthe builds.
I am running on Windows 7 64bit. IVF 9.1.039. VS2005
Any ideas?

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page