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.
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.