Re: Structure containing string across DLL boundary
- From: "Stephen Howe" <stephenPOINThoweATtns-globalPOINTcom>
- Date: Thu, 2 Nov 2006 14:51:08 -0000
I think I am maintaining the discipline of which you speak.
In that case do you pass the string by const reference to the DLL? If you
pass by value, then copy constructors are invoked and that causes memory
allocation/deallocation. I am not sure of the exact "who is doing what in
terms of EXEs/DLLs" but again, I think it is okay because each module does
it's own allocation/deallocation
The DLL allocates the structure with the embedded string. The string isset
to the notification message 'I am doing some work'then
The function in the exe is invoked with a pointer to the structure and
cout << structurePtr->string << endl ;
That is it. Call returns to DLL where structure is deallocated.
Should be okay, in theory
Are there memory allocations/deallocations occurring in the console output
call?
Not as far as I know. But not impossible.
The articles on the Web I refer were response Pete Becker of dinkumwaregave
on this issue relating to static variables in some STL structures that
caused problems across the DLL/exe boundary but had been fixed in newer
releases of the compiler.
He might be referring to Dinkumware's offering with Version 5.0 & 6.0 of
VC++.
That did have some static variables, and you can download headers to "fix"
this problem from Dinkumware's website.
But for 7.0, 7.1 & 8.0, AFAIK, this is fixed and not a problem.
Stephen Howe
.
- Follow-Ups:
- Re: Structure containing string across DLL boundary
- From: Daniel F. Devine
- Re: Structure containing string across DLL boundary
- References:
- Re: Structure containing string across DLL boundary
- From: Stephen Howe
- Re: Structure containing string across DLL boundary
- From: Daniel Devine
- Re: Structure containing string across DLL boundary
- Prev by Date: Re: Structure containing string across DLL boundary
- Next by Date: Re: Structure containing string across DLL boundary
- Previous by thread: Re: Structure containing string across DLL boundary
- Next by thread: Re: Structure containing string across DLL boundary
- Index(es):
Relevant Pages
|
Loading