|
Yuo need to get a clue, see here[^].
How, and BTW read the posting guidelines ("How to ask a question") at the top of this message board. What you are asking is similar as if I asked you to come clean my house, free of charge of course. I think you need to come back on earth, nobody's gonna write a full program for you free of charge.
|
|
|
|
|
This is my first thread! The thread is initialized during WM_CREATE.
However their are no errors during compilation, but when I run it the program breaks.
void Windows7ProgressThread(void *)
{
if (TotalBytesToDownload)
{
if (List.AnyFailed())
{
TaskbarProgress->SetProgressState(g_hWindow, TBPF_ERROR);
}
else
{
TaskbarProgress->SetProgressState(g_hWindow, TBPF_NORMAL);
}
TaskbarProgress->SetProgressValue(g_hWindow,50,100);
}
else
{
TaskbarProgress->SetProgressState(g_hWindow, TBPF_NOPROGRESS);
}
}
|
|
|
|
|
Fareed Rizkalla wrote: ...but when I run it the program breaks.
Really? Are we supposed to guess how?
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
The problem their are no errors, it breaks with error Access violation. :S
|
|
|
|
|
Even after I commented out what threading code I had written and the process.h header.
I run it and the same error is occurring over and over.
|
|
|
|
|
Fareed Rizkalla wrote: The problem their are no errors, it breaks with error ...
Really?
Fareed Rizkalla wrote: ...it breaks with error Access violation.
So single-step through the code until you find the offending line. If you think there are too many lines to wade through, read this thread on how to quickly narrow down a problem by removing unnecessary code.
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
It was because I removed the SUCCEEDED micro, but I can't believe the errors it gave me.
Thread exceptions and Access Violations.
I thought something went wrong with the project settings, cause it mentioned Multi-Threading.
Got WinMerge and started going over each line and started thinking what should be undone.
|
|
|
|
|
Fareed Rizkalla wrote: It was because I removed the SUCCEEDED micro, but I can't believe the errors it gave me.
The SUCCEEDED macro did not cause errors to your code. How could it:
#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0)
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hello,
Can scanf be set to retain leading whitespaces in between words?
For example, if the string was " Hello everyone, how are you today? "
can scanf grab " Hello" " everyone," " how" " are" " you" " today?"
Thanks,
|
|
|
|
|
Only if you wrote your own parser. The other ideas that I mentioned to you would use the space as the delimiter.
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
You can do this to capture everything till the enter key is hit.
scanf("%[^\n]", sz);
|
|
|
|
|
|
Hi,
How can I advance the sscanf statement to read each word in the sentence? Right now my output is an endless loop of "This".
CString incoming_line="This is my example incoming line.";
CString string_out;
while (sscanf(incoming_line, "%s", string_out )==1)
{
cout<<string_out<<endl;
}
Thanks!
|
|
|
|
|
you could do something like this:
int offset = 0;
while (sscanf(incoming_line + offset, "%s", string_out )==1)
{
cout<<string_out<<endl;
offset += strlen(string_out);
}
|
|
|
|
|
Chris,
Thanks for your help.
I'm getting the following error when I use your suggestion.
Error 2 error C2666: 'ATL::CStringT<BaseType,StringTraits>::operator +' : 3 overloads have similar conversions
Any ideas?
Thanks,
|
|
|
|
|
oops. didn't see the CString there.
|
|
|
|
|
b-rad311 wrote: while (sscanf(incoming_line, "%s", string_out )==1)
You cannot use a CString object in this capacity.
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi David,
Should I use "const char*" instead?
|
|
|
|
|
If you did, then how would scanf() be able to change its contents?
Since you are using MFC, have a look at CStringT::Tokenize() or AfxExtractSubString() .
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi friend,
How to change static text color and backgroung color, please help me.
Thanks and Regards,
D.Manivelan
|
|
|
|
|
Member 4482742 wrote: How to change static text color and backgroung color...
Are you referring to WM_CTLCOLOR or one of its variants?
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I'am hooking the sendto function and i would like to log names of every DLL/prog which call it.
How can i retrieve the names of the DLLs which call to the sendto hooked function ?
|
|
|
|
|
You could insert GetModuleFileName(NULL, ..) into your hook function
virtual void BeHappy() = 0;
|
|
|
|
|
I already made a try with this method but it id not work.
The returned name's module is the one of the *.EXE which loaded the DLL, but not the DLL's name itlsef(DLL which makes calls).
|
|
|
|