|
Hi WhiteSky,
i want to highlight the word during text tranfer from file to rich edit box,i have no options of using another dialog for finding the text..
can u please tell me how to find the word and highlight it..
Regards,
Vinay Charan.
|
|
|
|
|
Hi Vinay Try Using FindText,
Here is a sample code,
CRichEditCtrl* pmyRichEditCtrl;<br />
LPCTSTR lpszmyString;<br />
<br />
FINDTEXTEX ft;<br />
ft.chrg.cpMin = 0;<br />
ft.chrg.cpMax = -1;<br />
ft.lpstrText = (LPSTR) lpszmyString;<br />
long n = pmyRichEditCtrl->FindText(FR_MATCHCASE|FR_WHOLEWORD, &ft);<br />
if (n != -1)<br />
pmyRichEditCtrl->SetSel(ft.chrgText);
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Hello.
I need help. I wanted to close a port using a port number. Is this possible?
If yes, could anyone inform me how?
Thanks.
Alex
|
|
|
|
|
Inorder to close the Port, u need to close the handle of the Port,that u get from CreateFile.
hPort = CreateFile(..........);
for closing this,
if(hPort != NULL)<br />
CloseHandle(hPort);
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
NiceNaidu wrote: for closing this,
if(hPort != NULL)
CloseHandle(hPort);
You cannot close the port by this method, if port is open by another application!
"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
Help CRY
|
|
|
|
|
Now, my project splittered 3 pane as Visual C++ 6.0
Use class ST_SplitterWnd
First pView1 is Dialog for Bandroll
and pView2 is splitter 2 pane: included: CView1 and CView2.
In CView1 has a dialog that has a TreeCtrl.
I can't control the tree to open a file in CView2.
Pls hep me as soon as.
Thank alot
-- modified at 4:36 Thursday 25th May, 2006
|
|
|
|
|
What is the control u r using in CView2 ??
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
|
|
Now, I get a file name when dounbleClick on Tree. But I can't get GetPane() of CView to view a file.
|
|
|
|
|
|
Thank you so much!
Good luck for you
|
|
|
|
|
std::list<WSABUF*> m_ListBuf;
m_ListBuf.push_back(pWsabuf); // error, why?
-- modified at 4:03 Thursday 25th May, 2006
|
|
|
|
|
|
the error is at:
iterator insert(iterator _P, const _Ty& _X = _Ty())
{_Nodeptr _S = _P._Mynode();
--> _Acc::_Prev(_S) = _Buynode(_S, _Acc::_Prev(_S));
_S = _Acc::_Prev(_S);
_Acc::_Next(_Acc::_Prev(_S)) = _S;
allocator.construct(&_Acc::_Value(_S), _X);
++_Size;
return (iterator(_S)); }
I declare it in a class
class PerIOData : public OVERLAPPED
{
public:
int m_Operation;
SOCKET m_Socket;
WSABUF *m_pBuf;
int m_BufNum;
int m_NextStart; std::list<wsabuf*> m_ListBuf;
};
use like this, in a thread:
PerIOData *p=new PerIOData
...
p->m_pBuf=new WSABUF;
p->m_pBuf->len=128;
p->m_pBuf->buf=new char[128];
when data is received through IOCP:
p->m_ListBuf.push_back(p->m_pBuf);
|
|
|
|
|
It's my bug.
I write:
memset(p,0,sizeof(*p));
which overwrite the list member. Too careless.
|
|
|
|
|
i have tried with the sample snippet. its working fine for me. check for the error code using GetLastError
std::list<wsabuf*> m_ListBuf;
WSABUF* pWsabuf = new WSABUF;
m_ListBuf.push_back(pWsabuf);
SaRath
|
|
|
|
|
I declare it in a class
class PerIOData : public OVERLAPPED
{
public:
int m_Operation;
SOCKET m_Socket;
WSABUF *m_pBuf;
int m_BufNum;
int m_NextStart; std::list<WSABUF*> m_ListBuf;
};
|
|
|
|
|
It's my bug.
I write:
memset(p,0,sizeof(*p));
which overwrite the list member. Too careless.
|
|
|
|
|
wow, you write for all
this code has one bug or no
std::list<wsabuf> m_ListBuf;
CAnswer *p=new CAnswer;
memset(p,0,sizeof(*p));
p=this;
p->m_pBuf=new WSABUF;
p->m_pBuf->len=128;
p->m_pBuf->buf=new char[128];
p->m_ListBuf.push_back(p->m_pBuf);
whitesky
|
|
|
|
|
I used a wrong memset.
Thank you.
|
|
|
|
|
As said above,
WSABUF* pWsabuf = new WSABUF is necessary.
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
I declare it in a class
class PerIOData : public OVERLAPPED
{
public:
int m_Operation;
SOCKET m_Socket;
WSABUF *m_pBuf;
int m_BufNum;
int m_NextStart; std::list<wsabuf*> m_ListBuf;
};
use like this, in a thread:
PerIOData *p=new PerIOData
...
p->m_pBuf=new WSABUF;
p->m_pBuf->len=128;
p->m_pBuf->buf=new char[128];
when data is received through IOCP:
p->m_ListBuf.push_back(p->m_pBuf);
|
|
|
|
|
followait wrote: p->m_pBuf->len=128;
p->m_pBuf->buf=new char[128];
These are the only two things you have inside WSABUF? can you please display the structure of WSABUF ?
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
I dont think that new -ing that pointer is necessary.
List will keep whatever the value we are passing in the type specified as template argument.
he may be bugging with some other issues
SaRath
|
|
|
|