|
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).
|
|
|
|
|
Call GetModuleFileName() with the HINSTANCE that was passed to your DllMain() function. That said, I do not believe GetModuleFileName() is what you are after.
"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
Question : Differentiate static and extern ? If the data is static, how can you access that data in another file ?
My answer is :
The static keyword allows a variable to maintain its value among different function calls. Extern says the variable, or function, is defined outside this source file.
main.h
--------
#include <>
static int x;
main.c
--------
#include "main.h"
int main(void) {
printf("\n x is %d", x);
return 0;
}
My answer is sufficient or partially or wrong ...? Give me an advise ?
Thanking you.
|
|
|
|
|
its partially correct.
'static' has multiple meanings. you've mentioned one, but there is another meaning that is more closely related to 'extern'.
|
|
|
|
|
Could you elaborate it , please?
|
|
|
|