|
m_ClientSocket.Send((LPVOID)msg,sizeof(msg)); You should use sizeof(sMsg) or sizeof(*msg), or you will send/receive only 4 first bytes of your message.
|
|
|
|
|
sizeof(msg) returns 4 which is the size of the pointer, instead you should use sizeof(sMsg)
BTW, is it possible to send binary data through a socket connection. I thought it was a text_only_thing
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
There's really no difference between "text" and "binary data", both are simply a stream of bytes. Sockets don't care about the bytes you send. It's true that most Internet protocols are text-based, but that's for interoperability of different computer architectures (no byte ordering or word length problems)
|
|
|
|
|
Is there any message fired when an application looses the focus by Alt+Tab and gets back the focus?
I have an application which has a modal dialog.
I need to call one function from the dialog when my application gets back focus after switching to another application (say Notepad) and comes back ro mine.
Can anybody help?
|
|
|
|
|
|
Is there any message fired when an application looses the focus by Alt+Tab and gets back the focus?
I have an application which has a modal dialog.
I need to call one function from the dialog when my application gets back focus after switching to another application (say Notepad) and comes back ro mine.
Can anybody help?
|
|
|
|
|
How to Maximize a Dialog Based Program But not Covering the Task Bar?
I use the statement "SetWindowPos(&wndTop, 0, 0, 800, 600, 0)" or the statement "ShowWindow(SW_SHOWMAXIMIZED)" ; But the dialog based program still covers the task bar. Why?
Thanks
|
|
|
|
|
1. Right click on your taskbar, select properties, and check the "Always on top" item.
2. Use ShowWindow(SW_SHOWMAXIMIZED);.
3. All sorted
|
|
|
|
|
Programmatically, you can find out the size and position of the taskbar with the following:
// Find the taskbar
HWND hWndTaskbar = FindWindow("Shell_TrayWnd", NULL);
RECT rc = {0,0,0,0};
::GetWindowRect(hWndTaskbar, &rc);
Then just work around it.
|
|
|
|
|
I have a question, that is, how to show a window maximized but not covering the task bar.
|
|
|
|
|
ShowWindow ( hwndYourWindow, SW_MAXIMIZE );
--Mike--
http://home.inreach.com/mdunn/
A recent survey reports that 1/4 of all internet users in England surf for porn.
The other 3/4 just didn't want to admit it.
|
|
|
|
|
I'm having a terrible time with the date and time picker control. I 'm using the "Microsoft Date and Time Picker Control, version 6.0" which created dtpicker.h for me, but maybe there's a better way to go about this, because I can find no documentation for it anywhere.
Life is quite ironic because I figured out my problem just now as I was writing this email. But my solution isn't very elegant. I was just wondering if anyone could provide me with a good place to get some information on this class.
Right now I don't know how to properly initialize the VARIANT variable that I pass to:
void CDTPicker::SetMinute(const VARIANT& newValue)
(This is just an example the other "Set" functions are equally thwarting.)
So I'm cheating by calling GetMinute() first to set the value, which I then change slightly. But I would appreciate it if someone could tell me what I would need to do to avoid this hack.
Thank you
-john
|
|
|
|
|
Why are you using ActiveX control? CDateTimeCtrl doesn't expose some functionality?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have the feeling that the answer is, "Because I am a beginer and don't know quite what I'm doing." I'm using VC 5, and I couldn't figure out how to put a CDateTimeCtrl into my project so I used the ActiveX control since that's the only thing that I could figure out how to put into my dialog. Any advice on how to mend the error of my ways would be appreciated.
-john
|
|
|
|
|
HI Folks
I am writing an application which receives traps from different network devices and the output is in the form of predefined data structure, and the application receives traps continously it is a NT Service.
Now i want to send this output to the other application as input using a Message Queue concept can any one help me in this regard ASAP.
Any kind of help is appreciated
Thanks in Advance
Sudheer
sudheer reddy bandaru
|
|
|
|
|
You want to use WM_COPYDATA.
|
|
|
|
|
How do I enable this for Control Variables. ie m_ctlControl. It worked on my last install but I had to reinstall Windows and now it doesn't work. Can anyone help me this is a pain in the a**.
-Matt Newman
|
|
|
|
|
Hy!
I have deleted the files *.clw and *.aps in my project folder adn it work. This files are automaticly rebuil by IDE ( the clw file is generated when you first acces ClassWizard ... just selcet there all the classe in your project )
Bye,
BogdanO
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
I think it's enough to delete XXX.ncb file
Jerzy
|
|
|
|
|
I guess i should do this with all of those files b\c of transferring from CD to HD. I should of thought of this earlier. Oh well thanks for the help.
-Matt Newman
|
|
|
|
|
Now tell me this why does a LineScroll(1) for a rich edit control work in win2000 and not in me. In win2000 it actually scrolls down but in winMe it just stays on the same line when i insert text.
|
|
|
|
|
Is there a way to get an edit control to right justify? Setting the property to right justify doens't seem to have any effect.
Thanks.
Richard
|
|
|
|
|
Check out this page, it should help you out.
There's a section on "Algning Controls"
http://www.codeproject.com/miscctrl/usingctrlsindialogs.asp
good luck
-john
|
|
|
|
|
Is there a better way to search an ODBC table for a particular record than to iterate through the table?
Thanks.
Richard
|
|
|
|
|
Try to put a WHERE clause in your SELECT statement like this :
SELECT * FROM table WHERE name='whatEver';
This way you will have only the records that interest you.
Bye,
BogdanO
...the night is long ... but not long enought to do some real coding ...
|
|
|
|