I use the API call "ExitWindows" to exit the application & log off the current user . But due to some reason the process doesn't close & after a few seconds a dialog box pops up with the message - "Appln. Not Responding" - Click "Wait / EndTask / Cancel" - when I click "wait" the application closes & logs off the user. what's happening over here?? I observe that the message WM_QUERYENDSESSION gets executed successfully.
Also, If I override the function OnQueryEndSession() & I set a breakpoint inside this function :-
In the debug mode, when I step over the ExitWindows API - I get a message that "Exit the Microsoft Visual studio "???
So, i am not able to see wehat's happening after I pass over the ExitWindows API.
I have query regarding Dates/Time field in MS Access.In MS Access Database I am using one of the field is Date/Time.I am using "General Date" .(i.e)6/27/01 6:59:00 .I am using SQL Query to get all the Records within two date ranges.The query looks like this
SELECT * FROM WHERE BETWEEN And
I am getting all the records inclusive of lower bound but exclusive of the upper bound date.
What may be the problem.Have I to modify the query ?
Hi everyone! This is my first foray into 'The Code Project'.
I learned windows programming through MFC and I'm just now going back and trying to relearn it without MFC (so that presumably when I return to using it I will have a much higher appreciation.) Anyway, I have a simple problem and I would be grateful for help with it.
I made the default MSVC 6.0 SDK 'Hello World' project. Then I put some controls on it using CreateWindow("EDIT"...) and "STATIC" and "BUTTON". Now I want a window that simply sends a message to the parent giving client x,y coordinates when it is clicked on. The way I used to do this was just to capture the clicks in the main window and do the calculations to see whether the click was in any of the child windows. I tried subclassing (I just learned what subclassing is) a "STATIC" window to handle the WM_LBUTTONDOWN, but it acts like it's not even there . I know the subclassing worked though because it handles WM_PAINT fine.
I saw that option while I was poking around (though it doesn't help that SS_NOTIFY isn't in the MSDN help index ) and I dismissed it after looking at the scant offerings of STN_* (I think they were 'click' 'dblclick' 'enable' and 'disable' or something) since I needed more information (like *where* they clicked and which button) which is why I decided to learn about subclassing.
Anyway, I tried the SS_NOTIFY style just for the hell of it, and lo and behold all of the subclassing stuff I was trying to do started working! I guess the subclassing doesn't work unless you have SS_NOTIFY on, though I can't find that in the help anywhere.
I have trouble refreshing one static text after having set it to WM_VISIBLE off
if I minimize & maximise again the static is gone but how can I send order to refresh
the static text directly.
I tried already invalidatrect drawwindows() and some other solutions, nothing work.
I suppose that I should invalidat the Cstatic object (in fact the excellent CLabel class
derived from CStatic) then send a WM_PAINT to the main but I don't know how to exactly
do this following the rules to get clean code. (I'm newbies at MFC)
It was written as a non-class template excercise. The example is trivial, but the real-world structures share some common elements that will be used in future templates. Since sizeof(T) is used to limit the amount of data copied, what is unsafe about the template?
> real-world structures share some common elements that will
> be used in future templates. Since sizeof(T) is used to limit
> the amount of data copied, what is unsafe about the template?
You're using a C++, right? (last time I've checked C had no templates). Don't expect bitwise copy to work correctly with C++ objects. Moving bits around will work only if your structs are simple aggregates of primitive types like int, char or double.
I'm working on an application that contains a CListCtrl. One requirement for the list is that it always displays its vertical and horizontal scrollbars, regardless of the client area. I've tried simply setting the WS_HSCROLL and WS_VSCROLL styles during creation, but to no avail. After much trial and error, I was able to force the scrollbars to display by modifying the list's style in response to a WM_SIZE message.
// WM_SIZE handler
void ACtrlGrid::OnSize(UINT f_nType, int f_cx, int f_cy)
// call base class
CWnd::OnSize(f_nType, f_cx, f_cy);
I have two problems with this approach. First, as a result of re-adding the scrollbars the client area size changes which generates another WM_SIZE message. Eventually this recursion is terminated, no thanks to me, but its still a hack. My second issue involves the CListCtrl's header sizing ability. With this approach it is impossible to grab the last column's sizing handle because the vertical scrollbar is covering the right edge of the last column header item. It seems that the listview don't realize when the vertical scrollbar is displayed, and as a result, the horizontal scrollbar range is not increased to account for the extra room the scrollbar is covering.
I'm really looking for an elegant way to override the listview's default scrollbar implementation.
I am able to have an icon in the system tray and am able to maximise/minimise from system tray. But I want the 'Maximise' item in the menu to be disabled after the window has been maximised. For this I am writing the following code, but it does not bring the desired result.....
CMenu menu, *pSubMenu;
pSubMenu = menu.GetSubMenu(0);
::EnableMenuItem(pSubMenu->m_hMenu, uItem1, MF_GRAYED);
// Open the company key
result = RegCreateKeyEx( HKEY_CURRENT_USER, "UHS", 0, "", REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS, NULL, &key1, &disp );
// Open the Local subkey
result = RegCreateKeyEx( key1, "Local", 0, "", REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS, NULL, &key2, &disp );
// Get the values of IP, InPort, OutPort
result = RegQueryValueEx( key2, "IP", 0, &type, LocalIP, &size );
+ result = RegQueryValueEx( key2, "ToPort", 0, &type, LocalToPort, &size );
+ result = RegQueryValueEx( key2, "FromPort", 0, &type, LocalFromPort, &size );
// Open the Server subkey
result = RegCreateKeyEx( key1, "Server", 0, "", REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS, NULL, &key2, &disp );
// Get the values of IP, InPort, OutPort
? result = RegQueryValueEx( key2, "IP", 0, &type, ServerIP, &size );
result = RegQueryValueEx( key2, "ToPort", 0, &type, ServerToPort, &size );
result = RegQueryValueEx( key2, "FromPort", 0, &type, ServerFromPort, &size );
The registry entries are just IPs and port numbers and the editor shows they are OK. When the above code is run it fills in everything EXCEPT ServerIP. This call returns an error "234" which the ISDN helpfully identifies as "More data available". If I leave out the two calls marked with "+" the thing works and I get the ServerIP.
I have tried to change the order of calling things but no matter what I do, one of the values returns an error. I have tried all kinds of other things like having individual key handles, flushing etc. but nothing works.
My registry is not corrupt and I have tried this on two different machines in different offices. Hope someone knows what's happening.
I am trying to learn VC++ and have a small project I would like to try.
On NT 4.0 Workstation pop up a message box before a user logs on using the Ctrl-Alt-Delete sequence. I have read MS articles on enumerating desktops and using WinLogon events but can't seem to get anything sent to the "WinSta0\?????" desktop.
All I realy want is to send a message that the wks is being upgraded please don't logon until after it reboots.
Am I crazy can this not be done.
Thanks ahead of time. If you can even point me to some sample code or tell me where to look I would appreciate it......
I want to create an array of an array of char's. Basically, I want to call calloc (or whatever) on a char**. Whenever I do this, I get runtime memory errors or compile time casting errors.
I need this so that I can create an 20 element long array of an array of 256 char's (that's confusing ). However, I will not know the actual lengths of the arrays until runtime, so that's why it needs to be dynamically allocated. Any help would be appreciated.
Last Visit: 31-Dec-99 18:00 Last Update: 23-Jul-16 14:27