|
How to insert soft enter in Rich Edit Control.
What does it mean "soft enter"?
--
======
Arman
|
|
|
|
|
It is SHIFT+ENTER in MS Word
|
|
|
|
|
Is your RichEditCtrl a control in a CDialog or a CRichEditView? As a control you will need to use PreTranslateMessage() to trap the shift+enter keys (VK_SHIFT, VK_RETURN) or the dialog will close via the default button (usually CDialog::OnOK()).
<code>BOOL CSampleControl::PreTranslateMessage(LPMSG lpmsg)
{
BOOL bHandleNow = FALSE;
switch (lpmsg->message)
{
case WM_KEYDOWN:
switch (lpmsg->wParam)
{
case VK_UP:
case VK_DOWN:
case VK_LEFT:
case VK_RIGHT:
bHandleNow = TRUE;
break;
}
if (bHandleNow)
OnKeyDown(lpmsg->wParam, LOWORD(lpmsg
->lParam), HIWORD(lpmsg->lParam));
break;
}
return bHandleNow;
}
</code> - Source: MSDN Help Documentation. In a CRichEditView class the RichEditCtrl will respond to a SHIFT+VK_RETURN keyboard event and insert a soft carriage return (\par). If you hit the enter key (VK_RETURN event), it inserts a hard return (\par\par). This is, if your document class serializes as richtext.
CRichEditDoc::m_bRTF = TRUE; If you are serializing as text then you can insert a newline character with
GetRichEditCtrl().ReplaceSel("\n"); In both cases of serialization the RichEditCtrl responds to the (SHIFT+ENTER)keyboard event the same.
Post a litle more info on what you are trying to do.
Mark
|
|
|
|
|
myself and one of my friend develop one simple project. project include one server and many client. use socket at both ends. one socket for server side and one socket at client side. write Create(), Listen(), Send(), Bind(), Receive() kind of basic functions. Establish connection between server and client. perform some basic operations on client from console side. I want to know if same project is rebuild using some other techniques or concepts which are present in networking field. how we can develop this entire project better way. or if you suggest good topic for networking project kindly give me a reply.
Regards
kedar
|
|
|
|
|
well if i am to code a project on net. then i'll go for SMTP server( it can be a smtp server for newsletter kind od app)or FTP server or something similar to it.
|
|
|
|
|
vcforums wrote: if you suggest good topic for networking project kindly give me a reply.
What about making NETWORK ShutDowner
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi All,
I have been using CString for years and was very much comfortable with it.
Now i am using STL's string.
while debugging i am not able to get the value of a string variable.it shows the address and not the value(string::c_str).
if it was a CString variable, just by putting the variable in the Quick Watch i was able to see its contents.
How do i get the value of a string variable during debugging ?
Thanks in advance
|
|
|
|
|
It almost sounds like you need to add an entry to your autoexp.dat file. You'd see the same thing with CString if it weren't for that file.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi David,,
I'd be very interested to know what you exactely mean with your answer. I thought there was no (easy) way to see the content of stl strings while debugging... What is autoexp.dat ?
~RaGE();
|
|
|
|
|
Rage wrote: I thought there was no (easy) way to see the content of stl strings while debugging
I don't use STL, so that may very well be the case.
Rage wrote: What is autoexp.dat ?
It's a file located in the C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin folder. There is a good description at the top of it.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
It's a file located in the C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin folder. There is a good description at the top of it.
This is very interesting, thank you David, for the explanation.
~RaGE();
|
|
|
|
|
Could this be of any help :
Article[^]
~RaGE();
|
|
|
|
|
How to open a default fil by using the CFileDialog class
I open the dialog box like this .
I want to keep one file as default selection
CFileDialog dlg(TRUE,"bmp",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,"Only BMP (*.bmp)|*.bmp|");
dlg.DoModal ();
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Use
<br />
dlg.m_ofn.lpstrFile=TEXT("DefaultFile.xxx");<br />
before DoModal()
Have a nice code day
|
|
|
|
|
I need to open a file named "1.bmp" located as "c:\1.bmp"
but i get assertion for invalid address
ASSERT(AfxIsValidAddress(m_ofn.lpstrFile, m_ofn.nMaxFile));
My code is somthing like this :--------
CFileDialog dlg(TRUE,"bmp",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,"Only BMP (*.bmp)|*.bmp|");<br />
<br />
dlg.m_ofn.lpstrFile=TEXT("c:\\1.bmp");<br />
<br />
dlg.DoModal ();
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
sorry (error),
now try with this:
<br />
TCHAR str[100]=TEXT("c:\\1.bmp");<br />
dlg.m_ofn.lpstrFile=str;<br />
Have a nice code day
|
|
|
|
|
sorry there is some problem in the given code also
some assertion at
ASSERT(m_hFile != (UINT)hFileNull);
I thing will have to go through the sturctre method
i found some links will try from it
http://eatworms.swmed.edu/~boris/B_Player/VideoWnd.cpp
http://www.codeproject.com/dialog/remove_filters.asp
Why simpe things are done so complicated in VC++
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I don't know, it is strange!
A good thing could be add the flag OFN_FILEMUSTEXIST here:
CFileDialog dlg(TRUE,"bmp",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,"Only BMP (*.bmp)|*.bmp|");
So you are sure that the file exist.
And I don't like very much
...,"Only BMP (*.bmp)|*.bmp|"
I prefere
...,"Only BMP (*.bmp)|*.bmp||"
Let me know
Have a nice code day
|
|
|
|
|
I will have to get the exact error if u have tested the code
so u might be right ,
can be some error in my code .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
_Russell_ wrote: dlg.m_ofn.lpstrFile=str;
If lpstrFile is assigned a non-NULL value, so must nMaxFile also be used to indicate the size of the buffer pointed to by lpstrFile .
Why do it this way, however, when the constructor already has provisions for such?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
vikas amin wrote: How to open a default fil by using the CFileDialog class
That is what the third parameter of CFileDialog 's constructor is for.
vikas amin wrote: I need to open a file named "1.bmp" located as "c:\1.bmp"
Then why bother with CFileDialog if you already know the name of the file?
Also, the filter should end with two ‘|’ characters.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
yep if he knows filename & location then why he is using CFileDialog .
well i guess he wants to show his skills here.;)
|
|
|
|
|
vikas amin wrote:
I need to open a file named "1.bmp" located as "c:\1.bmp"
Then why bother with CFileDialog if you already know the name of the file?
Yeh good qestion , i need this only for Testing purpose &
when i cannot reach some thing in coding
it makes me crazy to get it done .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
please tell me what's a callback function?
i've read it many times but i'm understanding it. whats the differnce between CallBack function and a normal function. please dont give a link. which i'm not going to understand. instead explain me.. with a little example. pleeeeeez
regards,
Rookie
Installing MFC...2% complete
|
|
|
|
|
A callback function is a normal function that the system calls when comes specified events.
An event could be a mouse click, or a tollbar botton click, ....
To link the event to the function it is used the MESSAGE_MAP
(usually in this macros are used the IDs of the objects that the user is using)
is it OK?
Have a nice code day
|
|
|
|