Skip to Content
avatar image
Former Member

Accessing Powerbuilder application through OLE

Hi,

I am interested to know the below thing....

As like accessing Excel and word application from Powerbuilder, is it possible to access powerbuilder application through OLE control?

(i.e. accessing PB application from PB via OLE). It should be.... am I right?. If so what all will be the functionalities which we can access from calling PowerBuilder application!. Please share some sample code if possible.

Thanks & Regards

Babin A B

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Aug 19, 2016 at 01:25 PM

    Using the Send function would require knowing the handle of the other apps main window. Chris mentioned winsock. I have a winsock example app you can download. All you need to know is the port which you can set to the same value in both.

    Topwiz Software - Winsock

    Add comment
    10|10000 characters needed characters exceeded

    • We have used both the database table method & Rolands TCP/IP for communication between applications. I think to replace DDE you would be better off with the TCP/IP approach. You should use a high port over 1024 and listen/connect to localhost to avoid Windows firewall issues. Make the port number configurable via the registry for both applications just in case you have a clash with another service listening on tcp/ip.

      On the listening process I would choose a default port, check to see if that is available and if not add 1 and try again till you get a free port. Then open the listener on that port number and update the registry with the active port number.

      The client process would get the port number from the registry.

      Hope that helps.

      David

  • avatar image
    Former Member
    Dec 23, 2014 at 12:17 PM

    Hi Babin;

      PowerBuilder used to have the ability to build an OLE server - but, Sybase removed that feature in more recent versions .... for what ever reason, I have no idea. The same reasons I guess why they removed the C++ User object, Distributed PB Server,  and other great features (OTL IMHO).

    Regards ... Chris

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Babin;

      Alternatives:

      1) If this is simple messaging, you could use the SEND ( ) command in PB.

      2) For more complex data exchange you could also use WinSock (TCIP) between applications.

      Regards ... Chris

  • avatar image
    Former Member
    Dec 24, 2014 at 04:46 AM

    The OLEAutomation project was deprecated in PB 11.5.

    What are you trying to do?  Maybe there's a better architecture than OLE.  You could use web services, or open a socket...  Lots of different ways to accomplish interprocess communication.

    -Paul-

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 18, 2016 at 07:53 PM

    Babin - Just wondering if you found an alternate solution? We are having the same issue as our app freezes during a openchannel. Not sure which way to go.

    We use the DDE channel for just a one time communication and i don't want to take a super exhaustive measure for this sake.

    We are on PB12.0.

    Thanks for your time!

    ~Balu

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 19, 2016 at 07:33 AM

    Hello All,

    The DDE is working in Windows 8 with Power Builder 12.5 and it was flawless.

    but now Client has updated the Windows 8 to windows 10; from that day we are also facing the Application freezing Issue.

    if anyone have sample code please share if possible.


    Thanks for the time!

    Brijesh Soni

    Add comment
    10|10000 characters needed characters exceeded

    • I refer to my Post below in response to Rolands TCP/IP.

      "We have used both the database table method & Rolands TCP/IP for communication between applications. I think to replace DDE you would be better off with the TCP/IP approach. You should use a high port over 1024 and listen/connect to localhost to avoid Windows firewall issues. Make the port number configurable via the registry for both applications just in case you have a clash with another service listening on tcp/ip.

      On the listening process I would choose a default port, check to see if that is available and if not add 1 and try again till you get a free port. Then open the listener on that port number and update the registry with the active port number.

      The client process would get the port number from the registry."


      I believe the TCP/IP method would be best for you.

      Regards

      David

  • avatar image
    Former Member
    Aug 19, 2016 at 10:46 AM

    As someone said before you can use Send() to send messages / trigger events from one application to another. However I believe you are limited in what types of data you can send, basically a number - could be a key in a database table.

    Or you could just simply program the applications in such a way that they check for messages in a database / file / registry every now and then, and then process them as required, marking them as processed when done. This is the safest way as I believe sometimes messages can get dropped if too many get sent at the same time.

    Add comment
    10|10000 characters needed characters exceeded