Is there anyway a client can detect the server ip address
No, not if the server is on another host. If it is on the same host you can use the loopback adress 127.0.0.1, in any other case you need to tell the socket where to connect to. It's probably best to make this configurable in your application.
i was trying to run this code from Beej's web site and its command line so when i input ip address somehow the the hostname and ip address are not displayed on the output screen so i think that the ip address was not stored in the structure HOSTENT. can anyone execute this code and see whats wrong with this.
I have a situation where i need to simulate keyboard input in a (preferably) system friendly way.
I'm writing a user level driver for an usb device that has some keys mapped to some events the device generates. ie ( switch XX goes off , simulate a 'P' being pressed (something like that)) , device wise everything is working ok , i'm getting the info from the device , can write to it in bulk , and change settings on the fly through control ..
Now my problem.
I'm insinuating my keystrokes to the OS through the SendInput , and keyb_event api functions (tried both) .
But i'm runing a virtual KVM switch ( ive tried synergy and am now using multiplicity) which intercepts keyboard input , and sends it through the network to the other connected computers , when i'm working on those screens.. it handles normal keystrokes fine , but the keystrokes i send with the api functions just get ignored by both synergy and multiplicity.
So i was thinking .. do you guys know of a skeleton , or of someone that made minimal alterations to DDK's VHIDMINI driver ... so it behaves like a keyboard , and i can access it from user level and make it send keystrokes..The thing is , i want absolute compatibility on the lowest possible level.. and i'm sure i can't go wrong with a virtual HID there..
I'm sure more than one person has done this by now , and would like to know how they did it..
Or better still , are there more system functions to send keystrokes to the OS except SendInput and keyb_event that are transparent to applications.
Here is the code I have used to emit keystrokes from the 8042 chip on the motherboard. You should know that not all 8042 chips will support this. It should be considered a hack.
VOID SendKey8042(int scancode)
SleepWithEvents(33); //Give time for interrupt This can be tuned to keyboard frequency.
_outp(0x60,scancode | 0x80); //KEYUP
I'm trying to share a C++ DLL between a C++ application and a C# application, but a DLL variable is being reset between invocations. Can anyone suggest what I may be doing wrong?
1. The C++ app calls a DLL function.
2. Then the C++ app starts a C# app (with a system () call) that sets a variable to a nonzero value in the same (?) DLL.
3. The C# app terminates.
4. Then the original C++ app looks at the DLL variable and finds it has been magically "reset" to its original zero value. (?!)
I'm assuming there's only ONE instance of the DLL, which is loaded into memory in Step 1. The DLL variable SHOULD BE nonzero in Step 4, but it's not. Any ideas what's going wrong? Thanks!
Last Visit: 31-Dec-99 19:00 Last Update: 29-Nov-23 5:41