|
Give it a spin and see.....
Steve
|
|
|
|
|
99
since 65536 % 256 = 56 and 'i' = 105
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Luc Pattyn wrote: since 65536 % 256 = 56
Are you kidding? Or you C# guys have lost the powers-of-two sequence?
And yes, I know it was a typo.
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]
modified on Friday, May 14, 2010 2:48 AM
|
|
|
|
|
Me? Never.
just a typo perhaps.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Is this a new type joke or cheap quiz?
Or somewhat a mystery what I don't know?
|
|
|
|
|
You should find a 'charitable' compiler for your code...
And what about semantics?
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]
|
|
|
|
|
Manoj Kumar Bestha wrote: wat will be the output
Certainly nothing like the answer you are expecting; take a closer look at your code. Also note that for questions like this you can get an immediate answer by compiling the code and running it at home.
It's time for a new signature.
|
|
|
|
|
Any ideas on what caused this and how to fix it?
Thanks for any help.
Alan
|
|
|
|
|
Can you be more specfic are u Debugging Building an app
Anyway What is the Host OS I have had problems regarding access Going fro XP to Vista
If this is your issue try runing Visual Studio as Adminstrator Just right Click on the VS Icon and
there should be a option "Run as Adminstrator"
|
|
|
|
|
Hi:
Yes, I'm building the app and I want to add some more controls and I right click on the DLG in the class view to try to view it so I can modify it and all the sudden I was denied access. I was able to do it before. I'm running Visual Studio Std edition Service Pack 1 on XP.
Thanks, Alan
|
|
|
|
|
One thing you could try, is to exit Visual Studio. Then go to the folder where your project is and delete the *.NCB file. The file will automatically be rebuilt next time you open your project.
This might help.
|
|
|
|
|
Nope. Tried that and it didn't work.
Thanks for the suggestion though.
This is really annoying !
|
|
|
|
|
Hi,
I am trying to re-create the Yellow arrow the Visual Studio Debugger displays while stepping thru code
Is that custom cursor or custom windows/control ???
thsnxk
|
|
|
|
|
|
|
Sorry about the spelling
I am writting a Debugger ????
I can postion the Cursor to the instruction being executed
its a little "Blue Box"
That yellow arrow VS debugger is really neat how do I get one of those ???
|
|
|
|
|
What about trying a google search[^] ?
Be sure on Copyrights while using artworks for commercial purpose.
|
|
|
|
|
This is all a learning prooject for me If I save the the bitmsp image as a .cur file and do a LoadCUrsor on it whwnI Afxregisterwndclass
right ????
|
|
|
|
|
case WM_SIZE:
{
wchar_t Width[5];
wchar_t Height[5];
_ltow_s((WCA.right-WCA.left), Width, 5, 10);
_ltow_s((WCA.bottom-WCA.top), Height, 5, 10);
if (RegDeleteKeyValue(HKEY_CURRENT_USER, RegistrySubKey, L"Width") == ERROR_SUCCESS)
RegSetKeyValue(HKEY_CURRENT_USER, RegistrySubKey, L"Width", REG_SZ, Width, wcslen(Width)*2);
if (RegDeleteKeyValue(HKEY_CURRENT_USER, RegistrySubKey, L"Height") == ERROR_SUCCESS)
RegSetKeyValue(HKEY_CURRENT_USER, RegistrySubKey, L"Height", REG_SZ, Height, wcslen(Height)*2);
return 0;
}
case WM_MOVE:
{
wchar_t Left[5];
wchar_t Top[5];
if ((int)(short)LOWORD(lParam) > 0)
_ltow_s((int)(short)LOWORD(lParam), Left, 5, 10);
if ((int)(short)HIWORD(lParam) > 0)
_ltow_s((int)(short)HIWORD(lParam), Top, 5, 10);
if (RegDeleteKeyValue(HKEY_CURRENT_USER, RegistrySubKey, L"Left") == ERROR_SUCCESS)
RegSetKeyValue(HKEY_CURRENT_USER, RegistrySubKey, L"Left", REG_SZ, Left, wcslen(Left)*2);
if (RegDeleteKeyValue(HKEY_CURRENT_USER, RegistrySubKey, L"Top") == ERROR_SUCCESS)
RegSetKeyValue(HKEY_CURRENT_USER, RegistrySubKey, L"Top", REG_SZ, Top, wcslen(Top)*2);
return 0;
}
I'm using these 2 events to record my window position and size. However by running and closing my app and running it again, without changing any of the dimensions. It is just affected by running and closing!
Changing size on it's own!
|
|
|
|
|
I'm not sure what you're asking exactly, but there is a little problem with your code. It's probably not a good idea to manipulate the registry in every sizing event. Just record the size when the window is destroyed and read-and-set when the window is created.
Steve
|
|
|
|
|
The problem isn't with the saving, can you imagine when you close and reopen the application.
The window changes size on it's own, although I haven't modified or changed the window coordinates in anyway. If not dimensions or position!
|
|
|
|
|
Nevertheless, accessing the registry on every size event is an insane design.
Steve
|
|
|
|
|
The user won't change the size of the window every moment, because the program is still buggy.
I was trying to maintain the last state, to ensure the crashes didn't harm much of the program.
|
|
|
|
|
Firstly, don't access the registry in these notifications: it's crazy and will slow down your application's responsiveness. If your going to do something, don't stuff it up before you start!
Secondly, WM_SIZE and WM_MOVE events will be sent during the creation of the window, even without any user interaction. This is what most people would expect (think of it this way: the windows is being moved and sized by the system when it's created).
Finally you don't seem to be doing any coordinate mapping (see ClientToScreen[^]), although I admit you haven't posted the code which restores the window position and size at startup.
Steve
|
|
|
|
|
I suggest a general logging technique like below;
case WM_CREATE[
{
RECT rect;
GetWindowRect(hWnd, &rect);
write_log("WM_CREATE: %d, %d, %d, %d\n",
rect.left, rect.top, rect.right, rect.bottom);
... other codes ...
return 0;
}
case WM_SIZE:
{
write_log("WM_SIZE: %d, %d, %d, %d\n",
WCA.left, WCA.top, WCA.right, WCA.bottom);
return 0;
}
break;
case WM_MOVE:
{
write_log("WM_MOVE: %d, %d\n",
LOWORD(lParam), HIWORD(lParam));
return 0;
}
write_log() maybe like this;
void __cdecl write_log(const char* format, ...)
{
va_list(args);
va_start(args, format);
FILE* fp = fopen("trace.log", "a");
vfprintf(fp, format, args);
fclose(fp);
}
You might be able to catch the point with the log file.
|
|
|
|
|