Click here to Skip to main content
15,895,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralAdding text display to dialog box Pin
Anonymous7-Jan-04 4:36
Anonymous7-Jan-04 4:36 
GeneralRe: Adding text display to dialog box Pin
valikac7-Jan-04 7:28
valikac7-Jan-04 7:28 
GeneralHelp with HANDLEs Pin
Mortis7-Jan-04 4:14
Mortis7-Jan-04 4:14 
GeneralRe: Help with HANDLEs Pin
Dominik Reichl7-Jan-04 4:33
Dominik Reichl7-Jan-04 4:33 
GeneralRe: Help with HANDLEs Pin
valikac7-Jan-04 7:29
valikac7-Jan-04 7:29 
GeneralFucntion execution time Pin
islheg7-Jan-04 3:49
islheg7-Jan-04 3:49 
GeneralRe: Fucntion execution time Pin
фил7-Jan-04 4:30
фил7-Jan-04 4:30 
GeneralRe: Fucntion execution time Pin
oren frenkel7-Jan-04 6:27
oren frenkel7-Jan-04 6:27 
Hi,
This is the way to do it through the Windows API function:

SYSTEMTIME sStart, sEnd;
float fEllapsedSec, ffEllapsedSecModulu;
long lEllapsedDays, lEllapsedHours, lEllapsedMin, lEllapsedSec, lEllapsedMilliSec;
CString strFuncTime;

::GetSystemTime(&sStart);

// call your function:

func();

::GetSystemTime(&_sEnd);

lEllapsedDays = sEnd.wDay - sStart.wDay;
lEllapsedHours = sEnd.wHour- sStart.wHour;
lEllapsedMin = sEnd.wMinute - sStart.wMinute;
lEllapsedSec = sEnd.wSecond - sStart.wSecond;
lEllapsedMilliSec = sEnd.wMilliseconds - sStart.wMilliseconds;
lEllapsedHours += lEllapsedDays*24;
lEllapsedMin += lEllapsedHours*60;
lEllapsedSec += lEllapsedMin*60 ;

// the total number of seconds:
fEllapsedSec = (float)lEllapsedSec + (float)lEllapsedMilliSec / 1000;

// for gui presentation:
lEllapsedHours = ((long)(fEllapsedSec / 3600));
lEllapsedMin = ((long)(fEllapsedSec / 60)) % 60;
ffEllapsedSecModulu = fEllapsedSec - ((int)(fEllapsedSec / 60) * 60); // cant use modulu on float

strFuncTime.Format("%d:%d:%.3f",lEllapsedHours,(lEllapsedMin % 60),ffEllapsedSecModulu);

GeneralRe: Fucntion execution time Pin
Alexander M.,7-Jan-04 10:55
Alexander M.,7-Jan-04 10:55 
GeneralRe: Fucntion execution time Pin
pankajdaga8-Jan-04 3:57
pankajdaga8-Jan-04 3:57 
GeneralRe: Fucntion execution time Pin
islheg10-Jan-04 12:10
islheg10-Jan-04 12:10 
GeneralREMOVE AN ICON Pin
davrodriguez7-Jan-04 3:36
davrodriguez7-Jan-04 3:36 
GeneralRe: REMOVE AN ICON Pin
фил7-Jan-04 3:42
фил7-Jan-04 3:42 
GeneralRe: REMOVE AN ICON Pin
Dominik Reichl7-Jan-04 4:22
Dominik Reichl7-Jan-04 4:22 
GeneralJoystick/Gamepad input when window isn't active Pin
zhen857-Jan-04 3:26
zhen857-Jan-04 3:26 
GeneralRe: Joystick/Gamepad input when window isn't active Pin
zhen857-Jan-04 3:52
zhen857-Jan-04 3:52 
GeneralRe: Joystick/Gamepad input when window isn't active Pin
фил7-Jan-04 4:22
фил7-Jan-04 4:22 
GeneralRe: Joystick/Gamepad input when window isn't active Pin
zhen857-Jan-04 6:17
zhen857-Jan-04 6:17 
GeneralGflag.exe - Help me !!!!! Pin
Anonymous7-Jan-04 2:59
Anonymous7-Jan-04 2:59 
GeneralMPEG encoder Pin
mansour_ahmadian7-Jan-04 2:28
mansour_ahmadian7-Jan-04 2:28 
QuestionHow to display a dialog via a Console App ?? Pin
krbprogrammer7-Jan-04 1:23
krbprogrammer7-Jan-04 1:23 
AnswerRe: How to display a dialog via a Console App ?? Pin
Antti Keskinen7-Jan-04 1:52
Antti Keskinen7-Jan-04 1:52 
GeneralRe: How to display a dialog via a Console App ?? Pin
krbprogrammer7-Jan-04 7:38
krbprogrammer7-Jan-04 7:38 
AnswerRe: How to display a dialog via a Console App ?? Pin
shultas7-Jan-04 2:40
shultas7-Jan-04 2:40 
GeneralRe: How to display a dialog via a Console App ?? Pin
shultas7-Jan-04 2:43
shultas7-Jan-04 2:43 

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.