Of course that program delete the item of window that have the focus ... the problem is : I am in the listview, I select 2 items, and when I go to main menu, click on delete item from menu, program wants to delete an tree view item, not list view items ... I try to make a little demo, to see what is happend.
// TODO: Add your command handler code here
CTreeCtrl& Tree = GetTreeCtrl();
HTREEITEM hSelectedItem = Tree.GetSelectedItem();
sItem = Tree.GetItemText(hSelectedItem);
sMessage.Format(_T("Are you sure you want to delete '%s' item ?"),sItem);
if(IDYES != MessageBox(sMessage,NULL,MB_YESNO | MB_ICONWARNING))return;
// here I effectivelly delete an item into a serialized file and after that ... ( the tree view is loaded with serialized data )
the code for delete an item from list view is similar, but at the point when I have confirm message-box, the message said to me that want to delete item from listview, not from tree view ....
I don't know if I'm was understable, but thank you anyway for your interest !!!!
Looking at (ATL) code of mine for handling tabs, and which uses <code>GetDlgItem</code> rather than <code>SetFocus</code>, the only difference I can see is that I have a call:<pre>// Now select all like normal tab behaviour
SendMessage(hNew, EM_SETSEL, 0, -1);</pre>at the end. Presumably as my tabs have edit controls on and the cursor needs setting up. So unless there's a parallel with your views e.g. ensure, say, a node or list item has focus or is other wise set up, I'd agree with Chris and wonder about the code doing the deleting.
I'm new with Win C++ API, I'm trying to create an application that lives as a trayicon, and my purpose is to capture the mouse over event when hovering over the icon..this should launch a new window. I've had some try by using the WM_MOUSEHOVER message on the window handler relative to the NOTIFYICONDATA object, but it seems to have no effect. Am I using the message in a wrong way? Is there some specific API or implemaentation to manage this?
Thank you all in advance!!
I requires to handle OnClose handle of a form view. I am building a heavy tree on it( based on thread ), and while doing that if i closed that form, application was getting crash, because that tree control has been destroyed.
So that I have to capture it's close event so that I can prevent this event to proceed, i.e. to close that form.
Thanks In Advance.
Yes, [MSDN] says: "To destroy an MDI Child window; use the virtual member function CWnd::DestroyWindow. Do not call the global ::DestroyWindow API to destroy an MDI Child window."
It goes on to say: "In the case of C++ Windows objects that do perform auto-cleanup, you must call DestroyWindow. If you use operator delete directly, the MFC diagnostic memory allocator will alert you that you are freeing memory twice (the first call to delete as well as the indirect call to "delete this" in the auto-cleanup implementation of PostNcDestroy)."
I am trying to run one console based application,
Where i reading a argument from command line.
If i press ENTER ,i am writing the sane to the command line.
How can i print the same without pressing ENTER.
Can i execute the second printf without pressing ENTER
This is the code i am using
int main(int argc, char* argv)
printf("\nEnter a number:");
printf("\nThe number entered is %d\n", aNumber);
On Windows, you can utilise the _getch function, which is exposed by conio.h. On *nix, you can use tcsetattr to turn off canonical mode, which is exposed by termios.h, which'll offer immediate feedback when reading.
We have an application developed using MFC in Visual Studio 6.0. which is a client-server based architecture using TCP/IP Sockets.
The server application reads data from text files and binary (which acts as database). Based on the Network configuration, the client application that runs in various stations (PCs connected within the LAN Network) connects to the Server application. Exchange of data then takes place between the server and various number of clients that are connected to the server. All the communication happens using the TCP/IP socket protocol.
Now there is a requirement to convert the existing architecture to web based architechture such that the Server is installed in a remote PC. The clients from various geographical locations have to be connected to the Server.
Please provide me guidelines how to convert the existing architecture to web based architecture.
First you need to convert your Server portion to a web architecture.You can use ASP.Net and SQL Server. Then develop the client in Visual c++ or something else, the client must communicate to the database.
The internet is based on TCP so at the basic level there is no difference.
The two factors that are relevant.
1. You must have a public IP. On a lan you probably have a private one. The public IP allows someone on the internet to address you. You might, but it is not required, also want to have a Domain Name. There will probably also need to be seem network infrastructure setup to route from the public facing hardware to the actual server. None of this has anything to do with the existing server/client code unless the client code does not allow a way to specify an IP/Domain Name (because someone hardcoded the IP.)
2. You MUST provide security. User/pwd should be sufficient as long as the pwd strength is sufficient. You might already have that in the code but if not it must be added.
Besides the above you might want to investigate SSL depending on the nature of the data that gets sent.