|
Giles wrote:
Anyone know how to force a socket to close in user mode that may be running in another process.
Kill that process or shut down the NIC.
I'm wanting simply to block connections from IP addresses I choose on ports I choose easily.
Did you try to google first? Yep, pcap seems to be what you want.
|
|
|
|
|
Mike Nordell wrote:
Kill that process or shut down the NIC.
Sadly, no can do. At worst all I want is a socket error returned back to the process or a disconnect, and hope it handles it properly.
Even better, would be to stop a listening server even seeing the incoming request, but likewise I need to stop the outbound request to one of those IP addresses. Its kind of a firewall, but the thing is the rules are being made up on the fly, so I can't just conifgure and ordinary firewall and leave it.
Mike Nordell wrote:
Did you try to google first? Yep, pcap seems to be what you want.
I've been googling all day, though not for the right thing. Thanks.
This seems to be much more on the right track, though I can't seem to download the file right now.
"Je pense, donc je mange." - Rene Descartes 1689 - Just before his mother put his tea on the table.
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
Did you try to google first? Yep, pcap seems to be what you want.
Giles wrote:
I've been googling all day, though not for the right thing. Thanks.
Glad to be of help. Information overload, eh? It's hell when you know something like this just have to be out there, but no matter how one tries to restrict the searches one gets like 100k hits back.
If you need source code, it's often quite useful to add "source code" (with the quotes). Another place to look at (and you would have found libpcap there also) is freshmeat. Even that it's mainly GNU/Linux stuff, there are quite a few Win32 (compatible) projects there also. Oh, I might add that's another keyword for Google - Win32.
++luck;
|
|
|
|
|
help me how to use key press function in C programming at DOS 16-bit environment. i mean just like:
if (press Delete on keyboard)
{
....process....
}
thousands thanks
>>teaching is also learning<<
|
|
|
|
|
I found something, but I don't know if it's usefull.
MSDN:
_getch
Requirements
_getch <conio.h> Win 98, Win Me, Win NT, Win 2000, Win XP
Return Value
Returns the character read. There is no error return.
Remarks
The _getch and _getwch functions read a single character from the console without echoing. _getche and _getwche read a single character from the console and echo the character read. None of these functions can be used to read CTRL+C. When reading a function key or an arrow key, each function must be called twice; the first call returns 0 or 0xE0, and the second call returns the actual key code.
That would make:
<br />
char ch;<br />
<br />
ch = _getch(); <br />
ch = _getch();
Don't forget:
#include <conio.h>
|
|
|
|
|
You are programming for DOS. What is that?? Just kidding. I have not worked with a complier that would produce DOS code in the last 7 years... The stuff about _getch() that Xander80 said should work in dos.
John
|
|
|
|
|
I am maintaining a service that uses ReadDirectoryChangesW() calls to monitor a set of directories. When a file is dropped (or pasted or copied) into the monitored directory the service detects the new file and processes the new file.
I want to make sure the file is "all there" before taking any action on the file. Currently the service does a "_stat" call to get the file size and then tries an "_sopen" to make sure it is accessible. If either call fails it performs a set of retries.
Occasionally this setup fails. For example, a set of three files are being pasted into the monitored folder and the service fails reading the first file. When I check the folder...none of the files are there!!! Not sure, but somehow the Explorer copy/paste operation is being halted by the file tests. Any ideas? Is there a better way to see if the pasted file exists and is available?
PS: The copy/paste is being done between a local drive and a mounted network drive.
Jack
|
|
|
|
|
1. I use GetFileAttributes() to determine if a file 'exists'.
2. There are 'known' issues with _sopen and network drivers. Especially caching problems. I think you should use a Win32 API instead for checking for the ability to open the file. Look at CreateFile and the flag OPEN_EXISTING.
C++/MFC/InstallShield since 1993
|
|
|
|
|
Blake,
Thanks for the reply! Do you think that the symptoms I am seeing could have to do with the 'known' issues? Any idea where to get more info on those issues? (any docs out there? what criteria might I search the web with?)
I will give the CreateFile a try. Any suggestions on what flags to use? Should I loop with a set of retries in case the file is still being transferred?
Thanks again!
|
|
|
|
|
Hello, how can I allow a CRichEditCtrl to copy/paste "normal text" e.g. from a CEdit-Control?
|
|
|
|
|
If you just want to add such a popup menu showing cut, copy, paste etc., see this article: http://www.codeproject.com/richedit/popupdemo.asp[^]. This way you can make your own context menu.
To programatically copy/paste something into the rich edit control, see functions CRichEditCtrl::Copy and CRichEditCtrl::Paste .
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hello ,
Iam developing a Secure browser .The secure browser needs to capture the events in an HTML Page and execute a DLL function.One way is to capture it in HTML page thru on-click handlers and call the DLL function from the HTML event handler( thru Java script).But this is not required .
What i need is to capture HTML page button clicks by the vc++ app which launches the HTML page .Iam using internet explorer's functions to display the HTML page .
|
|
|
|
|
Hello,
I'm sorry if I've already posted this message. I'm having some issues with posting. I'm developing an app on Windows 2000 using Visual .Net. It works fine on Win 2000, but I bring the app over to a PC running XP and it tells me I'm missing DLL's!!! Just as a test, I wrote a simple hello world program, and I still get the same error. I've tried the app on severl different PC's running XP and get the same error. What's going on? Is it an operating issue? Or is there something wrong with my .Net settings??? Thanks. Please reply to ttran7700@yahoo.com
|
|
|
|
|
ttran7700 wrote:
it tells me I'm missing DLL's!!!
Which ones?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
It says it is missing msvcr70d.dll and msvcp70.dll. I've tried copying them and placing them into the systems folder on the XP, but it still can't seem to find them. Doesn't 70 refer to .Net 2002 and 7.1 refer to .Net 2003? Thanks for the help.
|
|
|
|
|
msvcr70d is obviously a debug library. I wonder if he tried to build a release.
Sincerely yours, Ilya Kalujny.
|
|
|
|
|
Do you have the compiler installed on all these XP machines?? The complier installs many DLLs that are not system DLLs.
John
|
|
|
|
|
It says it is missing msvcr70d.dll and msvcp70.dll. I've tried copying them and placing them into the systems folder on the XP, but it still can't seem to find them. Doesn't 70 refer to .Net 2002 and 7.1 refer to .Net 2003? Thanks for the help.
|
|
|
|
|
msvcr70d.dll is a debug library, and is part of the .NET install.
Try building the program as a non-debug version.
OR install .net on the other machine.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
|
That's the funny thing. I tried installing Visual .Net on the XP machine and get the same error. Is there such a thing as msvcr71d.dll? I mean Visual Studio (the latest) is 6.0, Visual .Net is 7.0. Is there a Visual .Net version 7.1. Thank you for the help.
|
|
|
|
|
We've already tried installing the Visual .Net on the XP machine. It did nothing for me. It suggests that I re-install .NET I don't know why should even need .Net to run the app. I don't expect to need Visual Studio to run Word on my PC. This is simply too strange. Thanks for all the help.
|
|
|
|
|
For support of tracking CWnd window I use the following sequence.
At the first display on a window.
1. I store a window's rect where will be located CWnd window to a bitmap .
2. I draw CWnd window.
By tracking
1. I restore the bitmap on the same place, where I stored it
2. I store a new window's rect to a bitmap.
3. I draw a new window.
To hide a window
1. I restore the bitmap on the same place, where I stored it
At such construction I see blinking by moving of a window though I do all restores and displays on memory context (CreateCompatibleDC ).
In what the reason and whether is a easy way to tracking?
If I track a window with MoveWindow() function then blinking is not present. But in this case I cannot support myself drawing at moving a CWnd window (for example simultaneously with moving to apply fade-in effect).
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Hello,
I want to write an application in Visual C++ that can control an existing windows application, send keystrokes of any kind to an application. Control it as if you were sitting at your keyboard and hitting a hotkey. simulate mouse movement and left, right or middle mouse button clicks. By setting the cursor position to the location of an application's button and clicking the left mouse button - both with a single remote control button - it is even possible to control stubborn apps which do not support messages or hotkeys properly
Can anybody point me in the right direction.
Thanks
|
|
|
|
|
leary wrote:
send keystrokes of any kind
VOID keybd_event(
BYTE bVk,
BYTE bScan,
DWORD dwFlags,
DWORD dwExtraInfo
); or (on NT)
UINT SendInput(
UINT nInputs,
LPINPUT pInputs,
int cbSize
);
leary wrote:
left, right or middle mouse button clicks
VOID mouse_event(
DWORD dwFlags,
DWORD dx,
DWORD dy,
DWORD dwData,
DWORD dwExtraInfo
); or (on NT)
UINT SendInput(
UINT nInputs,
LPINPUT pInputs,
int cbSize
);
leary wrote:
setting the cursor position
BOOL SetCursorPos(
int X,
int Y
);
Hope that helps
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|