Click here to Skip to main content
15,921,959 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: fopen, fwrite access problem Pin
AAKAra11-May-07 10:13
AAKAra11-May-07 10:13 
GeneralRe: fopen, fwrite access problem Pin
David Crow13-May-07 16:43
David Crow13-May-07 16:43 
AnswerRe: fopen, fwrite access problem Pin
AAKAra15-May-07 7:44
AAKAra15-May-07 7:44 
QuestionHelp!!! how to avoid GetOpenFileName() dialog show right key menu Pin
zhongwenjia11-May-07 4:54
zhongwenjia11-May-07 4:54 
AnswerRe: Help!!! how to avoid GetOpenFileName() dialog show right key menu Pin
Mark Salsbery11-May-07 5:08
Mark Salsbery11-May-07 5:08 
AnswerRe: Help!!! how to avoid GetOpenFileName() dialog show right key menu Pin
David Crow11-May-07 5:18
David Crow11-May-07 5:18 
GeneralRe: Help!!! how to avoid GetOpenFileName() dialog show right key menu Pin
Mark Salsbery11-May-07 6:31
Mark Salsbery11-May-07 6:31 
GeneralRe: Help!!! how to avoid GetOpenFileName() dialog show right key menu Pin
David Crow11-May-07 6:42
David Crow11-May-07 6:42 
QuestionHow can I use MFC DLL in an WIN 32 Application? Pin
VCSharp00711-May-07 4:32
VCSharp00711-May-07 4:32 
AnswerRe: How can I use MFC DLL in an WIN 32 Application? Pin
Mark Salsbery11-May-07 5:02
Mark Salsbery11-May-07 5:02 
Questionconst and volatile Pin
Kiran Pinjala11-May-07 4:27
Kiran Pinjala11-May-07 4:27 
AnswerRe: const and volatile Pin
Nemanja Trifunovic11-May-07 4:30
Nemanja Trifunovic11-May-07 4:30 
AnswerRe: const and volatile Pin
CPallini11-May-07 4:34
mveCPallini11-May-07 4:34 
AnswerRe: const and volatile Pin
Roger Stoltz11-May-07 4:39
Roger Stoltz11-May-07 4:39 
AnswerRe: const and volatile Pin
Nelek13-May-07 20:21
protectorNelek13-May-07 20:21 
Questionhow to show select file and directory dialog in c&api program Pin
zhongwenjia11-May-07 3:54
zhongwenjia11-May-07 3:54 
QuestionRe: how to show select file and directory dialog in c&api program Pin
David Crow11-May-07 4:01
David Crow11-May-07 4:01 
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?


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.