|
I have a single-line edit control in a dialog-based MFC application. I'm trying to select all the text with ONE mouse click in the edit control, but it doesn't work. I put SetSel(0, -1) function in the OnEnSetfocusMyEdit function, but still it doesn't work. What I am missing?
|
|
|
|
|
One solution is to call SetSel() from the edit object.
editBox.SetFocus();
editBox.SetSel(0, -1);
Kuphryn
|
|
|
|
|
Hi,
Seems like a really stupid one but I'm trying to read email addresses out of around about 100 txt files that have been exported from a database. My plan was to CString.Find() the @ symbol, because only the email addresses have @ symbols in the file, then CString.Find() the space behind it to get the end of the address, then to work backwards and find the first space in front of the @.
My problem is though that if I do bleh.Find("@",0); I always get a return of -1, that there isn't one there. Does anyone know what I've done wrong/need to do to get this fixed?
Thanks
|
|
|
|
|
Have you traced through to make *sure* the address is there ? What does the code look like ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Consider a character if you want to search for one element and a string otherwise.
Find('@'); // 0 is default
Find("string");
Kuphryn
|
|
|
|
|
Hi I am a budding C++ programmer with a question.
I have declared and initialized a 2D array in the header file of my class as such:
char *styles[][2] =
{
/*HTML Start and end tags for styles*/
{"", ""},
{"<b>", "</b>"},
{"<i>", "</i>"},
{"<u>", "</u>"},
{"<!-- ", " -->"},
{"<p>\n", ""},
{"<br>\n",""},
{"", ""},
{"<h1>", "</h1>"},
{"<h2>", "</h2>"},
{"<h3>", "</h3>"},
{"<h4>", "</h4>"},
{"<h5>", "</h5>"},
{"<h6>", "</h6>"}
};
Here are the error messages I get:
error C2059: syntax error : '{'
error C2334: unexpected token(s) preceding '{'; skipping apparent function body
What gives? This is standard syntax is it not? TIA.
|
|
|
|
|
I am moving the initialization to the .cpp file. Hang on...
|
|
|
|
|
plz plz plz help me!!!
i need to change the caption of my check boxes , and tht text for the caption has to come frm a function, that is , it is a character array of an object ..so the caption is different, each time the program is run, according to the object ...stuck on this for hours...HALP!!or my univeristy might become another MIT (as far as suicides r concerned)
sarz
|
|
|
|
|
If you are using MFC, call the SetWindowText() method. It takes a single parameter which is the text to display. If you are using the Win32 API directly, call the SetWindowText() function: the first parameter is the HWND of the control, and the second is the text.
e.g. m_btnCheck.SetWindowText( _T("My checkbox") );
or SetWindowText( hwnd, _T("My checkbox") );
Dave
|
|
|
|
|
|
I have a MFC document that can open 2 files types, but save only one.
Is it possible to make it use a different filter in the save dialog,
since seeing the other file type there would confuse people...
Doesn't look so to me, but I'm hoping someone has done something like this before
|
|
|
|
|
Override the CDocument::DoSave() method, whose default implementation is found in MFC\doccore.cpp. That's where the standard SaveAs dialog box filters are built.
|
|
|
|
|
Thanks, but I don't see that function ever being called.
I am using the Document/View architecture, which seems to call CDocManager::DoPromptFileName() to do that. Any way to do this here?
|
|
|
|
|
Locked Ghost wrote:
Thanks, but I don't see that function ever being called.
Override the method. Put a breakpoint. You'll see this method is called whenever you want to save your document.
|
|
|
|
|
Hi.
I would like to is there a way to "reset" a active socket during data transfer without disconnecting it from the server or client? For example, given a socket is connected to www.google.com and is processing incoming data. Now the program wants to stop all data transfer at a given moment without disconnecting from Google.
One reason is time and speed. Stopping data tranfer via disconnection takes time because the program has to then reconnect to the server or client.
Thanks,
Kuphryn
|
|
|
|
|
I need to build a GUI for my main form in Visual C++ .NET beta 2. I can edit my standard dialog box, but I can't edit my main form. Although I can modify my menus.
Please mail me at: boudewijnector@planet.nl
Thank you,
|
|
|
|
|
Hiya quick question. how do I highlight the last item that is entered into the list control and the rest of them un-highlighted every time. I know I have to get a count of the items.
Have tried it but highlights all the items on entry.
thanks
grahamoj.
|
|
|
|
|
|
Hiya have tried that one already. but it highlights all of the items as they are entered..
all i want highlighted is the last one entered each time..
how do i UN-HIGHLIGHT ITEMS AS WELL..THEN I COULD UNHIGHLIGHT ALL THE ITEMS AND JUST SET A HIGHLIGHT TO THE LAST INDEX ENTERED EACH TIME...
THANKS
GRAHAMOJ
|
|
|
|
|
i wanna develope a video chat program using Microsoft NetMeeting SDK.Now it's latest version is 3.0.And it has samples.But i wonder how i can develope a MFC .exe with the SDK.pls help!!!
thanks for your help
|
|
|
|
|
You can use another simple and powerful SDK:
http://www.banasoft.net/AVPhone.htm
|
|
|
|
|
Hi,
how can I create a custom Internet explorer bar that contains my company logo.
|
|
|
|
|
|
Hello,
when I debug my program, the last lines of the debugger output look like this:
RESYSINFO: WndProc: hwnd=0x0FE4, msg = WM_NOTIFY (0x03E9, 0x007EF458)
RESYSINFO: WndProc: hwnd=0x0FE4, msg = WM_NOTIFY (0x03E9, 0x007EF458)
RESYSINFO: WndProc: hwnd=0x0868, msg = WM_NCDESTROY (0x0000, 0x00000000)
RESYSINFO: WndProc: hwnd=0x0868, msg = WM_USER+0x0C02 (0x0000, 0x00000000)
RESYSINFO: WndProc: hwnd=0x0868, msg = WM_USER+0x0C02 (0x0001, 0x00000000)
RESYSINFO: WndProc: hwnd=0x0868, msg = WM_USER+0x0C02 (0x0002, 0x00000000)
RESYSINFO: WndProc: hwnd=0x0FE4, msg = WM_NCDESTROY (0x0000, 0x00000000)
Thread 0xFFE5A5D3 wurde mit Code 32773 (0x8005) beendet.
Das Programm "C:\Programme\DevStudio\MyProjects\ReSysInfo\Debug\ReSysInfo.exe" wurde mit Code 32773 (0x8005) beendet.
But isn't 0 the normal exit code? What does the code 32773 above mean? I didn't find
anything in MSDN...
-Dominik
|
|
|
|
|
There are no standard exit codes for processes, actually. Back in the DOS days, 0 was ok and nonzero was error, but that's not a hard-and-fast rule.
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|