Software Archive
Read-only legacy content
17060 Discussions

Modules in DLL using modules in main prog

Intel_C_Intel
Employee
1,364 Views
Hi,

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
0 Kudos
1 Reply
Steven_L_Intel1
Employee
1,364 Views
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.

Steve
0 Kudos
Reply