Hi, I would like to capture the event of a button being pressed down (CButton control class). Windows only sends a command message when the button is released if using OnClickButton().
If you could help out that would be great. Thanks !
Put CButton cButton; in the header file of the view you want the button in, not the MDI frame as you mentioned.
Put the following code in the OnInitialUpdate()of the view you want the button in:
CRect cRect(5, 5, 100, 50);
cButton.Create("My Button", BS_DEFPUSHBUTTON,cRect,this...
Thanks, it worked. I don't need to set the cchTextMax to set an item in a list control but I need to set it to get an item. Doesn't make sense to me but ok.
Thanks again.
I can't seem to get the text for a header in CListView. I can get the index of the item and I can set the text and center it but when I call GetItem( )with HeaderItem.mask = HDI_TEXT it fails. If someone can help me out that would be great because I'm going to go insane.
Here's what I have...
LPCSTR is 32 bit pointer to a constant character string.
This should work:
LPCSTR pText = textBox6->Text;
WritePrivateProfileString("el33t", "textBox6", pText, "C:el33t.ini");
Or you can try typecasting:
WritePrivateProfileString("el33t"...
Is this a file specific to your app that only your app can open? Or, are you talking about any file, excel, word, etc?
A little tip, excel files fail if you try to open them in your app and they are already opened. If you used an extension .xls for your files you can eliminate flag setting...
Your root node should be initialized once. Why do you have this:
//create and insert a new node with a user id and password
root=inserthelp(root,i,p);
Every time you add an new item you return it so root points to it.
Here's some code that reads a file and adds to a tree that might help...
Dal, you are listening on a UDP socket. UDP is connectionless.
I'm a hardcore sockets programmer as I work for a VoIP company and create 700 virtual phones on one PC to exercise the system. I have developed an MFC dialog application that allows me to create UDP or TCP sockets, connect...
On some machines I have problems calling CDocTemplate::CreateNewFrame(NULL,NULL). It works fine on most machines but causes and exception two machines. Operating systems are the same. I've narrowed it down to CRichEditView being the problems because I use it in two templates that are causing...
Quick and easy way to open a link the users default browser:
int pHinst = (int)ShellExecute(NULL,
"open",
"www.rjcsoftware.ca", // link
NULL,
NULL,
SW_SHOWNORMAL);
Cheers,
Brother C
I recomment The Visual C++ 6.0 Bible. Takes you through everything from Dialog, SDI, and MDI applications. Covers menus, toolbars, status bars, etc, with examples to boot. You won't regret reading it.
Brother C
The code below will display all the ip addresses on one machine in a list box in a dgl box. If there is only one address the dlg box is not displayed (well is is but very quickly the user doesn't see it). If there is more then one ip address (more NICs) the user double clicks on the ip address...
Sorry about my previous reply. It was for another topic not this one.
On this topic now, you should defenetly be using CWinThread and AfxBeginThread( ) to start your threads for many reasons if your using VC++. MSDN library explains these reasons and answers all the questions you've asked...
It sounds like this is what you're doing:
Receiving data and updating the dialogs from your receive thread if any dlgs are open using a pointer to each dlg. Only problem is you terminate the app and the receive thread terminates last and still trys to update a dlg that has been destroyed but...
It sounds like this is what you're doing:
Receiving data and updating the dialogs from your receive thread if any dlgs are open using a pointer to each dlg. Only problem is you terminate the app and the receive thread terminates last and still trys to update a dlg that has been destroyed but...
Hi,
In my MDI app I would like to remove the close button from the system menu in all my view frames and just have the maximize and minimize button. Can't seem to do it. I can disable the close button using CMenu but I would like it removed.
Is this possible? I noticed in the CDialog...
Hi,
I would like to create a professional looking icon for my application. Any one know how to do this. I need a little more then the editor VC give you. Something that you could import a bmp or something into, shrink it, and create an icon. I'm sure something like this must exist.
Cheers...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.