If you can't write a function to search for a specific character in a text file, ('\n'), counting how many times you see that character, your code isn't worth hiding.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak
Have a look at [ShellExecute](https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea) or/and [ShellExecuteEx function (shellapi.h) - Win32 apps | Microsoft Docs](https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecuteexa)
It is a reasonable guess that pTemp->m_hWnd is not a valid Window handle. How that came about is impossible to guess. You need to use your debugger to gather more diagnostic information. Also there is some information at Debug Assertion in occcont.cpp Line: 926[^] which may help. But either way this looks to be a Microsoft problem, so you should report it (with full details) to them.
Given the OP's code, I was simply pointing out that if too few operations are done, some numbers won't reach 1. For example, 47 takes 103 operations in order to reach 1, and 231 and 235 both take 127 operations in order to reach 1.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
How about create your program to just do the file I/O, and then let windows handle the timer/scheduling part?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
Then don't return a value. Leave it as void and remove the cout call at the end of your main method. BTW in future please open a new question if you have a problem, rather than reopening a thread that is over two years old.
Don't know about your apps but for mine, I run Dependencies ( GitHub - lucasg/Dependencies: A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.[^], make a list of required DLLs. As I said, for the C++ runtime, I didn't have troubles recently. This was such a relief coming from the horrible days of VC2010 with those dreadful SxS assemblies.
Mircea
I catch what you are saying, it just seemed to me that for the context of the original question the discussion veered. No harm or foul.
Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Member 7989122 wrote:
I might give it a try (maybe 35+ years of coding experience will make it appear simpler), but I haven't got the time right now.
Same here, although coming up for 55 years. One day soon ... ;)
PrafullaVedante wrote:
considering the user will never keep itself block for 49 days ....
I have. Code starts and a section of it waits for a global shutdown object to be signaled. (That aside, I believe Raymond Chen has confirmed that INFINITE really is infinite.)
There are many good articles about drawing in mfc - which is really pretty much Win32. Rather than have that magical moment where you get it running and it flickers constantly, make sure to look into double buffering with a bitmap.
Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
b[j][i]=a[i][j];
printf("%d ",b[i][j]);
So you wanted to print the value of b[i][j] after you updated b[j][i]?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
You should read through every section of Organization of the C Language Reference | Microsoft Docs[^]. You will learn much faster than by posting questions here.