|
|
Hi,
does anyone have some idea, how to make some TCP network transfer in separate thread (open connection, send/receive some data, close connection, end thread) using WinSock 1.1, so that i can immediately stop thread from parent thread anytime ?
|
|
|
|
|
One approach is this: launch a thread provided with a message pump, and use message-based asynchronous sockets (see WSAAsyncSelect for further info). This thread can be stopped at any time with PostQuitMessage .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Actually the problem is very small . I am using DrawText function . and i want to display the font ac per the system setting so please if anybody can help me wating for the reply.
|
|
|
|
|
Hi,
this link may help you: http://www.ucancode.net/
It shows the advance gdi and font features you like. The client may interest you.
Regards
jack
|
|
|
|
|
Hello,
I want to do drop file support for my window.
But I'm not able to identify if file(s)
droped on it was drag "with right or left mouse button".
(I would like to do popup menu in case of right button)
Is there any way how to solve it?
Thank you.
V. Dolinay
|
|
|
|
|
From MSDN ,
HRESULT DragEnter(
IDataObject * pDataObject,
//Pointer to the interface of the source data
// object
DWORD grfKeyState, //Current state of keyboard modifier keys
POINTL pt, //Current cursor coordinates
DWORD * pdwEffect //Pointer to the effect of the drag-and-drop
// operation
);
grfKeyState
[in] Current state of the keyboard modifier keys on the keyboard. Valid values can be a combination of any of the flags MK_CONTROL, MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON, and MK_RBUTTON
So as u can see you can test for the mouse button being pressed by anding
//left button
if( grfKeyState & MK_LBUTTON )
{
//Do for left button
}
if( grfKeyState & MK_RBUTTON )
{
//Do processing for right button
}
|
|
|
|
|
Thank you.
That was what I was looking for.
V.Dolinay
|
|
|
|
|
hi,
I am a new socket programmer, I know that socket allow sending buffer of char by send(), if I wont to send a struct or whole class, how I do it?I wish do it by basic socket, then by MFC class.
in reality, I have an application that I would make it work on network, it is installed one several machine , one machine ( the master) send to the others data (object, commend)and the result is sent to this machine,
thanks.
|
|
|
|
|
You can send() your struct/class as raw bytes. sizeof will tell you how many bytes. And at the other side you must recv() that many number of bytes into a pointer to your struct/class cast to a byte *
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
thanks,
If my struct is:
struct X{
int..;
char*..;
..
};
struct X Y;
and I woul send Y by send(),how i send it as raw bytes, i cast it: send(socket,(byte *)Y,sizeof(Y),0)?
and wen I received it I will recost it:
....
int i=recv(socket,buf,..)
struct X* pX;
pX=(struct X*)buf;
...?
|
|
|
|
|
That should work BUT ONLY IF your struct DOES NOT HAVE ANY pointer members. In your case you seem to have a char*. Replace char* with a char[].
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Hello
I would like my database app to be able to store files... is this easy to do via CRecordset class.
Any tips would be nice.
Best regards
Henrik
|
|
|
|
|
Read the file and store it as a string in database and store its extenstion in another record.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
What kind of datatype do you use in the SQL Server then ??
regards
Henrik
|
|
|
|
|
It depends on the type of file, for a plain text file i'd use MEMO or TEXT, if it was a binary file your best bet would be BLOB or BINARY.
I'm not sure if these are the MS SQL Server types or one of the many other DB's i've used
|
|
|
|
|
Thank's
I shall try this tonight.. hopefully you will not be hearing from me again
|
|
|
|
|
How to populate MS flex grid with some recordset?
// This is the problem
m_cFlex.SetDataSource(LPDISPATCH(pRst));
Flex grid give me a message "Type mismatch". Anyone know why? What I need to write here?
pRst is variable ADOCG::_RecordsetPtr pRst;
|
|
|
|
|
Hello all,
I am working at a MFC application and I am using the STL containers also. The problem is that I am trying to use valarray and when I include
[pre]
#include <valarray>
[/pre]
I get all sorts of compiling errors
[pre]
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(104) : warning C4003: not enough actual parameters for macro 'min'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(110) : warning C4003: not enough actual parameters for macro 'max'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(104) : error C2059: syntax error : 'function-style cast'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(167) : see reference to class template instantiation 'std::valarray<_Ty>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(104) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(167) : see reference to class template instantiation 'std::valarray<_Ty>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(109) : error C2143: syntax error : missing ')' before '}'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(167) : see reference to class template instantiation 'std::valarray<_Ty>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(109) : error C2059: syntax error : ')'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(167) : see reference to class template instantiation 'std::valarray<_Ty>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(109) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(167) : see reference to class template instantiation 'std::valarray<_Ty>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(109) : error C2238: unexpected token(s) preceding ';'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(167) : see reference to class template instantiation 'std::valarray<_Ty>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(110) : error C2146: syntax error : missing ';' before identifier '_Ty'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(167) : see reference to class template instantiation 'std::valarray<_Ty>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(104) : error C2629: unexpected 'unsigned int ('
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(648) : see reference to class template instantiation 'std::valarray<unsigned int="">' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(104) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(648) : see reference to class template instantiation 'std::valarray<unsigned int="">' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(109) : error C2143: syntax error : missing ')' before '}'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(648) : see reference to class template instantiation 'std::valarray<unsigned int="">' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(109) : error C2059: syntax error : ')'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(648) : see reference to class template instantiation 'std::valarray<unsigned int="">' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(110) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(648) : see reference to class template instantiation 'std::valarray<unsigned int="">' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(115) : error C2143: syntax error : missing ')' before '}'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(648) : see reference to class template instantiation 'std::valarray<unsigned int="">' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(115) : error C2059: syntax error : ')'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(648) : see reference to class template instantiation 'std::valarray<unsigned int="">' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(115) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(648) : see reference to class template instantiation 'std::valarray<unsigned int="">' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(115) : error C2238: unexpected token(s) preceding ';'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(648) : see reference to class template instantiation 'std::valarray<unsigned int="">' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(116) : error C2146: syntax error : missing ';' before identifier 'valarray'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(648) : see reference to class template instantiation 'std::valarray<unsigned int="">' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(104) : error C2629: unexpected 'bool ('
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(754) : see reference to class template instantiation 'std::valarray<bool>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(756) : see reference to class template instantiation 'std::mask_array<_Ty>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(104) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(754) : see reference to class template instantiation 'std::valarray<bool>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(756) : see reference to class template instantiation 'std::mask_array<_Ty>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(109) : error C2143: syntax error : missing ')' before '}'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(754) : see reference to class template instantiation 'std::valarray<bool>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(756) : see reference to class template instantiation 'std::mask_array<_Ty>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(109) : error C2059: syntax error : ')'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(754) : see reference to class template instantiation 'std::valarray<bool>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(756) : see reference to class template instantiation 'std::mask_array<_Ty>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(109) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(754) : see reference to class template instantiation 'std::valarray<bool>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(756) : see reference to class template instantiation 'std::mask_array<_Ty>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(109) : error C2238: unexpected token(s) preceding ';'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(754) : see reference to class template instantiation 'std::valarray<bool>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(756) : see reference to class template instantiation 'std::mask_array<_Ty>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(110) : error C2146: syntax error : missing ';' before identifier '_Ty'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(754) : see reference to class template instantiation 'std::valarray<bool>' being compiled
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\valarray(756) : see reference to class template instantiation 'std::mask_array<_Ty>' being compiled
Error executing cl.exe.
[/pre]
However it compiles fine in a Console App.
Anybody have an idea?
Best regards,
Alexandru Savescu
|
|
|
|
|
Include valarray like this:
#undef min
#undef max
#include <valarray> The problem stems from some pesky min and max macros defined in windef.h that interfere with valarray::min and valarray::max .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thank you Joaquin, apparently they fixed this in VC 7.0
Best regards,
Alexandru Savescu
|
|
|
|
|
Does anybody know how to access Ports in Windows NT?
|
|
|
|
|
What kind of ports? Message ports?
Now that we've taken care of the educational bit (be precise), I assume you want to access some I/O port (serial, parallel, ...).
You talk to (or even write yourself) a device driver. Try searching Google for something like "Windows NT direct I/O".
|
|
|
|
|
Anyone know how to disable the list control from automatically displaying a vertical scroll bar when there are too many items to display?
I tried the LVS_NOSCROLL style but this disables scrolling entirely. I just want to get rid of the visual scroll bars but still have the ability to scroll the list control (I am using another method to scroll it as the program is designed to run on a touch-screen PC and the default scroll bars are to small to use).
|
|
|
|
|
I don't have a sure-shot answer for you, but I took a look at the CWnd class and noticed that it has a couple of functions you might wanna try: ShowScrollBar and EnableScrollBarCtrl .
Regards,
Alvaro
Insanity: doing the same thing over and over again and expecting different results. - Albert Einstein
|
|
|
|