|
I believe you to change the Setup/Initialization of the Port. Compare every single value. There are some samples at CP try different to get it work.
Have you tried to write in loops???
//Meta-Code
while( DataToSend() )
{
Send16Bytes();
}
GetLastError() is also your friend!!!
Serial Port is a legacy problem so not so many know how to handle.
Greetings from Germany
|
|
|
|
|
We can execute a program by CreateProcess function,
but how can we limit the memory used by that program
(i.e. stop the program if it uses too much memory)?
|
|
|
|
|
You could limit the stack and heap sizes for the application, or even write your own memory manager for it.
Darka [ Xanya]
"When you're taught to love everyone, to love your enemies, then what value does that place on love?"
|
|
|
|
|
hi all i had made a service that beeps after a specified time interval.now i want that this service should be depend upon the some other services like RPC so that user cannot turn it off.
or like RPC service whose stop button does not work or is disabled.
Tasleem Arif
|
|
|
|
|
You cannot prevent them stopping your service this way, try handling SERVICE_CONTROL_STOP and not shutting down although I suspect Windows will just terminate your service as it will detect its failure to shut down.
why do this, I couldn't think of anything more annoying than a beeping service, especially one you cannot stop.
If the Service runs in the local system account, then ordinary users cannot stop it anyway as they do not have the correct permissons.
regards,
Darka [ Xanya]
"When you're taught to love everyone, to love your enemies, then what value does that place on love?"
|
|
|
|
|
i will make another application rather then simple beep.thanks for the answer i will try to implement it and tell the result of that.
Tasleem Arif
|
|
|
|
|
hi what i did is the remove all code from event handler function of the service and it works fine.
Tasleem Arif
|
|
|
|
|
cool
Darka [ Xanya]
"When you're taught to love everyone, to love your enemies, then what value does that place on love?"
|
|
|
|
|
Hi All,
i have one question related with CRichEditCtrl.
How can we identify the word underlying he mouse pointer?
means if i have some text in richedit.
1) programming window's is not easy.
2) Subclassing is tec*hnique by which you can process the messages
before the controll processes it.
* word is where mouse pointer is.
i want to get that word means i need to get the technique word when
mouse pointer is on it!!
how can i achieve this?
any help will be appreciated
Thanks and Regards
Harshal
|
|
|
|
|
CRichEditCtrl::CharFromPos()..?
nave
|
|
|
|
|
harsha_1234 wrote: identify the word underlying the mouse pointer
You will have to subclass the CRichEditCtrl.
Here is what I did in the MouseMove message. Just a crude idea on how you could proceed with this.
int i=CharFromPos(point);
SetSel (i,i+3);
char *mySel=new char[100];
GetSelText (mySel);
AfxMessageBox(mySel);
delete[] mySel;
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
i alway's get error that
error C2065: 'CharFromPos' : undeclared identifier
i mean CharFromPos is member msdn show's in that way
but it gives error
|
|
|
|
|
Did you subclass the richeditControl?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
int i = SendMessage(EM_CHARFROMPOS,0,LPARAM(&point));
SetSel (i,i+3);
char *mySel=new char[100];
GetSelText (mySel);
//AfxMessageBox(mySel);
delete[] mySel;
this is working fine
actually in sendmessage LPARAM requires the address of point structure
Thanks now i can proceed
|
|
|
|
|
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
|
|
|
|