DLL intercomunication

Joined
Dec 11, 2007
Messages
1
Reaction score
0
HI and thanks for reading.
Please bear patience as I'm a newbie!

This is my question:
I have two dlls:
1 - dlla links against a static library, lib1. Lib1 contains a vector of objects, various classes and member functions. When the main program executes, dlla is loaded and its objects (defined in the static library) are correctly initialized. This lib1 is written in C++ and contains an STL vector of objects.

2 - dllb is a dll generated by compiling/linking fortran subroutines. It is called by dlla at runtime. dllb performs some calculations on objects defined in the lib1, part of dlla.

dlla loads a function pointer in dllb and executes the corresponding Fortran subroutine.
dllb also makes some function calls into dlla.

The problem is that when the Fortran subroutine in dllb calls into dlla, it seems to be returning bogus/uninitialized memory (the vector of objects is now empty).

dlla depends on a static library, lib1.
dllb also depends on the same static library.

I suspect that both dlls have an independent copy of the same static library, lib1 and therefore what one dll does the other doesn't know.

So my question and request for help:
when two dll are loaded and call functions between each other, what should I do?
Am I doing something wrong in the linking?

dlla depends on lib1
dllb depend on lib1 (I'm using the VS 2005 project dependencies dialog box here).

I hope this is an interesting topic and thanks for all the help you can give.
Giop.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top