Click here to Skip to main content
15,917,174 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalsqltype binding Pin
TehMedic15-Aug-04 2:33
TehMedic15-Aug-04 2:33 
GeneralRe: sqltype binding Pin
palbano15-Aug-04 20:08
palbano15-Aug-04 20:08 
GeneralRe: sqltype binding Pin
TehMedic15-Aug-04 20:24
TehMedic15-Aug-04 20:24 
GeneralProperty Page problems Pin
giziks14-Aug-04 22:37
giziks14-Aug-04 22:37 
QuestionWhat's the difference between Multi-threaded and Multi-threaded DLL? Pin
Link260014-Aug-04 20:01
Link260014-Aug-04 20:01 
AnswerRe: What's the difference between Multi-threaded and Multi-threaded DLL? Pin
cmk15-Aug-04 0:51
cmk15-Aug-04 0:51 
GeneralRe: What's the difference between Multi-threaded and Multi-threaded DLL? Pin
Link260015-Aug-04 10:18
Link260015-Aug-04 10:18 
GeneralRe: What's the difference between Multi-threaded and Multi-threaded DLL? Pin
cmk15-Aug-04 12:41
cmk15-Aug-04 12:41 
For your situation you will likely want to use the multi-threaded dll for each of your 5 projects. If you use a non-dll option then each module (exe and each dll) will have been statically linked to the CRT library.

Each module is unaware of the others and therefore initializes its own CRT state. For example, each will initialize a heap to be used by alloc/free. So, if a.dll alloc()'s some memory that memory will come from a.dll's CRT heap. If you then call free() on the memory in project.exe you will get an error as project.exe is trying to free in its CRT heap. This is also true for one module using fopen() and another trying to use the handle - boom.

If you specified that you want all modules to link to the CRT dll then the dll is only initialized once and all your modules will use the same heap. Memory allocated by one can be freed by another.

Unless i have a specific reason to do otherwise i generally link to the CRT multi-threaded dll.


Alex Ngai wrote:
In a project like I mentioned above, should I set all four DLL files
to multi-threaded DLL?


And project.exe as well. ALL have to link to the CRT dll. Having just one that is statically linked will create another CRT state, with the aformentioned problems.


Alex Ngai wrote:
... there was no STL, exceptions or template. Could you tell me,
were they parts of C++ specification back then? Or just no
compilers supported yet?


I don't remember there being STL at all. Exceptions and templates had prelim spec's (if i remember right) but i don't remember any compilers supporting them (Borland, Watcom, Zortec).

... did a quick check (http://computing.unn.ac.uk/staff/cgar1/cpptext/node4.html)

- AT&T C++ translator 1.0 released to the public in late 1985.
- Commercial compilers began to appear in 1988, Zortec and GNU
- C++ moved into the mainstream of programming languages with Release 2.0 in June 1989
Major manufactures provide C++ products for their platforms. Borland release a Turbo C++ Compiler.
- ANSI C++ Committee formed in late 1989.
They approved templates and exception handling.
- In late 1991 template implementations were provided by Borland and by AT&T/USL Cfront Release 3.0. Others soon followed.
- At the moment (1993) no implementations supporting exception handling are available.

So, i was more or less right. It also explains why i sometimes use templates, but never exceptions - template support was added early enough that i hadn't become too set in my ways. Smile | :)


...cmk

Save the whales - collect the whole set
GeneralRe: What's the difference between Multi-threaded and Multi-threaded DLL? Pin
Link260015-Aug-04 14:12
Link260015-Aug-04 14:12 
GeneralRe: What's the difference between Multi-threaded and Multi-threaded DLL? Pin
cmk15-Aug-04 15:11
cmk15-Aug-04 15:11 
GeneralRe: What's the difference between Multi-threaded and Multi-threaded DLL? Pin
Link260015-Aug-04 15:37
Link260015-Aug-04 15:37 
GeneralRe: What's the difference between Multi-threaded and Multi-threaded DLL? Pin
cmk15-Aug-04 17:09
cmk15-Aug-04 17:09 
GeneralRe: What's the difference between Multi-threaded and Multi-threaded DLL? Pin
Link260015-Aug-04 17:20
Link260015-Aug-04 17:20 
GeneralRe: What's the difference between Multi-threaded and Multi-threaded DLL? Pin
cmk15-Aug-04 21:43
cmk15-Aug-04 21:43 
AnswerRe: What's the difference between Multi-threaded and Multi-threaded DLL? Pin
peterchen15-Aug-04 0:54
peterchen15-Aug-04 0:54 
GeneralRe: What's the difference between Multi-threaded and Multi-threaded DLL? Pin
Link260015-Aug-04 14:21
Link260015-Aug-04 14:21 
GeneralRe: What's the difference between Multi-threaded and Multi-threaded DLL? Pin
peterchen15-Aug-04 14:34
peterchen15-Aug-04 14:34 
GeneralLink Problems Pin
Jnewg514-Aug-04 17:11
Jnewg514-Aug-04 17:11 
GeneralRe: Link Problems Pin
Ryan Binns15-Aug-04 18:33
Ryan Binns15-Aug-04 18:33 
GeneralRegistry change event Pin
RoyceF14-Aug-04 16:35
RoyceF14-Aug-04 16:35 
GeneralRe: Registry change event Pin
Scozturk14-Aug-04 22:54
professionalScozturk14-Aug-04 22:54 
GeneralRe: Registry change event Pin
RoyceF15-Aug-04 9:43
RoyceF15-Aug-04 9:43 
GeneralRe: Registry change event Pin
Scozturk16-Aug-04 2:30
professionalScozturk16-Aug-04 2:30 
QuestionWIN 32 programming questions. what do these libraries do? Pin
Link260014-Aug-04 15:00
Link260014-Aug-04 15:00 
AnswerRe: WIN 32 programming questions. what do these libraries do? Pin
Ravi Bhavnani14-Aug-04 15:12
professionalRavi Bhavnani14-Aug-04 15:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.