I have the same question, what is meaning of the program is not working. Be crashing or something else.
Heng Xiangzhong
Posts
-
Problem in reading BMP Header -
How to write registry after log in windows with mfc?Sorry, I just agree with your opinions, so I can't help myself to reply you. :laugh:
-
How to write registry after log in windows with mfc?It is right, Firstly, you should use ::GetModuleFileName(NULL, ...) to get the path of your application image, and then, get what you want by this path. If you set the path as const value, it's not convenient!
-
use c++ to drive cmd window and get responsesTo be exact, DOS is a operation system, and command line in windows is just a application, we call it console. You can use GetStdHandle to get the standard output in a running GUI application, or use CreateProcess to spawn a process and redirect it's output to do the same thing.
-
Which among following statements c/c++ code is faster?I agree with you! In general, two cases are identical!
-
avoiding or skipping Divide by zero showing junk valuesPlease show your code. Everything is in the code !
-
avoiding or skipping Divide by zero showing junk valuesPlease show your code. Everything is the code !
-
How to use ReadFile API Read HID Device synchronousI can't understand your question well. Firstly, you read the file synchronous, so if no fails happens, it will be blocked here if no data income. I think so, happy to communicate with you !
-
C++ - code executed upon definite program terminationLet met think. If you don't think it is complex, hook is a good solution for this. You can hook the ExitProcess API in win32 by inline, IAT or something you can do. Because a process exits in windows through invoke the ExitProcess by itself, so after CRT lib destructs all the objects, it will invoke ExitProcess, at that time, the control flow will give you a chance to execute your code. If you don't know how to complete it, I can give a piece of code that i wrote before. Nice to make friends with you ! My email, Henzox.7@gmail.com
-
Are MFC Timer(s) bad for performance in large projects (Vc++)Yeah, I can't agree with you any more ! Sometimes, i should delay a short time precisely, I think free loop is useful. just like wait some uart data in real OS. May I get your email, i just want to contact with you frequently! :)
-
Are MFC Timer(s) bad for performance in large projects (Vc++)Sorry, maybe i misunderstood the OP's question. I understand the question as the OP want to delay executing. You are right, if he want to waiting, he should use Sleep. Through this, I think you are a good programmer who understand OS well, nice to meet you ! There is another question, sometimes you just want to delay executing, Sleep, Timers, or GetTickCount all is right. Sleep don't waste any CPU time. GetTickCount does it. But sometimes, free loop just like GetTickCount is a performance way to wait a predetermined a mount of time, like SpinLock. What do you think about it.
-
C++ - code executed upon definite program terminationYeah, you are right. It is all they can do. But it is too simple to complete the most situations. for example, i want execute a piece of code behind the all of objects' destruct function is invoked. if this, dll is a good way.
-
Are MFC Timer(s) bad for performance in large projects (Vc++)I am so sorry about you misunderstood my words, my English is very poor! :) I agree with you about timers don't waste CPU, because it provides a way that can be waited, when times out, the callback functions is invoked. About nanoseconds measure, clock() maybe right, but windows gives high-precision clock to us for API, it is QueryPerformanceFrequency(). But I think C3D1 just want to know which way is more performance in GetTickCount and Timer. I think you are a good guys, Can I make friends with you ? ;P
-
Are MFC Timer(s) bad for performance in large projects (Vc++)I'd like too. Using it correctly, the timer has a good performance. Sometimes, GetTickCount is a good solution, but it wastes too many cpu time to do this. On the other hand, Timer provide a good way to let you know when times out, and you can do anything in the period.
-
C++ - code executed upon definite program terminationPerfect ideas, using the order of constructor of a object. But the question is how can you control this object is destructed behind the any other one? Nice to chat with you !
-
C++ - code executed upon definite program terminationCPallian gave a good idea. Maybe you can do this in other way. You can complete a dll for this. when a dll is detached, the branch named "DLL_PROCESS_DETACH" of Dllmain. yeah, it's your wanted place. :laugh: Nice to make friends with you !
-
Good book about Windows programming wantedYes, many years ago, a book named "microsoft win32 manual" is published. It is a very useful book, lists all the windows api about win32. you can find it. nice to make friends with you !