Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > DLL Hell(p)

Reply
Thread Tools

DLL Hell(p)

 
 
Al A. Palooza
Guest
Posts: n/a
 
      01-15-2005
Hi, I'm having some problems with DLLs (using C++, so it's on topic). Can
someone help me?

The problem is this: I have a common-functionality DLL, and an EXE. The EXE
uses the DLL. But both the DLL and the EXE use a basic static library which
implements a memory manager.

The memory manager class has a singleton instance, s_pInstance. This is a
static member of the memory manager class. To access the memory manager the
user calls MemMgr::Get (a static function).

Seems pretty straightforward. But because both the DLL and the EXE use the
LIB, both need to have copies linked to them at build time. This results in
two copies of the same library in memory. So when one calls MemMgr::Get it
gets a different pointer from the other, resulting in crashes (I only set
the pointer once).

Is there a way to work around this that doesn't completely suck? The only
way I can think of is to pass a common memory manager pointer from one of
the clients to the other, but this breaks the anonymity and extenstion I was
trying to achieve - plus just hides the fact that both are statically linked
to a library that I only need one instance of.

The other solution would be to make the static library a DLL but since it
doesn't _need_ to be dynamically loaded it seems kind of a waste.

Any ideas?


 
Reply With Quote
 
 
 
 
puzzlecracker
Guest
Posts: n/a
 
      01-15-2005
go to windows.programming group... we only deal with the standard.

 
Reply With Quote
 
 
 
 
Mike Wahler
Guest
Posts: n/a
 
      01-15-2005
"Al A. Palooza" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi, I'm having some problems with DLLs


DLL's are not part of C++, but a feature of the Microsoft
Windows operating system, and can be written in virtually
any language.

> (using C++, so it's on topic).


No it's not. Please see:
http://www.slack.net/~shiva/welcome.txt

> Can
> someone help me?


Not here.

Try comp.os.ms-windows.programmer.win32

-Mike


 
Reply With Quote
 
Jack Klein
Guest
Posts: n/a
 
      01-15-2005
On Fri, 14 Jan 2005 23:16:53 -0500, "Al A. Palooza" <(E-Mail Removed)>
wrote in comp.lang.c++:

> Hi, I'm having some problems with DLLs (using C++, so it's on topic). Can

^^^^^^^^^^^^^^^^^^^^^^^^^^^
No, it's not. The language does not define DLLs, static or dynamic
libraries, or interactions that arise out of that choice.

> someone help me?


Yes, people in a group that supports your particular compiler/os
combination, or a Windows programming group like
news:comp.os.ms-windows.programmer.win32.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
 
Reply With Quote
 
GTO
Guest
Posts: n/a
 
      01-16-2005
> Is there a way to work around this that doesn't completely suck?

Yes. Switch to Linux!


 
Reply With Quote
 
Al A. Palooza
Guest
Posts: n/a
 
      01-16-2005
Facetious, but possibly more helpful than the other responses.

Brings up a question: using unix dynamic libraries the same problem would
arise, so how would you recommend working around it?

"GTO" <(E-Mail Removed)> wrote in message
news:7aiGd.11746$(E-Mail Removed) m...
>> Is there a way to work around this that doesn't completely suck?

>
> Yes. Switch to Linux!
>



 
Reply With Quote
 
Rolf Magnus
Guest
Posts: n/a
 
      01-16-2005
Al A. Palooza wrote:

> Facetious, but possibly more helpful than the other responses.


No. The other responses told you where to ask your question.

> Brings up a question: using unix dynamic libraries the same problem would
> arise, so how would you recommend working around it?


That should be asked in comp.unix.programmer.

 
Reply With Quote
 
Al A. Palooza
Guest
Posts: n/a
 
      01-16-2005
God help me, is there a comp.os.pedantic?

That's four - count 'em, four! - responses, from people who could probably
offer some valuable advice, but instead just say "take the question
elsewhere".

I took the question elsewhere, to three different newsgroups. Not a single
response there. Guess the only reason people reply is to tell you you're
off-topic. (Or to make jokes, then tell you responses to the jokes are
off-topic).

Usenet is hilarious.

"Rolf Magnus" <(E-Mail Removed)> wrote in message
news:cscg8l$mpa$01$(E-Mail Removed)-online.com...
> Al A. Palooza wrote:
>
>> Facetious, but possibly more helpful than the other responses.

>
> No. The other responses told you where to ask your question.
>
>> Brings up a question: using unix dynamic libraries the same problem would
>> arise, so how would you recommend working around it?

>
> That should be asked in comp.unix.programmer.
>



 
Reply With Quote
 
Raymond Martineau
Guest
Posts: n/a
 
      01-16-2005
On Sun, 16 Jan 2005 03:10:45 -0500, "Al A. Palooza" <(E-Mail Removed)> wrote:

>That's four - count 'em, four! - responses, from people who could probably
>offer some valuable advice,


No. A large number of people on this newsgroup do not program on Microsoft
Windows, let alone have the VC++ compiler. Even if they did know how to
program with that operating system, they would not have enough information
to figure out why the singleton class was crashing. (i.e. they don't know
which memory manager you were using.)


 
Reply With Quote
 
Owen Jacobson
Guest
Posts: n/a
 
      01-16-2005
On Sat, 15 Jan 2005 19:43:50 -0500, Al A. Palooza wrote:

> Facetious, but possibly more helpful than the other responses.
>
> Brings up a question: using unix dynamic libraries the same problem would
> arise, so how would you recommend working around it?


Possibly not. As I understand it, under most unices shared objects
(dynamic libraries) are placed in the loading process's address space,
rather than having their own address space, which is the source of the
problem you're having. BICBW.

F'ups set.

Owen

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory Allication (Managed VC++ DLL to Unmanaged DLL) [Second Try] Weston Fryatt ASP .Net 2 01-01-2005 11:31 AM
How to determine if a DLL is a COM DLL or .NET DLL Anushi ASP .Net 5 10-28-2004 01:59 PM
Why does Ruby use both tcl83.dll and tk83.dll (instead of just tk83.dll)? H. Simpson Ruby 4 08-03-2004 04:45 PM
mprapi.dll --> samlib.dll --> ntdll.dll issue. Some1 Computer Support 4 04-05-2004 02:02 AM
msvcrt.dll, msvcirt.dll, msvcrt20.dll and msvcrt40.dll, explanation please! Snoopy NZ Computing 16 08-25-2003 12:34 PM



Advertisments