Click here to Skip to main content
15,896,207 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to show select file and directory dialog in c&api program Pin
zhongwenjia11-May-07 4:34
zhongwenjia11-May-07 4:34 
GeneralRe: how to show select file and directory dialog in c&api program Pin
David Crow11-May-07 5:15
David Crow11-May-07 5:15 
QuestionDesktop question [modified] Pin
ZaebanB11-May-07 3:48
ZaebanB11-May-07 3:48 
AnswerRe: Desktop question Pin
Hans Dietrich11-May-07 4:29
mentorHans Dietrich11-May-07 4:29 
QuestionCalculation of size of function Pin
SanjaySMK11-May-07 3:39
SanjaySMK11-May-07 3:39 
AnswerRe: Calculation of size of function Pin
Maximilien11-May-07 3:52
Maximilien11-May-07 3:52 
GeneralRe: Calculation of size of function Pin
Russell'11-May-07 23:34
Russell'11-May-07 23:34 
AnswerRe: Calculation of size of function Pin
Hans Dietrich11-May-07 4:21
mentorHans Dietrich11-May-07 4:21 
At run time it is difficult to do, unless you have access to the .obj file. If you do, you can parse the file (see Microsoft Portable Executable and Common Object File Format Specification) and look for the size record for the function you are interested in.

To experiment with this, take a .obj file that contains a single function, and run this from the command line:
dumpdin /all myobj.obj > foo.txt
The file foo.txt will contain a complete dump of the file, and you should see a record that looks like
0F2 00000000 SECT27 notype ()    External     | ?GetFontProperties@@YAHPBDPAU_tagFONT_PROPERTIES@@@Z (int __cdecl GetFontProperties(char const *,struct _tagFONT_PROPERTIES *))
    tag index 00000106 size 00000C7D lines 0000856D next function 00000111
In this example, I used the XFont.obj from my XFont article. You can see that the size of GetFontProperties() is given as hex 00000C7D.

Note that these sizes are not exact - if you read the PE Format spec, you will find more info.

Just out of curiosity, why do you want to do this?


Questionsave xml in vc++2005 Pin
lavy288311-May-07 3:21
lavy288311-May-07 3:21 
AnswerRe: save xml in vc++2005 Pin
Hans Dietrich11-May-07 3:37
mentorHans Dietrich11-May-07 3:37 
QuestionSaving DC Bitmap Pin
masnu11-May-07 2:55
masnu11-May-07 2:55 
AnswerRe: Saving DC Bitmap Pin
Hans Dietrich11-May-07 3:32
mentorHans Dietrich11-May-07 3:32 
Questionsimple error with printing Pin
ldsdbomber11-May-07 2:47
ldsdbomber11-May-07 2:47 
AnswerRe: simple error with printing Pin
David Crow11-May-07 2:57
David Crow11-May-07 2:57 
GeneralRe: simple error with printing Pin
ldsdbomber11-May-07 3:11
ldsdbomber11-May-07 3:11 
GeneralRe: simple error with printing Pin
Hans Dietrich11-May-07 3:19
mentorHans Dietrich11-May-07 3:19 
GeneralRe: simple error with printing Pin
ldsdbomber11-May-07 3:24
ldsdbomber11-May-07 3:24 
GeneralRe: simple error with printing Pin
Hans Dietrich11-May-07 3:28
mentorHans Dietrich11-May-07 3:28 
GeneralRe: simple error with printing Pin
David Crow11-May-07 3:40
David Crow11-May-07 3:40 
QuestionHow can I stop the program that run by DLL. Pin
Max++11-May-07 2:31
Max++11-May-07 2:31 
AnswerRe: How can I stop the program that run by DLL. Pin
Christian Graus11-May-07 2:45
protectorChristian Graus11-May-07 2:45 
GeneralRe: How can I stop the program that run by DLL. Pin
Max++11-May-07 3:16
Max++11-May-07 3:16 
GeneralRe: How can I stop the program that run by DLL. Pin
prasad_som11-May-07 4:02
prasad_som11-May-07 4:02 
QuestionException handling in Constructor Pin
ragavan11-May-07 1:55
ragavan11-May-07 1:55 
AnswerRe: Exception handling in Constructor Pin
CPallini11-May-07 2:02
mveCPallini11-May-07 2:02 

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.