Re: How to export a class that inherits from unmanaged exception class

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Bob Altman wrote:
Thanks. That raises a question I've long wondered about: What is the actual difference between the single-threaded, multi-threaded, and debug versions of the DLL?

Theoretically there can be 8 different versions of the standard library, as there are 3 completely independent parameters that you could adjust:

- Threading model. The single-threaded std library doesn't work with multi-threaded applications. As of VS 2005, there is no longer a single threaded standard library. Microsoft no longer wants to go through the trouble of maintaining 8 differnt versions of the C standard library. When most applications are multi-threaded, and the benefits of a single-threaded library are marginal.

- Dynamic or static linking. Dynamic linking means that the standard library is provided as DLLs. Static linking means your application is self standing and doesn't depend on any non-system DLL (your EXE is all you need to ship in that case). With .NET, static linking is ruled out.

- Debug or release version. In a VC++ project you can't successfully mix debug and release units -- you have to compile all your units with either debugging enabled or disabled uniformly. The standard library has to match your settings as well. So if you want to be able to debug your application, you have to link the debug version of the runtime library.

If you program in .NET, you don't have too many choices: Either use the debug or release build of the multi-threaded DLL version of the standard library. If you program native, and you really really want a self-standing executable with no dependencies, link either the debug or release build of the multi-threaded static version of the standard library.

Unless you really know what you're doing, you should compile every module of your project with the very same compiler and linker settings. There are special rules to follow when you intermix modules built with different settings (or even worse, different compilers).

Most importantly, if you want to write your own DLLs, and you choose to use the static version of the standard library, then the DLL will have a different memory manager than your EXE, which is very painful to handle (and it is not a trivial task to manage). By using the DLL version of the standard library, you can forget about most of the trouble, as long as everything is built with the same compiler using the same settings.

Tom
.



Relevant Pages

  • Understanding references...
    ... and two of those projects have a reference to a ... Whenever I compile to test, I "Build Solution", with Active Solution ... Configuration = Debug. ... Why is it looking for a a DLL in Release if everything I'm doing is in Debug ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to connect to children process
    ... Main problem is amount of manual operations required per debug cycle. ... connection to DLL with debugger takes sensible amount of time and manual ... Is the main problem that the debugger keeps symbols file loaded ... AFAIK that's how VS2003 debugger works, but WinDbg should usually ...
    (microsoft.public.vsnet.debugging)
  • Re: running a service/driver/application upon startup
    ... Would it be possible for you to drop a debug services.exe and debug nk.exe ... > I ran dumpbin/exports on the finger dll and saw the required function ... >> theories as to why it's not getting loaded but just doing 'services load ...
    (microsoft.public.windowsce.embedded)
  • Re: Access Violation using CCriticalSection in DLL
    ... I do not normally mix debug and release components, but I was trying to find ... the source of the problem by using a debugger on at least the DLL ... release compile work on Win XP. ... declared within the logger class. ...
    (microsoft.public.vc.mfc)
  • Re: technical/OS problem (windows xp?)
    ... Build a debug version of the ISAPI DLL. ... Create a virtual root with execute permissions in the IIS Management ... Add your ISAPI extension or filter DLL to the list. ...
    (alt.marketing.online.ebay)