NT SNMP Extention Agent and 16 bit APP
-
Hi All, I have to implement an SNMP extention Agent in W2000. It is based on a DLL which will be loaded by SNMP Agent. This DLL must communicate with a 16 bit APP to update the MIB handled by the DLL. I used : - SendMessage() to communicate from the DLL to the 16 bit App. - Generic thunk to invoke the DLL from the 16 bit App. My problem is : When I start the service SNMP in dos command by "snmp.exe" all is all right. But if I start the service by "net start snmp" the two process (DLL and 16 bit app) don't communicate. (FindWindow() to use with SendMessage() return WND=NULL and Generic thunk (CallProc32W()) crashs the 16 bit App and even Visual 1.52) To make the Generic Thunk and FindWindow() work, it seems that the service must be attached to a window :( Someone with an idea ? :confused: Thanks for yor HELP Mouez
-
Hi All, I have to implement an SNMP extention Agent in W2000. It is based on a DLL which will be loaded by SNMP Agent. This DLL must communicate with a 16 bit APP to update the MIB handled by the DLL. I used : - SendMessage() to communicate from the DLL to the 16 bit App. - Generic thunk to invoke the DLL from the 16 bit App. My problem is : When I start the service SNMP in dos command by "snmp.exe" all is all right. But if I start the service by "net start snmp" the two process (DLL and 16 bit app) don't communicate. (FindWindow() to use with SendMessage() return WND=NULL and Generic thunk (CallProc32W()) crashs the 16 bit App and even Visual 1.52) To make the Generic Thunk and FindWindow() work, it seems that the service must be attached to a window :( Someone with an idea ? :confused: Thanks for yor HELP Mouez
Yes, I don't think you'll be able to use
FindWindow
- the windows reside on two different 'desktops' for want of a better model. One idea for communicating with services is for both the DLL and the .exe to use a socket to communicate - probably a simple UDP setup is all you need. Use the loopback (localhost 127.0.0.1) for the address for thesendto
, and pick a couple of unused ports to bind to. A nice touch would be using async sockets, so your app and DLL aren't polling.