|
How do you use CharFromPos its in CRichEditCtrl and in this error it seems you dont use from CRichEditCtrl
|
|
|
|
|
i will give you class definition
class CMyRichEdit : public CRichEditCtrl
{
// Construction
public:
CMyRichEdit();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyRichEdit)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMyRichEdit();
// Generated message map functions
protected:
//{{AFX_MSG(CMyRichEdit)
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnChange();
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
void CMyRichEdit::OnMouseMove(UINT nFlags, CPoint point)
{
//int i=CharFromPos(point);// gives error
int i = SendMessage(EM_CHARFROMPOS,0,MAKELPARAM(point.x,point.y));
SetSel (i,i+3);
char *mySel=new char[100];
GetSelText (mySel);
AfxMessageBox(mySel);
delete[] mySel;
CRichEditCtrl::OnMouseMove(nFlags, point);
}
both fails
|
|
|
|
|
I dont have any error with this code
<br />
class CMyRichEdit : public CRichEditCtrl<br />
{<br />
public:<br />
CMyRichEdit();<br />
<br />
public:<br />
<br />
public:<br />
<br />
<br />
public:<br />
virtual ~CMyRichEdit();<br />
<br />
protected:<br />
afx_msg void OnMouseMove(UINT nFlags, CPoint point);<br />
<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
CMyRichEdit::CMyRichEdit()
{
}
CMyRichEdit::~CMyRichEdit()
{
}
BEGIN_MESSAGE_MAP(CMyRichEdit, CRichEditCtrl)
END_MESSAGE_MAP()
void CMyRichEdit::OnMouseMove(UINT nFlags, CPoint point)
{
int i=CharFromPos(point);
i = SendMessage(EM_CHARFROMPOS,0,MAKELPARAM(point.x,point.y));
SetSel (i,i+3);
char *mySel=new char[100];
GetSelText (mySel);
AfxMessageBox(mySel);
delete[] mySel;
CRichEditCtrl::OnMouseMove(nFlags, point);
}
|
|
|
|
|
i am getting error compile time error
i am using visual studio 6.0
deriving from CRichEditCtrl and getting the error.
but SendMessage is working fine
int index = SendMessage(EM_CHARFROMPOS,0,LPARAM(&point));
here i am getting the index
Why like this
|
|
|
|
|
I dont have VS6 i use VS2003 and its working.
|
|
|
|
|
harsha_1234 wrote: Why like this
IMHO,
When we have do this on .NET platform(VC7.0) we use the RichEditControl2.0 and when using VS6.0 RichEditControl.
CharFromPos() is defined for RichEditControl2.0 and not for RichEditControl.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
no actually i am handling the mouse move message
and in that i get the point.
so i am trying the API.
why do i will need subclassing in this scenario?
Thanks
Harshal
|
|
|
|
|
Hi,
I need to write the program that can streaming the frame buffers over network and play again when received at client program.
in Java we hav RTP (Real-Time Transport Protocol) for doing real time streaming and JMF for playing.
But in C++ I don't know how we do a real time streaming video.
Please help me!
Thank in advance!
|
|
|
|
|
You can use RTP in C++ although you will have to write it yourself or find a free or open source library to do it for you.
Darka [ Xanya]
"When you're taught to love everyone, to love your enemies, then what value does that place on love?"
|
|
|
|
|
Guys,
Is there any win32api to get the day of the week.
I had gone thru some date api's which sppeks abt the month,date and time.
I need to check the system date for a particular day of the week.
like if the day of week is satuarday /sunday a particular process need to be run to make sure that no one will be able to log into the system.
Thanks,
kk_mfc
|
|
|
|
|
kk_mfc wrote: I need to check the system date for a particular day of the week.
like if the day of week is satuarday /sunday
Use GetSystemTime(..) as below,
SYSTEMTIME SytemTime;
GetSystemTime(&SystemTime);
SystemTime.wDayOfWeek will slovw your problem...
Refer here for more details about SYSTEMTIME structure[^]
Do your Duty and Don't expect the Result
|
|
|
|
|
There's a plethora of ways:
struct tm now;<br />
localtime( &now );<br />
look at now.tm_wday
or
SYSTEMTIME st;<br />
GetSystemTime( &st );<br />
look at st.wDayOfWeek
To name a few.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
|
|
Hi..All..
what is A2W converter, how it is used.
why we write USING_CONVERSION, before using convertors.
Thanq..
sheshidar
|
|
|
|
|
See Here[^]
Do your Duty and Don't expect the Result
|
|
|
|
|
HI I have created an Dll which is 64 bit compatible. When I tried to register it I was prompt with this error:
"%1 is not a valid Win32 application. "
"A winner is not one who never fails...but the one who never quits"
|
|
|
|
|
Did you create a COM object? or a regular DLL ?
Also, are you trying to register it on a 32-bit processor ?
Darka [ Xanya]
"When you're taught to love everyone, to love your enemies, then what value does that place on love?"
|
|
|
|
|
"MQ_ERROR_OPERATION_CANCELLED" this error is being thrown my our application.
Application comprises two threads each having a their own handle to the queue.
We are using Synchronous Call to read,open message from the Queue.
Thanks
for thendral
|
|
|
|
|
How and where I use the SetDate() to set the date on my Date/Time picker?
|
|
|
|
|
tanarnelinistit wrote: SetDate()
used when we Indicate the date components to be copied into COleDateTime object.
dt.SetDate(2006, 7, 28);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I have CTime object not COleDateTime. SO?
|
|
|
|
|
Did you see example SetDate() in MSDN?
|
|
|
|
|
WhiteSky wrote: Did you see example SetDate() in MSDN?
Yes, I saw the example, I solved my problem using GetCurrentTime(). Thanks.
|
|
|
|
|
Hi all.
I want to add a new tool in the tool bar of all my windows. I thing it is possible using VC++.
Any body have an idea abotu this?
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|