Modules in DLL using modules in main prog

Modules in DLL using modules in main prog


I have some problems interfacing my dll and my main program.
My architecture can be described as follows :
I have defined several modules in my main program, sharing data and procedures together (USE, private...).
I want to build a DLL containing modules. The procedures contained in the dll are obviously called by the program. This step works.
The other problem is that I want the modules defined in the dll to use modules defined in the main program and to share the data allocate in these modules.
Is this procedure legal and possible ?
How does it work ?
Any examples ?

Thanks, Benoit

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I don't see any way to do this - not in the manner you're suggesting. A DLL has to resolve all of its external references when linked, you can't have it "link against" the main program. The way I would recommend handling this is to have the main pass a pointer to the data to the DLL.


Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today