|
You are welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Sure,you just want to change the resouse of the picture.
|
|
|
|
|
|
Actually the number is the key, and I used struct for the rest.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Hi,
Does anyone know how to open files as read-only in VS2008 like you used to be able to do in VC++6.0? The number of times I have edited the wrong file, saved it and screwed up a totally different project
There is a drop-arrow on the Open button but it doesnt do anything.
Ta
|
|
|
|
|
Apply 'Read Only' property to all the files/folder you don't wanna to change.
|
|
|
|
|
Hi all,
I want to read a user input with spaces, say "Hello World". With scanf how can i do that. Because all the time after the space, I cannot read the input.
scanf("%[^\n]", name);
scanf("%s",&name);
fscanf(stdin, "%*s%99[^\n]", name);
None of the above solve my issue.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
You can't do it with scanf - use gets[^] instead.
Edit before someone else says it: of course gets isn't safe to use since you can't specify the buffer size, so use fgets[^] instead.
modified on Wednesday, September 7, 2011 2:51 PM
|
|
|
|
|
Simply I tried the following, but it didn't work either
char test[1024];
printf("\nTest ");
gets(test);
I appreciate your help all the time...
CodingLover
|
|
|
|
|
scanf("%[^\n]", name); works.
If it does not, then check how name is declared.
It should be something like char name[1024];
|
|
|
|
|
I did exactly the same, but didn't work mate.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Run this and tell me what you get -
char name[1024];
scanf("%[^\n]", name);
printf("[%s]", name);
|
|
|
|
|
It simply print some garbage characters. Even in debug it'll not looking for the user input.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
That's strange.
It works as expected for me.
Are you running it from a console application?
If you can give me more details like the environment that you're using and the type of program you're using, I could try to recreate the issue at my end.
|
|
|
|
|
Sorry for the late reply!
Yes it was a console application. I did this on VS 2008.
However when I use cin instead of scanf, works fine.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Same code worked fine for me am also using vs2008
|
|
|
|
|
How to set/remove ES_READONLY style of CEdit at runtime?
|
|
|
|
|
Have you tried ModifyStyle() , or SetReadOnly() ?
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
To change it at runtime, you can't use the flag ES_READONLY directly. You have to use the EM_SETREADONLY message.
See MSDN.
|
|
|
|
|
Hi all,
I want to post a message to a specific server from windows 7 os.
Iam using WTSSendMessage api to post the message.
1. this api takes the handle to the opened server.
2. if i open the handle to my own machine and use that handle to the WTSSEndMessage api, i get the message in my machine.
3. Whereas if i open the handle to anyother machine and if i use the same handle in WTSSendMessage api, the function failing with error message, "Acess is denied.".
4. Also even the firewall is off in the machine where i try to send the message.
If anyone know the solution, pls let me know!
thanks,
Arun P.
Arun P.
|
|
|
|
|
On the MSDN site for WTSSendMessage[^] look for this text: "WTSSendMessage to a remote computer is denied by default " and read what it says. Could this be your problem?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
We have a print template that replaces generic keywords with specific information, and I've had some reports that the locale specific date format isn't 'taking' on some machines. We have:
if (Key == _T("#CDAT#"))
{
CTime time = CTime::GetCurrentTime();
Text = time.Format("%x");
}
This appears to work fine on all the machines I've tested it on, under XP, Vista and Win7. But we have a couple of users (one XP, one Win7) that report having to go to the control panel regional settings and 'flip' them, to get the right format in our app. And they report having to do this every time our app is restarted.
To be clear, these users have something like the following scenario:
1) They use the template and see the date come out in English (US) format (mm/dd/yy)
2) They go to regional settings and see that the locale is set to English (New Zealand), and thus the date should be in (dd/mm/yy) format.
3) They flip to English (US) and OK everything.
4) They go back to the settings and flip them back to English (New Zealand). This solves the problem until...
5) Our app is restarted, and steps 1-4 must be repeated.
I'm at a loss to even imagine how this behaviour could occur. There aren't any services or anything that try and 'fix' your locale settings are there? Anyone got any ideas?
Cheers
|
|
|
|
|
I'm leaning toward PEBCAK resolution here... just had a report that the problem 'went away' when my Win7 user changed his date format from dd/MM/yyyy to d/M/yyyy.
Hmmmmmmm.
|
|
|
|
|
sorry without specific solution. After reading your question, I 've got your mind and I think it is a "international" or "localization" problem.With different countries we have different languages and OS have different configuration. So if u want your program run consistently u should release your program with document that tell users what OS version and supported software they should have installed . Or u can do it with a solution that solve the problem above.
|
|
|
|
|
I've never had good luck with CTime::Format("%x") . Currently my date format is set to M/d/yyyy, yet Format() incorrectly returns the date as 09/07/11. If I change my date format to dd-MMM-yyyy, Format() reports the same as before.
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|