Click here to Skip to main content
16,006,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem about CPU resouce Pin
kcynic21-Jul-07 16:26
kcynic21-Jul-07 16:26 
GeneralRe: Problem about CPU resouce Pin
Mark Salsbery21-Jul-07 19:21
Mark Salsbery21-Jul-07 19:21 
GeneralRe: Problem about CPU resouce Pin
kcynic21-Jul-07 21:20
kcynic21-Jul-07 21:20 
GeneralRe: Problem about CPU resouce Pin
Mark Salsbery22-Jul-07 7:44
Mark Salsbery22-Jul-07 7:44 
Question860430 - overrided operator delete is not called Pin
ilostmyid221-Jul-07 0:00
professionalilostmyid221-Jul-07 0:00 
Questionhow to build a cylinder ? Pin
gentleguy20-Jul-07 23:41
gentleguy20-Jul-07 23:41 
QuestionC runtime library Pin
vipin_nvk20-Jul-07 23:34
vipin_nvk20-Jul-07 23:34 
AnswerRe: C runtime library Pin
Matthew Faithfull21-Jul-07 4:46
Matthew Faithfull21-Jul-07 4:46 
That's a biggy. The C runtime library is a bunch of code that extends C++ to allow you do do useful basic things like write to the console, allocate memory, format strings, get locale information, declare thread local variables, use excecptions, spawn other proceses, initialize static variables, access the command line passed to your program etc etc.
You either use it by linking dynamically to MSVCRT.dll in one of its incarnations or link in the code directly by linking to LIBC.lib or one of its variants. The reason for the various versions is different ones for Debug and Release and in the past different ones for single or multi threaded application.
Strictly speaking the C runtime is not involved in loading a windows exe but it does do a bunch of stuff, some mentioned above, in your exe before your code is actually called so it kind of looks like it's involved in loading. By the time your program hits WinMain or main it has probably run several hundred to several thousand lines of CRT code.
The thing that loads your exe is the PE (Portable Executable) Loader which lives somewhere in the Kernel (probably NTDll.dll these days). Once it has done its magic, setting up a process and related memory space for you and loading in your code it calls an entry point function which is a function with a well known siganture at a specific offset in the compiled code (The offset is stored in the PE header on the exe file ) If you use the CRT then that entry point will be something like mainCRTStartup depending in CONSOLE or GUI app type and UNICODE or ANSI build. The source of the CRT is on your system, if you chose to install it when you installed Visual Studio, and is worth a look. It's a big mess but a very educational big mess. Enjoy Smile | :)

Nothing is exactly what it seems but everything with seems can be unpicked.

QuestionList View Pin
nitin320-Jul-07 18:35
nitin320-Jul-07 18:35 
AnswerRe: List View Pin
Karismatic20-Jul-07 20:41
Karismatic20-Jul-07 20:41 
QuestionRe: List View [modified] Pin
nitin320-Jul-07 22:35
nitin320-Jul-07 22:35 
AnswerRe: List View Pin
Michael Dunn21-Jul-07 10:09
sitebuilderMichael Dunn21-Jul-07 10:09 
AnswerRe: List View Pin
Hamid_RT31-Jul-07 19:44
Hamid_RT31-Jul-07 19:44 
QuestionDummy Needs Help.... (Madden NFL 07 - PS2) Pin
NevadaBallin20-Jul-07 16:46
NevadaBallin20-Jul-07 16:46 
AnswerRe: Dummy Needs Help.... (Madden NFL 07 - PS2) Pin
Christian Graus20-Jul-07 17:42
protectorChristian Graus20-Jul-07 17:42 
AnswerRe: Dummy Needs Help.... (Madden NFL 07 - PS2) [modified] Pin
Force Code21-Jul-07 2:01
Force Code21-Jul-07 2:01 
GeneralRe: Dummy Needs Help.... (Madden NFL 07 - PS2) Pin
NevadaBallin21-Jul-07 7:01
NevadaBallin21-Jul-07 7:01 
QuestionLinking/Combining two projects(source codes) together in visual c++ Pin
jt900020-Jul-07 10:56
jt900020-Jul-07 10:56 
AnswerRe: Linking/Combining two projects(source codes) together in visual c++ Pin
Christian Graus20-Jul-07 17:43
protectorChristian Graus20-Jul-07 17:43 
AnswerRe: Linking/Combining two projects(source codes) together in visual c++ Pin
#realJSOP22-Jul-07 0:36
professional#realJSOP22-Jul-07 0:36 
QuestionRecreating views... Pin
Abhijeet Pathak20-Jul-07 5:41
Abhijeet Pathak20-Jul-07 5:41 
AnswerRe: Recreating views... Pin
led mike20-Jul-07 7:01
led mike20-Jul-07 7:01 
GeneralRe: Recreating views... Pin
mid=574120-Jul-07 8:17
mid=574120-Jul-07 8:17 
GeneralRe: Recreating views... Pin
led mike20-Jul-07 8:29
led mike20-Jul-07 8:29 
GeneralRe: Recreating views... Pin
mid=574120-Jul-07 8:34
mid=574120-Jul-07 8:34 

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.