|
Shenthil,
If you refer to stop pumping the messages that are sent to you over the network, unless you call Receive or recv, the data is going to stand still until your winsock implementation runs out of network buffer space.
If you refer to message pumping from the window queue as Receive does, this is not desirable because this is intrinsic to the mechanism CSocket uses.
Here at CP in the Internet & Networking section you have plain sockets programming tutorials and classes, and also MFC CSocket derived classes. (Nish has written great tutorials on sockets)
I´m biased but IMHO CSocket misuses resources and adds uneeded complexity.
Hope this helps
Gabriel
Old C programmers never die. They just cast into void
|
|
|
|
|
Thanks Gabriel. Now I've changed the algorithm, but the problem is still unsolved.
Shenthil
|
|
|
|
|
Is your app still crashing? What´s the error? Access violation?
Gabriel
Old C programmers never die. They just cast into void
|
|
|
|
|
I've just changed my application as a peer-to-peer one, instead of supporting multi-clients simultaneously.
shenthil
|
|
|
|
|
I want Disable/Lock keyboard and mouse, but i don`t know how to do it ?
TNX
|
|
|
|
|
Have you looked around codeproject? There are several acticles/totorials that may help you figure out how to do this. Do not ignore the various aticles on user interfaces, many of these use local/systems hooks to accomplish their task.
What you need is to look at the articles/totorials on hooking.
INTP
|
|
|
|
|
I want Disable/Lock keyboard and mouse, but i don`t know how to do it ?
TNX
|
|
|
|
|
please let me know how can i make the program wiondow which cannot be adjusted, moved and closed by the user if I have to use WS_OVERLAPPEDWINDOW parameter in CreateWindowEx(). Initally, the program window should be in largest size.
HRESULT MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_VREDRAW | CS_HREDRAW | CS_NOCLOSE ; // disable the close icon
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_PLANTMONSYS); //IDI_PLANTMONSYS
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = NULL; // Disabled (LPCSTR)IDC_PLANTMONSYS;
wcex.lpszClassName = ClassName;
wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);
return RegisterClassEx(&wcex);
}
//
// FUNCTION: InitInstance(HANDLE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hInst = hInstance; // Store instance handle in our global variable
hWnd = CreateWindowEx(
WS_EX_TOPMOST,
ClassName, /* name of window class */
TEXT("Plant Monitoring System (Final Year Project 2002-2004)"), /* title that shown on the window */
WS_OVERLAPPEDWINDOW | WS_VISIBLE , /* window style - normal // WS_OVERLAPPEDWINDOW | WS_VISIBLE|WS_POPUP no Heading |WS_SYSMENU Menu`*/
CW_USEDEFAULT, /* X coordinate - let Windows to decide */
CW_USEDEFAULT, /* Y coordinate - let Windows to decide */
cxScreen, /* width - let Windows to decide */
cyScreen, /* height - let Windows decide */
NULL, /* no parent window */
NULL, /* no menu */
hInstance, /* handle of this instance of the program */
NULL /* no additional arguments */
);
if (!hWnd)
{
return FALSE;
}
ShowWindow(hWnd, SW_MAXIMIZE ); // max size ,nCmdShow
UpdateWindow(hWnd);
return TRUE;
}
Regards,
Anson
|
|
|
|
|
I beleive there are some articles/totorials on this subject here a codeproject and there may be some information in the FAQs. There is also some information in the MFC library, on this subject.
What I do know is that most of your problems will be solved by using a full screen window (information in MFC library). You will probably need to filter WM_SIZE, WM_MOVE, WM_KEYDOWN, and any other messages that would normaly allow the user to size, move, or close the window.
Good Luck!
INTP
|
|
|
|
|
Looking for information relating sending sms messages with a phone over serial port in PDU mode with Visual,can anyone help?;)
nolan
|
|
|
|
|
There's a standard set of AT commands defined precisely to do so. Google for "GSM 07.05" (this is the name of the standard.) The commands are not trivial to use at first, you will have to carefully construct some rather messy data structures, but the standard defines them with great precision.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Hello!
Is it possible to check if something is typedef'd already?
For example VC++ 5.0 doesn't know the TRIVERTEX structure. A normal #ifndef TRIVERTEX doesn't work in VC++ 2k3 because it has been declared with typedef and not with #define. So VC++ 2k3 will throw a redeclaration error.
Any idea?
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hmmm.
The simplest suggestion is to check that the header file "guard" that includes that typedef hasn't been defined
eg, in "standardfile.h":
#ifndef STANDARD_FILE_H<br />
#define STANDARD_FILE_H<br />
<br />
typedef TheTypeIWant;
<br />
#endif
and in "yourfile.h"
#ifdef STANDARD_FILE_H<br />
#else<br />
#endif
This would be a somewhat brittle approach though. If this is part of a cross-platform application, you might want to the more traditional approach of defining necessary types within code blocks for the specific platform. If you need to build something with VC++5.0 and 2003, then treat them as specific platforms but via the compiler versions
(I think it's VC_VER, off the top of my head - but it's in the headers - 2003 is VC-VER 1300, IIRC, and VC++5 is 1100)
HTH
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
You can always use
#if VISUAL_STUDIO_NET
__if_not_exists(TRIVERTEX) {
struct TRIVERTEX {
...
}
}
#endif
__if_not_exists and __if_exists are VS.NET-features only I believe, hence the #ifdef VISUAL_STUDIO_NET (which should be replaced with something correct )
--
Must I be the meat in an imbecill sandwich?
|
|
|
|
|
Jörgen Sigvardsson wrote:
which should be replaced with something correct
And what would that correct thing be? _MSC_VER to 8 or so? What is _MSC_VER for VS2k3.NET?
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
#if _MSC_VER >= 1300 should do the trick
--
Must I be the meat in an imbecill sandwich?
|
|
|
|
|
I am wiritng an MFC\C++ code and using DOM while working with a web browswer - the problem is that retrieving string from the html page - they include strange characthers in the fomat %xx - how do I eliminate those?
|
|
|
|
|
They are called escape characters. Any non-alphanumeric is tranlated into the hexadecimal equivalent passed that way. This has to do with the POST/GET Method in HTTP. I had this problem a while ago - if I remember correctly I rolled my own parser - its actually not too difficult.
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|
Or you can just use the InternetCanonicalizeUrl() function, which is part of the WinINet SDK.
Ivor S. Sargoytchev
Dundas Software
|
|
|
|
|
Is that the one that is part of the IE 6.0? or is it included in the VC 7.0 now?
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|
Requirements:
Client: Included in Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me, Windows 98, and Windows 95.
Server: Included in Windows Server 2003, Windows 2000 Server, and Windows NT Server 4.0.
Version: Requires Internet Explorer 3.0 or later.
Header: Declared in Wininet.h.
Library: Use Wininet.lib.
More in MSDN...
|
|
|
|
|
Are you using B String?
Best Wishes,
ez_way
|
|
|
|
|
Hi,
I created a Process and a child process inheriting the parent's environment variables.
In anothwer application i'm trying to open the process(OpenProcess) and get handle.
How to get the environment variables for this process using the handle?ls help.
getEvironmentvariable() only gets calling process variables.
Thnsks in advnce.
|
|
|
|
|
Hi,
Just can't find the answer of this...
When I want to resize my my Form(no border etc.) I use the following (working) code;
<br />
void __fastcall TMain::ImageMouseMove(TObject *Sender, TShiftState Shift,<br />
int X, int Y)<br />
{<br />
<br />
if(Shift.Contains(ssLeft))<br />
{<br />
ReleaseCapture();<br />
Perform(WM_NCLBUTTONDOWN, HTRIGHT, NULL);<br />
}<br />
<br />
}<br />
Now I want to change the cursor to for example crSizeWE;
I can insert something like this...
if (!overImage) {<br />
Main->Cursor = crSizeWE;<br />
overImage=true;<br />
}
...in the code above and also make an FormMouseMove-event...
if (overImage) {<br />
Main->Cursor = crDefault;<br />
overImage=false;<br />
}
...but that doesn't work when the mouse exits the Form from an Image with the ImageMouseMove-event.
Anybody knows the solution? Am I overlooking something stupid .
Thx a Million, Jeroen.
|
|
|
|