|
if char buff[]={'a','b',0x00,'c','d','e',0x02,0x03,0x00,'g'}
strlen(buff)+1=3
but I need to send 10 char.So I think strlen is not right in this case.
|
|
|
|
|
strlen(buff) +1;
That will include the NULL character.
|
|
|
|
|
If your buffer is initialized at declaration, like this:
char buffer[] = {'a', 'b', 0x00, 'c', 'd', 0};
then you can use sizeof(buffer) expression to count the size.
Otherwise, if the buffer is built dynamically, I think you have to have a counter of values added to buffer. After each addition, update that counter. Then use it before sending.
It is easier to work with dynamic arrays using std::vector class from STL.
If your problem is caused by Unicode strings that may contain null bytes, then instead of strlen function use wcslen and then multiply the result with two before sending.
|
|
|
|
|
send me as early as possible
#sankar#
|
|
|
|
|
sankarRao wrote: send me as early as possible
Be polite while asking Questions my dear friend.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
plz send me as early as possible
#sankar#
|
|
|
|
|
|
thanque and sorry
#sankar#
|
|
|
|
|
|
|
We know how to take window to foreground (SetForegroundWindow())
But how can I push the window to background and let the window which is under our application's window cover our application window?
Row
|
|
|
|
|
If you known wich window is under your window, that call SetForegroundWindow for that window.
Otherwise, may be minimizing your window with ShowWindow(SW_MINIMIZE) is satisfactory?
|
|
|
|
|
ROWALI wrote: We know how to take window to foreground (SetForegroundWindow())
But how can I push the window to background and let the window which is under our application's window cover our application window?
use SetWindowPos with wndTop for the background window.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hello
An idea is to use EnumWindows() to enumerate all top level windows, then push them all forward.
|
|
|
|
|
exactly.
-- modified at 8:37 Monday 19th June, 2006
Sorry I checked .. No use
|
|
|
|
|
Why would you want to do this? If I am typing in some program and all of a sudden the windows started changing their z-order, that's not going to make me very happy.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Basically what I want is I am copying from background window to my application few text data. WHn I want to cut the data from background window I need to switch to it I want to do it with mouse, if mouse goes to title area immediatly my background application come forward. I will copy the etxt and paste to my application. problem is I can get the effect by ShowWindow(SW_MINIMIZE) but then i can see the window going to left bottom corner visibly. which is irritating on slow machines.
-- modified at 8:49 Monday 19th June, 2006
|
|
|
|
|
|
|
Try this:
CWnd * wnd = ....;
HWND hwnd = *wnd;
HWND hwnd = wnd->m_hWnd;
|
|
|
|
|
Viorel. wrote: HWND hwnd = *wnd
Does this really work ? Never seen it before...
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Rage wrote: Does this really work?
Yes, it works thanks to a cast operator within CWnd : "operator HWND() const; ".
|
|
|
|
|
CWnd* pMyCwnd = new CWnd();
pMyCwnd->m_hWnd // This is the HWND of CWnd class
Too many plans make the health badly!!
|
|
|
|
|
you can use if you have a CWnd from m_hWnd
---------------
HWND hWnd=this->m_hWnd;
whitesky
|
|
|
|
|