dll vs. exe access violoations... 
Author Message
 dll vs. exe access violoations...

I have had to disable inlines on several of my classes, because I am
getting a
access violation debug assertion for trying to delete memory which was
new'd
in a dll, and then the delete attempt done in the exe. Is this what it
looks like,
separate memory spaces for each dll and then one for the exe? Seems like
a
fragile and even broken implementation to me, witness not being able to
use
inline dtors in this event! What about templates which are inline code,
doesn't
that seriously limit their usefulness/implementation possibilities?

Is the answer an allocator, overridding new delete, or what?

Thanks for any help...




Fri, 27 Apr 2001 03:00:00 GMT  
 dll vs. exe access violoations...

Quote:

>I have had to disable inlines on several of my classes, because I am
>getting a
>access violation debug assertion for trying to delete memory which was
>new'd
>in a dll, and then the delete attempt done in the exe. Is this what it
>looks like,
>separate memory spaces for each dll and then one for the exe? Seems like
>a
>fragile and even broken implementation to me, witness not being able to
>use
>inline dtors in this event! What about templates which are inline code,
>doesn't
>that seriously limit their usefulness/implementation possibilities?

>Is the answer an allocator, overridding new delete, or what?

The answer is to link the modules to the DLL form of the CRT, msvcrt.dll.
That way, they all use the same heap, and one module can delete memory
allocated by another.

--
Doug Harrison



Fri, 27 Apr 2001 03:00:00 GMT  
 dll vs. exe access violoations...

Thanks Doug, it seems to work fine, as you said it would.

In more detail, I am using vc++5.0 to develop an app containing _many_
dlls, and a small exe driver section. I want to use either HP or SGI
stl, and old style IO streams. I am currently using the HP stl from
the Butler site, labled as:

Quote:
>This archive contains source code files for the Standard Template
>Library (STL). These files are a slight modification of the October
>31, 1995 release of the Hewlett-Packard implementation.
>D.R. Musser
>12/29/95

in the readme file. I have noticed that SGI has a newer release of
3.11 july of 98. Should I use that instead of the older HP version?
Input welcome... any problems on MSVC++5.0? I will got to 6.0 if
need be.

Anyone else done what I am attempting, and if so how well did it work
out for you? Anything I need to watch out for, be aware of?

Thanks in advance...


(remove the NO_SPAM for correct email address)

Quote:


> >I have had to disable inlines on several of my classes, because I am
> >getting a
> >access violation debug assertion for trying to delete memory which was
> >new'd
> >in a dll, and then the delete attempt done in the exe. Is this what it
> >looks like,
> >separate memory spaces for each dll and then one for the exe? Seems like
> >a
> >fragile and even broken implementation to me, witness not being able to
> >use
> >inline dtors in this event! What about templates which are inline code,
> >doesn't
> >that seriously limit their usefulness/implementation possibilities?

> >Is the answer an allocator, overridding new delete, or what?

> The answer is to link the modules to the DLL form of the CRT, msvcrt.dll.
> That way, they all use the same heap, and one module can delete memory
> allocated by another.

> --
> Doug Harrison




Sat, 28 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Dll vs EXE packaging while component designing

2. atl dll vs exe lnk2001 error

3. EXE Vs DLL

4. EXE vs DLL

5. Thread/Process/Global vs. Dll/Exe

6. unhandled exception in someprog.exe (NTDLL.DLL): 0xC0000005: Access Violation

7. unhandled exception in someprog.exe (NTDLL.DLL): 0xC0000005: Access Violation

8. First-chance exception in MSDEV.EXE (MFC42D.DLL): 0xC0000005: Access Violation

9. Use of STL-containers in DLLs and EXE, access violation

10. Use of STL-containers in DLLs and EXE, access Violation

11. Use of STL-containers in DLLs and EXE, access violation

12. Accessing / caching exe, dll, sys files - Kernel - XP

 

 
Powered by phpBB® Forum Software