Hi, everyone.

I have worked in IT field for about 1 year, before that my major

was physics. So I feel I'm just a new guy in this field, and I hope you

could help me:)


Now, I work in a embedded C++ project on WINCE platform. I'm

not very clear about operating system. Sometimes I'm confused with

threads and processes. Especially when i encounter with multithreads

or multiprocesses, where are my objects located, are they thread/or

process safe, etc.

Now, I'm trying to learn the architecture of this project, of course,

i can't see the codes of WINCE. What i can see are the codes of the

application on WINCE, and maybe the codes are abridged.

I have little experience about software engineering. So even if

I haved read all the codes and mostly understand each section, I

find it's not east for me to find a through line of this project. I mean

where the compilier starts to compile the project and how it goes

through the whole project and turn it to assembly codes. And I want

to know the detail process after winmain is called.

:) Maybe my question is very abstract, maybe I could copy some

codes here, but the project is large, where do i start? :)

Thank you for any answer.

Attempting to debug a WinCE program is really a huge bummer! What compiler are you using? Microsoft has made it a lot easier with VC++ 2005 Pro compier. The only way to do it with previous versions is put message boxes all over the place to display values of variables etc.

If your application uses MFC (Microsoft Foundation Class) then it becomes even more complicated. Don't get me wrong -- I love MFC and have been programming with it for several years, but it is very complex and takes about 6 months or so learning curve to learn it well.

If your program is pure win32 api functions then you should probably read the short tutorial here in order to understand how things work.

Thank you for your answer and your tutorial:)

For some reasons, we still use VC6 sp6 to compile codes and we

don't use MFC, fortunately.

Ok, I will read the tutorial first before any questions more:)

I mean where the compilier starts to compile the project and how it goes through the whole project and turn it to assembly codes.

Here is an excerpt from one of the old presentations I gave, may that should answer this question:
--------------------------------------
The life cycle of a C++ program

  • Pre-processor preprocesses the source file (*.cxx/cpp/c/C) Everything starting with a "#" is pp directive.
  • Compiler (CC) compiles the preprocessed code and creates object files (*.o).
  • Compiler does not resolve the "names" which programmer has promised to be resolvable only at link time.
  • Compiler generates one object file for each source file.
  • Linker/Link-editor (ld) links the compiled/relocatable objects (contained in object files) and creates the machine specific, possibly optimized, assembly code that is either
    • An executable (statically (-dn) or dynamically (-dy) linked) or
    • A shared object -G (*.so known as dynamic library) or
    • An object archive -ar (*.a known as static library)
  • Runtime linker (ld.so.1) creates a "runnable" object after resolving all the dynamically linked "names".
  • Run Run Run !

--------------------------------------
PS: This was for Unix, let me know if you donno the equivalents in Windows. Basics/flow remains the same.

And I want to know the detail process after winmain is called.

Simplest way would be to run the program in debug mode with a break point somewhere deep inside the code and see the call stack when execution stops at that break point. (possible in VS)

but the project is large, where do i start? :)

I'm a bit confused that no one has explained the documentation of your project to you. Being optimistic I would suggest you search for the architecture specification and after finishing that move on to design specification of the module you're interested in. :).

Here is an excerpt from one of the old presentations I gave, may that should answer this question:
--------------------------------------
The life cycle of a C++ program

  • Pre-processor preprocesses the source file (*.cxx/cpp/c/C) Everything starting with a "#" is pp directive.
  • Compiler (CC) compiles the preprocessed code and creates object files (*.o).
  • Compiler does not resolve the "names" which programmer has promised to be resolvable only at link time.
  • Compiler generates one object file for each source file.
  • Linker/Link-editor (ld) links the compiled/relocatable objects (contained in object files) and creates the machine specific, possibly optimized, assembly code that is either
    • An executable (statically (-dn) or dynamically (-dy) linked) or
    • A shared object -G (*.so known as dynamic library) or
    • An object archive -ar (*.a known as static library)
  • Runtime linker (ld.so.1) creates a "runnable" object after resolving all the dynamically linked "names".
  • Run Run Run !

--------------------------------------
PS: This was for Unix, let me know if you donno the equivalents in Windows. Basics/flow remains the same.

Simplest way would be to run the program in debug mode with a break point somewhere deep inside the code and see the call stack when execution stops at that break point. (possible in VS)


I'm a bit confused that no one has explained the documentation of your project to you. Being optimistic I would suggest you search for the architecture specification and after finishing that move on to design specification of the module you're interested in. :).

You are right. In this company, my job is to accompilish the duty,

they don't need me to know the what happend in the background,

just write some codes to implement some easy and repeated

functionalities. :(

But you know, I don't mean it's the fault of the company, it's just

a job.

However, I just want to know what happend, otherwise I would

always feel confused.

Thank u for your help:) If u could share some knowledge in learning

computer science, it will be very cool!

This article has been dead for over six months. Start a new discussion instead.