Click here to Skip to main content
15,917,061 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMFC Calling .NET Pin
quesansii10-Jul-05 20:31
quesansii10-Jul-05 20:31 
GeneralMaking a dialog over everything - even games Pin
awah10-Jul-05 20:30
awah10-Jul-05 20:30 
GeneralRe: Making a dialog over everything - even games Pin
David Crow11-Jul-05 3:11
David Crow11-Jul-05 3:11 
GeneralRe: Making a dialog over everything - even games Pin
awah12-Jul-05 17:20
awah12-Jul-05 17:20 
Questiona paradox in mfc head file? Pin
wrb30210-Jul-05 20:29
wrb30210-Jul-05 20:29 
AnswerRe: a paradox in mfc head file? Pin
David Crow11-Jul-05 3:44
David Crow11-Jul-05 3:44 
GeneralQuestion about displaying a property page Pin
PrashantJ10-Jul-05 20:14
PrashantJ10-Jul-05 20:14 
GeneralAbout building a Windows service Pin
zhaopi10-Jul-05 20:04
zhaopi10-Jul-05 20:04 
I am about to implement a windows background service.
I have succeeded to build the basic functions such as creating, stopping and deleting the service.

The service is actually built basing on an infinite while loop (while(1)),
if i put some simply operation like file processing in the while loop, it works fine~
when i put this line "doc. getdocumentlist(doclist, 9);" in, the program just stops there and cannot proceed to the codes below( this can be seen from the log file content).

Can anybody explain this to me...


void cService::EndlessLoop()<br />
{<br />
Output("EndlessLoop Start\n");<br />
SYSTEMTIME Clock;<br />
CString Out;<br />
Cdocumentdb doc;<br />
// This endlessloop is killed by Windows when the service is stopped or shutdown<br />
while (1)<br />
{<br />
if (hTimer != 0)<br />
{<br />
LARGE_INTEGER Elapse;<br />
Elapse.QuadPart = -10000000; // 5 Seconds in 100 Nanoseconds resolution (negative=relative)<br />
BOOL Res = ::SetWaitableTimer(hTimer, &Elapse, 0, 0, 0, TRUE);<br />
<br />
if (Res)<br />
{<br />
DWORD Event = WaitForSingleObject(hTimer, 30000); // 30 seconds timeout<br />
// Event = (258=WAIT_TIMEOUT) (128=WAIT_ABANDONED) (0=WAIT_OBJECT_0) (0xFFFFFFFF=WAIT_FAILED)<br />
}<br />
}<br />
CArray<CString, CString>  doclist;<br />
		<br />
doc. getdocumentlist(doclist, 9);<br />
<br />
::GetLocalTime(&Clock);<br />
Out.Format("Timer %02d:%02d:%02d:%03d", Clock.wHour, Clock.wMinute, Clock.wSecond, Clock.wMilliseconds);<br />
Output(Out);<br />
};<br />
}  

GeneralRe: About building a Windows service Pin
zhaopi10-Jul-05 20:07
zhaopi10-Jul-05 20:07 
GeneralRe: About building a Windows service Pin
Blake Miller11-Jul-05 5:02
Blake Miller11-Jul-05 5:02 
General16bit &amp; 32bit Portability issues Pin
Anonymous10-Jul-05 19:25
Anonymous10-Jul-05 19:25 
GeneralRe: 16bit &amp; 32bit Portability issues Pin
David Crow11-Jul-05 3:51
David Crow11-Jul-05 3:51 
GeneralNotification on CPU frequency change in SpeedStep Pin
Vitaly Kashkarov10-Jul-05 19:09
Vitaly Kashkarov10-Jul-05 19:09 
GeneralDirectSound Question Pin
Mark Keeling10-Jul-05 17:58
Mark Keeling10-Jul-05 17:58 
GeneralRe: DirectSound Question Pin
Trollslayer10-Jul-05 22:15
mentorTrollslayer10-Jul-05 22:15 
GeneralRe: DirectSound Question Pin
Mark Keeling12-Jul-05 13:56
Mark Keeling12-Jul-05 13:56 
GeneralRe: How to insert a record into table in the oracle Pin
Christian Graus10-Jul-05 17:35
protectorChristian Graus10-Jul-05 17:35 
QuestionHow to put a button on the main window Pin
shfinfrock10-Jul-05 15:14
shfinfrock10-Jul-05 15:14 
AnswerRe: How to put a button on the main window Pin
Jose Lamas Rios10-Jul-05 16:26
Jose Lamas Rios10-Jul-05 16:26 
Generalsend a GET, POST request to a HTTPS server Pin
surfman1910-Jul-05 10:22
surfman1910-Jul-05 10:22 
GeneralRe: send a GET, POST request to a HTTPS server Pin
Andrew Kirillov10-Jul-05 20:25
Andrew Kirillov10-Jul-05 20:25 
GeneralRe: send a GET, POST request to a HTTPS server Pin
surfman1917-Jul-05 4:55
surfman1917-Jul-05 4:55 
Generalerror code Pin
locoone10-Jul-05 3:07
locoone10-Jul-05 3:07 
GeneralRe: error code Pin
Gary R. Wheeler10-Jul-05 3:17
Gary R. Wheeler10-Jul-05 3:17 
GeneralRe: error code Pin
Alexander M.,10-Jul-05 3:21
Alexander M.,10-Jul-05 3:21 

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.