Re: Structure containing string across DLL boundary



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 is
set
to the notification message 'I am doing some work'

The function in the exe is invoked with a pointer to the structure and
then

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 dinkumware
gave
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


.



Relevant Pages

  • Problems installing DBD::mysql on Solaris
    ... referenced symbol not found at ... Perhaps a required shared library or dll isn't installed where expected ... Failed 2/5 tests, 60.00% okay ... t/20createdrop.....install_driverfailed: Can't load ...
    (comp.lang.perl.modules)
  • Re: WINWORD caused an invalid page fault in module WINWORD.EXE at
    ... Okay, this is a similar, somewhat generic message. ... This DLL may ... >> because your video driver can't handle the load. ...
    (microsoft.public.word.application.errors)
  • Re: Linux, X, ld, gcc, linking, shared libraries and stuff
    ... Okay, different concepts, then. ... Isn't that just "load on demand"? ... > You know, when Windows loads a DLL, it sorts out all the "dynamic ... Well, weak externals is slightly more than that, but you're essentially ...
    (alt.lang.asm)
  • Re: VB6 - why isnt a straight Win32 DLL offered as a project type?
    ... between an ActiveX DLL and a "normal" Win32 DLL. ... Okay, here goes. ... I've stepped away from the Microsoft MASM compiler. ... NASM compiler. ...
    (microsoft.public.vb.general.discussion)
  • Re: Exception from HRESULT: 0x800AC352
    ... Okay, here's the error message I get from MS Access: ... About the security folder, I add everybody profile. ... And I also unregistred and re-registred the dll. ... > you tried unregistering and reregistering the DLL? ...
    (microsoft.public.dotnet.framework.aspnet)

Loading