473,385 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Problems with EM_GETLINE for RichEdit

I am developing a word processor using MS Vis C++ 6 with MFC.

I need to get the text of the current line of where the cursor is. I am
using richedit (not a control).

Does the EM_GETLINE work when not used with a control? i.e. when RichEdit
is the document view.

I've got the following syntax :

CVIProDoc* pDoc = GetDocument(); //pointer to the
document
int iLineNo = 0;
//will be updated on cursor move, 0 for test purposes
LPCTSTR lpszText; //hopefully
the resultant text
long lResult;
lResult = SendMessage( *pDoc, EM_GETLINE, iLineNo, lpszText);

I keep getting the error "error C2660: 'SendMessageA' : function does not
take 4 parameters".

any ideas what i'm doing wrong? any help would be much appreciated.

-peter
Jul 23 '05 #1
1 3985
* Peter Taylor:
[off-topic in clc++]


Don't cross-post off-topic stuff to clc++, please.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: murlbrown | last post by:
I am using a class library built by michael kennedy that creates a system wide hook on the WH_KEYBOARD_LL, but I wanted to changed it to become a hook for a RichEdit box in another application. ...
3
by: ozbear | last post by:
The title says it all. Since a Richedit control doesn't understand a backspace character ('\b', or 0x08) when I receive one I need to programmatically delete the last character from the Richedit...
1
by: P | last post by:
Hi. I am writting application and I need html richedit. When I will use: control_name.text="<img sroc=\"1.jpg\">" I wanna have image in richedit. But I dont know where can I find that...
0
by: PowerPlane | last post by:
Hi, all Happy valentine I am struggling to insert an animated-gif into a CRichEditCtrl. Before I post this question here, I did some googling. And I found an article to introduce how to insert a...
1
by: Patty O'Dors | last post by:
Hi I'm trying to create an application with a RichEdit control, I found that CreateWindow always returns a null hWnd unless I call LoadLibrary("riched20.dll") first (the error code from...
10
by: Patty O'Dors | last post by:
Hi In trying to create a RICHEDIT-derived ActiveX control in ATL, I've managed to successfully implement the stock font property, thanks for all your help on this. I'm now stuck on receiving...
0
by: murlbrown | last post by:
I am using a class library built by michael kennedy that creates a system wide hook on the WH_KEYBOARD_LL, but I wanted to changed it to become a hook for a RichEdit box in another application. ...
4
by: Brian | last post by:
I used SendMessage to get the line count of a multiline textbox, since it recognizes word wrap as a new line (and not only crlf). But with EM_GETLINE it needs a pointer to a buffer for the lparam....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.