|
By using MFC:
Filling the member variable, and call an UpdateData(false)!
I fill the membervariable by adding the new text to the old, and ending with a \r\n
m_var+=text+"\r\n";
UpdateData(false);
DKT
|
|
|
|
|
Ok, I managed it by showing the newest message as first entry. But I still would like to know how to solve the above mentioned problem!
DKT
|
|
|
|
|
I think something like this is what you are after:
CString strText;
m_edit.GetWindowText(strText);
m_edit.SetSel(strText.GetLength(), strText.GetLength(), FALSE);
strText += "\r\n";
m_edit.ReplaceSel(strText);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Here is another way I have found to achive a scroll.
//Update Edit String IDC_STRING is the name of my edit box
//and temp_str is the name of the string to write to the dialog box.
dlg.SetDlgItemText(IDC_STRING,temp_str);
//Scroll to bottom.
dlg.SendDlgItemMessage(IDC_STRING, WM_VSCROLL, SB_BOTTOM, 0);
(I made my dialog global).
|
|
|
|
|
Thank you DavidCrow. this was the solution which I was searching for months.
You've done a good job.
Thank you for your guidance.
|
|
|
|
|
Hello friends
I am facing the following simple problem (as I am very new to VC++). The purpose is to display second window/screen after the user clicks 'OK' in the first window/screen. But the problem is that the second window fails to get displayed. The code has been written as below...
Please help....
Thanks
BOOL CMyDialog::InitInstance()
{
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
AfxEnableControlContainer();
#ifdef _AFXDLL
Enable3dControls();
#else
Enable3dControlsStatic();
#endif
CDialogfirstwindow dlg1;
m_pMainWnd = &dlg1;
int nResponse1 = dlg1.DoModal();
// The first window is successfully displayed
if (nResponse1 == IDOK)
{
//#if defined REQUIRED_CODE :
// This code has been introduced thinking that new window
// may need re-intialization..
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
AfxEnableControlContainer();
#ifdef _AFXDLL
Enable3dControls();
#else
Enable3dControlsStatic();
#endif
// #endif
CDialogsecondwindow dlg2;
// The Second window fails to get displayed
m_pMainWnd = &dlg2;
int nResponse2 = dlg2.DoModal();
if (nResponse2 == IDOK)
{
}
else if (nResponse2 == IDCANCEL)
{
}
}
else if (nResponse1 == IDCANCEL)
{
}
return FALSE;
}
|
|
|
|
|
This has to do with m_pMainWnd and it's being assigned a NULL value. Read here for more.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks a lot..David..I got it done..
Sam
|
|
|
|
|
Hello !
I need to have a dialog that will be used like a modal dialog box from an user point of view (so it means, the user can only interract with this dialog and no more with the program itself) BUT I need to work with it like a modeless dialog box from the code point of view (so it means that the program cannot be interrupted and must still run and print data in the underground window).
Is it possible to specify a modeless dialog to act like this ??
Thanks
|
|
|
|
|
Spawn the modal dialog in its own thread. i.e., in the mainframe, set up a thred function that calls dialog.domodal() and in the event handler that spawns the dialog, do AfxBeginThread(YourThreadProc, this); That should work.
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Hi thank you for your response... and sorry for the delay (I had a very very long week-end ).
The problem is that I need to send data to the dialog (a new data every 10 msec approximatively). The dialog will then print this data on screen. So, if my dialog is called with DoModal, I cannot send anymore data to it and that's a problem. And I cannot get the data from within the dialog, it must be sent to it.
Any idea ?
Thanks
|
|
|
|
|
dear buddies
can some buddy help me out the problem that i am in . i am working on operating system project and i need a way how to get access to process handle table in kernal address space
ok
sunny
|
|
|
|
|
i wonder, how MSN detects network connection, not internet but network connection, after that it tries to login user.
interesting fact is that i specified wrong DNS and gateway, but MSN detected local area network and tried to connect to its server.
so may be it use some system notifications? what do you think? really it can help me a lot.
thank your, Mike.
|
|
|
|
|
I have changed the font on some of my CTreeCtrl items.
The thing is that, when changing the font to for e.g. bold the text (in WinXP anyway) becomes to wide so the last letters are missing in the text-drawing region. Anyone have encountered the same problem?
_____________________________
...and justice for all
APe
|
|
|
|
|
You get a similar problem if your PC uses large fonts and you run the prog on a PC with small fonts. The PC with the smal fonts has the text truncated, usually aparent if static controls
"An expert is a person who has made all the mistakes that can be made in a very narrow field." - Neils Bohr
|
|
|
|
|
Sum.. I can do nothing about it?
Except add some spaces att the end of the item text
_____________________________
...and justice for all
APe
|
|
|
|
|
I can't comment I can't remember ever having this problem on a tree control, sorry
"An expert is a person who has made all the mistakes that can be made in a very narrow field." - Neils Bohr
|
|
|
|
|
Put
SendMessage(CCM_SETVERSION, 5);
in OnInitialUpdate();
There's more to it than that, but that will get you started.
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
|
|
|
|
|
can any1 guide me in writing code which can detect the internet enabled programs on a machine. i need to know which are the programs on my machine that are accessing internet.
|
|
|
|
|
Hi,
I'm trying to setup Bluetooth communication between my PC and another bluetooth device.
The problem is that i don't want to do this from the bluetooth manager - i want to this directly from my application.
I tryed to use WSALookUpServiceBegin(),
WSALookUpServiceNext(),WSALookUpServiceEnd() but i allways get 3 "unresolved external simbol" Errors(yes,i've imported "ws2_32.lib" and included "winsock2.h" but it still refuse to work).
please,help me........
Regards,
Eli
|
|
|
|
|
Are you running XP SP2?
The Microsoft bluetooth stack wasn't added until then.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hi,
I'm trying to setup Bluetooth communication between my PC and another bluetooth device.
The problem is that i don't want to do this from the bluetooth manager - i want to this directly from my application.
I tryed to use WSALookUpServiceBegin(),
WSALookUpServiceNext(),WSALookUpServiceEnd() but i allways get 3 "unresolved external simbol" Errors(yes,i've imported "ws2_32.lib" and included "winsock2.h" but it still refuse to work).
please,help me........
Regards,
Eli
|
|
|
|
|
Hello,
This question regards localization of an mfc application.
I create a base project from the MFC wizard in either Visual C++ 6.0 or .Net. On the 2nd page of the wizard I am asked what language I would like my resources to be in. I select Korean( For version 6.0 Korean must be added manually as it is not a default entry). I click Next to the remaining pages constructing a Multiple Document Interface (MDI).
I execute the application and see all the menu resources in Korean characters which is what I want. When I click on the About box of the sample application I have created, the dialog appears with ?? marks where the Korean characters should be displayed.
I understand in the resource editor of Visual C++ that it is limited to ascii characters and therefore I cannot view any of the korean characters from within the resource editor.
I am compiling the project with the default option of _MBCS ( Multi byte character set).
If I convert this preprocessor option to _UNICODE, the menus and the dialog resources are both displayed in korean. The problem is I need it to work with _MBCS.
I don't understand why the application when using _MBCS can display menus correctly (ie. in Korean characters) but displays dialog resources such as Text labels and buttons with question marks. It is as though it has only been half implemented.
I really need to be able to get the project to display using the _MBCS preprocessor as I will eventually need to display Korean characters in a large project and do not wish to convert it to unicode.(big job).
I have changed the font of the dialog to various fonts such as Gulim ( Korean supported font) also the virtual font 'Ms Shell Dlg 2'.
Thank you to everyone who can explaing to me what I am doing wrong or missing as to why a standard run of the mill MFC Wizard application only displays Korean characters in all the menu's but not in Dialog's or Frame resources.
Thank you very much
Virtualweb
|
|
|
|
|
hi all,
I want to create Barchart to show the Arriaval Time of the Employee.
Employee names are in the Y axis and employee time in the X axis..
This is should be diamically changing the time and the no of Employees..
So how do I create such a Barchart Graph using MFC/C++?
If anyone know this,please help me...send me a reply
Thanks in advance
|
|
|
|
|
Are you using the Microsoft Chart Control?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|