|
I am trying to have the cross cursor apear when you press down the control key. In the MSDN it says that message controls the mouse message number. When I run this code it does not recignise the key.
BOOL CClusterSimulationView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)<br />
{<br />
if (message == MK_CONTROL)<br />
{<br />
hCursor = LoadCursor(NULL, IDC_CROSS);<br />
SetCursor(hCursor);<br />
}<br />
else<br />
{<br />
hCursor = LoadCursor(NULL, IDC_ARROW);<br />
SetCursor(hCursor);<br />
}<br />
return true;<br />
}
|
|
|
|
|
This works fine;
[code]
BOOL m_Cntrl = FALSE;
BOOL CtestView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
if (m_Cntrl)
{
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_CROSS));
return true;
}
else
{
return CScrollView::OnSetCursor(pWnd, nHitTest, message);
}
}
void CtestView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if(nChar == VK_CONTROL){
m_Cntrl = TRUE;
}
CScrollView::OnKeyDown(nChar, nRepCnt, nFlags);
}
void CtestView::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if(nChar == VK_CONTROL){
m_Cntrl = FALSE;
}
CScrollView::OnKeyUp(nChar, nRepCnt, nFlags);
}
[/code]
|
|
|
|
|
can somebody give me the link to the latest Device development kit (DDK) for NT or win9X
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
|
sorry monty, you have to order it... no downloads anymore
Don't try it, just do it!
|
|
|
|
|
How would I get an application to register a keydown, keyup, or keypressevent thile it is minimized?
James Meade
vENS vUSN
vOPSOFF VAQ-140
|
|
|
|
|
Hey all.
I went and picked up a copy of VS .NET 2003.
One thing that I cannot seem to get rid of is the "outlining feature" of it. (Where it kind of looks like a "Tree View" and I can click on "+" and "-" on the left to expand/collapse "blocks" of code (such as an IF statement, or a CLASS method)
I went into "EDIT -> OUTLINING -> STOP OUTLINING" and that got rid of it. However, it comes back "sporadically". It always comes back on me after an error in the code (such as a misspelled variable name) ... but sometimes I'll just be sitting there and all of a sudden, WHAM it turns on as if I just turned it on.
I am wondering if there is an option somewhere where I can just say opposite of Nike(tm) "Just Don't Do It" (heheh)
Thanks in Advance!
-Shultas
|
|
|
|
|
Tools > Options > Text Editor > C/C++ > Formatting, then uncheck 'Enter outlining mode when files open' might help.
Repeat for other languages.
There doesn't seem to be an overall 'no outlining' option, sorry.
|
|
|
|
|
Hi,
My app uses an embedded web browser control. In order to print to specific printers, I change the default printer setting in the registery, and then use the following function to print the html...
ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, ...
My problem is that the web browser doesn't respond to the notification message...
SendNotifyMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)_T("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows"));
The only way I can make the web browser use the new default printer is to destroy and re-create the browser object. But this is quite slow.
Anyone got any better ideas?
|
|
|
|
|
Hi Joanne,
Did you ever find a solution to this problem?
-Jason
joanne_fredrickson wrote: Forum: C / C++ / MFC
Subject: Web Browser Control & WM_SETTINGCHANGE
Sender: joanne_fredrickson
Date: Thursday, January 22, 2004 5:31 PM
Hi,
My app uses an embedded web browser control. In order to print to specific printers, I change the default printer setting in the registery, and then use the following function to print the html...
ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, ...
My problem is that the web browser doesn't respond to the notification message...
SendNotifyMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)_T("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows"));
The only way I can make the web browser use the new default printer is to destroy and re-create the browser object. But this is quite slow.Sleepy
Anyone got any better ideas?
|
|
|
|
|
Hi,
I am writing a Point of Sale system. I have incorperated a dialog with a fullscreen dialog behind. The main window is just a normal dialog with topmost set.
In the initdialog I have a ShellExecute function to launch another app called Fullscreen.exe.
The reason I made a separate program was because I wanted this program to have a differant background colour to the main window.
What I want to know it how I can have the main window which I call CNPOSDLG as the very topmost dialog and then have the fullscreen dialog the second topmost dialog so that when I click into the CNPOSDLG it wont bring up the start menu down the bottom on top of the fullscreen window.
Also, how can I kill fullscreen.exe when I close my main program?
That sounded very umm.....confusing but I know what I am trying to say lol!
If anyone can help me, I'd really appreciate it!
Thanks
Ashman
|
|
|
|
|
Ashman wrote:
Also, how can I kill fullscreen.exe when I close my main program?
FindWindow() and send it an WM_CLOSE message. Thats what i would try anyways.
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
Hi -
When I use CWnds's CreateControl(), it wants a rect for the size of the control.
If the ActiveX control is bigger than that rect, how can the container discover
this information?
Thanks.
Chris
|
|
|
|
|
Does anyone know any quick code C++ to "clear screen" in the dos box for Visual Studio .NET
|
|
|
|
|
See Mike Dunn's FAQ[^]
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
I'm using visual studio 6.0 and I've been tweaking the project settings on my project. However, now I can't run the debugger. Everytime I try to set a breakpoint I get a message saying the break point cannot be set and so it will be disabled and debugging will start at the beginning of the program. Any ideas?
Under project settings, under the Link tab, I do have "Generate debug info" checked. I was previously getting an error saying this project contained no debug information. Now I can't set a break point. I must be missing something. A clue? Yes, that's it!
|
|
|
|
|
Your current setting is in debug mode? May be you are in release mode...
Try to recompile all the project....
Best Regards
Carlos Antollini
Do you know piFive[^] ?
|
|
|
|
|
Debugging in Release Mode
I've heard a myth repeated many times by my fellow VC++ developers. It is that it is not possible to debug in Release Mode. Fortunately, this is a myth.
Rule 7: When all else fails try debugging in release mode.
It is possible to debug in Release mode. The first step is to turn on symbols:
* In Project Settings (Alt-F2) under the "C++/C tab" set the category to "General" and change the Debug Info setting to "Program Database".
* Under the "Link tab" check the "Generate Debug Info" tab.
* Recompile using "Rebuild All"
This will allow you to see the symbols in the release version. You might want to also consider the following:
* You may want disable your optimization settings when debugging your release version (though this isn't absolutely necessary).
* If you have trouble placing breakpoints, the command "__asm {int 3}" will cause your program to stop at that line (be sure to remove these lines from your program when you are done debugging).
That worked!
|
|
|
|
|
The difference between release mode and debug mode is the Debug info in your code and the type of libs liked, when you turn on those options, you have effectivly turned the Release mode build to debug mode build
Tech.Support : Mam, is your pc running under windows?
Customer : No actually its close to the main door.
|
|
|
|
|
But you can have a release build which is optimised, links to the non-debug versions of various libs/dlls and still contains debug info.
Of course, the info is of more limited use, since the compiler may well have reordered parts of the object code.
Steve S
|
|
|
|
|
I'm trying to switch my project back to Debug mode, but it won't run under those settings.
I've got the project settings to Win32 Debug and I've got the project configurations set to Win32 Debug. What else do I need?
|
|
|
|
|
That should be enough. When you say it won't run, what does that mean, exactly? Won't compile, won't execute under debugger, or what?
Steve S
|
|
|
|
|
I get a debug assertion failed error message.
The debugger then points to this section of the "windows" code when I try to debug the problem...
void CWnd::MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint)
{
ASSERT(::IsWindow(m_hWnd));
if (m_pCtrlSite == NULL)
::MoveWindow(m_hWnd, x, y, nWidth, nHeight, bRepaint);
else
m_pCtrlSite->MoveWindow(x, y, nWidth, nHeight, bRepaint);
}
|
|
|
|
|
John Robbins (of MSDN Magazine's Bugslayer column) recommends always compiling your release builds with debugging information turned on. You just don't distribute your debugging symbols to the end customer.
Enabling the /DEBUG switch to the linker causes it to go a little pessimistic and include everything from all libraries. For a release build, you'll probably want to turn /OPT:REF on, which tells it to only include referenced blocks. In combination with the /Gy compiler switch, this causes any unreferenced code and data to be eliminated, reducing the size of your executable.
If your program crashes, you can now use tools like CrashFinder[^] (look about half-way down the page) to turn the crash address into a source file and line number.
|
|
|
|
|
Well, i'm trying to write a plugin for a 3d application to read a certain 3d model format. I have it all worked out except for the bone part. The game the models come from came with some documentation about the file format used for the 3d models but its not very clear to me, so i was hoping maybe it would be to someone here, cause i'm really not that good with these things..
A bone in the format has the following properties: RestTranslate, RestMatrixInverse, SiblingID, ChildID and ParentID. The RestTranslate are just the coordinates of the bone in space. The siblingID, childID and parentID are the ID's of the sibling/child/parent bones but the part i dont get is the RestMatrixInverse which is supposed to give the "inverse orientation" of the bone, here's what description is given:
Field Size Comment
RestMatrixInverse Matrix34 The inverse orientation of the bone in the at-rest pose
The type of this field is a float[3][4] and somehow it contains the orientation of the bone but i cant get it right.. Do i have to inverse the matrix and then i can get the orientation in euler format? or what? .. if this looks familiar to someone please help me out!
Thank you for reading.
Kuniva
--------------------------------------------
|
|
|
|