-
September 4th, 2009, 03:16 PM
#1
Cross-Calling W/ Modules
I have a problem.. In it's simplest form I have 2 dll's (A and B) and the main exe. The main exe needs to call functions from both A, and B, and A needs to call functions from B. But B also needs to call functions from A..
Does anyone know a way this is possible? I'm not really sure what this would be called either.
-
September 4th, 2009, 03:20 PM
#2
Re: Cross-Calling W/ Modules
Sure, it's possible.
Viggy
-
September 4th, 2009, 04:00 PM
#3
Re: Cross-Calling W/ Modules
But how , When I try to include the DLL's functionality I get a recursive include.. which either gives me compilation errors. Or freezes the application. Is there a way to make sure that the DLL is only loaded once and use a reference to it rather than loading it again? I have no idea how to do such a thing.
-
September 8th, 2009, 03:50 PM
#4
Re: Cross-Calling W/ Modules
Recursive includes are a problem whether you're using a DLL or not. You can either (a) forward declare your variables in one head file, and only include the header in your source; or (b) use explicit linking (LoadLibrary) and don't include any header files.
Viggy
-
September 12th, 2009, 10:53 PM
#5
Re: Cross-Calling W/ Modules
Thanks ^_^, I figured out that for what I am trying to do, the LoadLibrary is the best option for me =\ a little cumbersome looking in the initialization but it works, I appreciate the response ^_^.
-
September 14th, 2009, 07:16 AM
#6
Re: Cross-Calling W/ Modules
The main exe needs to call functions from both A, and B, and A needs to call functions from B. But B also needs to call functions from A..
When I try to include the DLL's functionality I get a recursive include..
Sorry, but I cannot see any relations between these two statments. Recursive include could happen because of using types but not functions (and therefore, the forward declaration will relly help). The sample would be good.
Besides, I cannot see any reason to have two separate dlls while they both appear depending on each other.
Last edited by Igor Vartanov; September 14th, 2009 at 07:18 AM.
Best regards,
Igor
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|