Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. NT SNMP Extention Agent and 16 bit APP

NT SNMP Extention Agent and 16 bit APP

Scheduled Pinned Locked Moved C / C++ / MFC
helpagentic-aiquestionannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MoZ
    wrote on last edited by
    #1

    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

    T 1 Reply Last reply
    0
    • M MoZ

      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

      T Offline
      T Offline
      Tim Deveaux
      wrote on last edited by
      #2

      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 the sendto, 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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups