bougon has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks, I'm very new to Perl, and perhaps what I'm trying to do here is a bit too much for me so I think I need a little help from the PROs. I'm trying to implement the WIN32::DDE extension in a Windows Service using WIN32::DAEMON. The DDE activities work very very well when running the script outside the service context but creating a new DDE client in the service context generates the error DMLERR_NO_CONV_ESTABLISHED. At first I thought that perhaps the user given to the service didn't have proper credentials to establish DDE connections, so I assigned it a administrator user. No luck there. Reading a bit more on the Internet lead me to think that perhaps the NetDDE services had something to do with it, so I started them with no luck there either. Now I'm simply wondering if it's a compatibility issue or something very deep in the Windows services mechanismes I don't understand. Has anyone been doing what I'm trying to achieve? Do you thing using ActiveState's tools to convert a Perl script into a service would work in this context? Thank you for your Help!! Dan

Replies are listed 'Best First'.
Re: Using WIN32::DDE in a Windows Service
by Jenda (Abbot) on Mar 31, 2009 at 13:29 UTC

    What are you trying to communicate with? A program the service started? I do believe DDE is generaly considered obsolete, are you sure you can't use OLE?

      Hello Jenda, thank you for your interest.

      I need to communicate with an industrial automation program called Intouch from Wonderware. This application is widely used in industrial applications to create operator interfaces that communicate with Programmable Logic Controllers (PLC). Intouch supports two types of inter-process communictions DDE and SuitLink. SuitLink is the equivalent of OPC (OLE for Process Control) but is not compatible. I've searched arround to see if someone had developped a Perl SuitLink extension, but unfortunately the answer is no. If I had a little more time and budget on my project, I would go to the extent of creating my own and share it with others but here again my ressources are limited. So to me, for as long as DDE is supported by Intouch, I guess it's a viable solution.

      Again, DDE work extremely well, but I don't understand why it fails within a service.

      Thank you again.

      Dan

        Hi Dan,

        Like you, I'm trying to communicate with an old scada system (Bailey), but I haven't gotten as far as you have. Using Excel and NetDDE, I can reach the Bailey DDE server from a remote computer, but using Win32::DDE::Client, I'm unable to connect. Have you tried Win32::DDE::Client using NetDDE to communicate from a remote computer?

        Thanks,

        Mike

Re: Using WIN32::DDE in a Windows Service
by BrowserUk (Patriarch) on Mar 31, 2009 at 15:06 UTC
    At first I thought that perhaps the user given to the service didn't have proper credentials to establish DDE connections, so I assigned it a administrator user.

    Did you try leaving it as Local System account and enabling "Allow service to interact with desktop"?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      WOW!!!

      Thank You BrowserUk! That was it.

      I've allowed the service to interact and was able to Poke into an Excel cell (simple test).

      I assume other DDE activies will work as well. I will keep the thread active to let other solution seekers know of any problem/solutions.

      Regards,

      Dan