|
How about after the UpdateWindow call in your InitInstance?
|
|
|
|
|
Hello there,
I have an ActiveX control that contains a TreeCtrl. However, I don't seem to be able to catch the Backspace Key event. I can catch DELETE or ESCAPE, but even when I watch the action using SPY++, there appears to be no messages sent to the TreeCtrl when the backspace key is pressed.
Could anyone enlighten me on this problem?
thanks
|
|
|
|
|
We have a DebugBreak call at the start of one of our VC++ programs. When it is hit it brings up a dialog box telling you so.
Only problem is, on one machine the dialog box has an Ok and Cancel button. On another machine only the Ok button is displayed. No Cancel button - no debugger.
Both machines are nearly identical in hardware and software. NT 4, Visual C++, Visual Basic, etc. We are looking at environment settings, project settings, etc.
Any ideas on where the cancel button is?
Thanks,
David
"I don't have a catchy saying to put here yet."
|
|
|
|
|
This is from Enabling Just-in-Time (JIT) Debugging
Editing the Registry
The Just-in-Time debugging settings are stored in the registry, under \\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug\. The two relevant keys in this directory are Debugger and Auto.
The Debugger key's value shows the name of the debugger specified to analyze application errors. The Auto key is either zero or one.
When an unhandled application error occurs, Windows checks to see if the Debugger and Auto keys exist.
If the Auto key equals zero and the Debugger value contains the name of a valid debugger (such as WinDbg or NTSD), the message box will have two buttons: OK and Cancel. If the OK button is pressed, the application is terminated. If the Cancel button is pressed, the debugger specified in the Debugger key is started.
If the Auto key equals zero, but the Debugger key value is empty, the message box will have only an OK button and no debugger will start.
If the Auto key equals one, no message box appears. The debugger referred to in the Debugger key is automatically started.
|
|
|
|
|
That worked great! Many thanks. Did some searching on MSDN etc. and no luck. I figured somebody out in Codeproject land would know (and in 6 minutes!).
Thanks Again!
David
|
|
|
|
|
We never sleep!
Actually, I just realized that the article quoted is not in the MSDN help - I found it in the help file under Debugging Tools (aka WinDbg) - installed from the platform SDK, I think.
If you've got the MSDN CDs, might want to check it out.
And thanks for the thanks!
|
|
|
|
|
Does anyone know a quick way of determining the IP address in use on a network (i.e. for all IP devices). There are many article that use WNetEnumResource but this will miss Routers, Switches etc...
I have been able to scan the IP range and ping each device to see if it is present but this is slow and inefficient.
Any help would be appreciated.
Thanks in advance.
Antony Kancidrowski
|
|
|
|
|
Hello
In a float variable I have stored the value 1.15.
When I want to printf it upto only one precision then it should print 1.2 by rounding the precision. But it prints 1.1.
This happens with 1.15 only. It works fine for other numbers like 1.25, 1.35 etc. For these numbers outputs are like 1.3, 1.4 sequentially.
I will like to know why it happens with the 1.15 only.
Any suggestions or solutions are welcome.
Thanx in advance,
Vikram.
|
|
|
|
|
From a quick look at the docs, this is a common problem.
One work around is to add a small number before formatting - 1e-10 works for doubles:
#include <iostream>
#include <iomanip>
using namespace std;
int main(int , char* )
{
cout << "Testing prec\n";
double f[] = {1.15, 1.25, 1.35, 1.45, 11.15 };
cout << setiosflags( ios::fixed ) << setprecision(1);
for (int i = 0; i < sizeof(f)/sizeof(double); ++i) {
cout << f[i] + 1e-10 << " ";
}
{
int x;
cin >> x;
}
return 0;
}
You might need a different modifier for floats.
|
|
|
|
|
hello Tim
Thanx a lot for solution.
I'll try out for float.
Vikram.
|
|
|
|
|
Hi
Does anyone know why when I send a HTTP Post, using SendRequest I get an exception which when I catch says "operation timed out" with an error number of 12002?
This happens after about 10secs. I have set the timouts for the session such as INTERNET_OPTION_RECEIVE_TIMEOUT and INTERNET_OPTION_CONNECT_TIMEOUT to be 600 secs. (They seem to make no difference changing them at all!)
Thanks in advance
Neil
|
|
|
|
|
Hi,
I'm trying to make a menu to luanch Games and Aplications. But I dont know the Code for luanching a program like run("C:\test\test.exe"); if you get my point
thanks
|
|
|
|
|
Look at ShellExecute, CreateProcess, _spawn functions.
HTH
Jignesh
|
|
|
|
|
Hello,
From what I have read this code is out of date and its better practice to use shellexec.. I still use it every once and a while and it works fine..
WinExec("C:\\test\\test.exe",SW_SHOW);
RobJones
|
|
|
|
|
If I have a Connection set up, how do I attach it to a Recordset ? I've opened a file on disk, now I want to use that Connection with a Recordset.
Thanks.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
You could use your connection object as the ActiveConnection argument in the RecordSet Open method.
|
|
|
|
|
Thanks - I thought so, but when I tried this it did not work. I am enough of a rank beginner with ADO that I needed a sanity check to make sure I was headed in the right direction. Now I know I was, I'll have another look & see what I was doing wrong.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
In my view I've placed a grid control. The view is derived from CFormView. When I run the application I get an small border around the grid control even that I've dragged the grid control till the edges of the form when I created it.
|
|
|
|
|
How do I add full DDX support to a class I have created based on an existing MFC class?
I have a class that is derived from CButton. I have overridden the PreSubClass.. function to ensure that it is owner drawn, which in turn enables the subclassing through DDX_Control. However, with it being a button the user could add a member variable through ClassWizard, such as a boolean for a checkbox. How do I enable the support for DDX_Check and DDX_Radio?
Derek Lakin.
Salamander Software Ltd.
|
|
|
|
|
|
I did have a look at that one, but hoped there was another way round. Am I right in thinking that to do it this way I'd have to define new DDX_ routines (in my subclass?) and then provide users with the necessary changes to make to DDX.CLW?
I was hoping that I could override some function or handle a message in my subclass
Derek Lakin.
Salamander Software Ltd.
|
|
|
|
|
Do you want to use ClassWizard/DDX for creating data members (BOOL, int, CString) or controls (CYourBtn, COtherWnd)?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I want the users of the class (which is nearly finished!) to be able to use the ClassWizard to add member variables in the usual way when they have a button of mine.
So if it's actually a checkbox and they want a boolean member variable in a dialog, for example, they can use ClassWizard to add a boolean member variable, and hey presto it works
The process of using DDX_Control to subclass the button to be one of mine is already in place. But it will use DDX_Radio or DDX_Check (or whatever it is) for member variables, which obviously then doesn't work
Derek Lakin.
Salamander Software Ltd.
|
|
|
|
|
I can't understand where's the problem. If you want to use an instance of CYourBtn with DDX_Control, just do it. ClassWizard is smart enough to include CYourBtn in the list of available classes - you'll see CButton and CYourBtn. You don't even have to play tricks with custom DDX. If you can't see CYourBtn on the list, delete and rebuild .clw file.
But it will use DDX_Radio or DDX_Check (or whatever it is) for member variables, which obviously then doesn't work
DDX_Control doesn't use DDX_Check or DDX_Radio. Who told you this?
DDX_Radio and DDX_Check are used for "value" (non-control) members: look at their prototypes - there's no CWnd parameter.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Sorry, I'm not being particularly clear.
Agree with you totally re: DDX_Control. No problem there.
However, if I have a dialog with a CMyButton on it that is a check box and I want to have a boolean member variable associated with it then Classwizard uses DDX_Check . However, I have noticed in my own testing that this doesn't work for CMyButton
So I guess the question really is what do DDX_Check and DDX_Radio use for performing DDX, is it, for example, GetCheck ?
Derek Lakin.
Salamander Software Ltd.
|
|
|
|