Calling a function in a .pbd from C#

Posted on 2006-03-31
Last Modified: 2013-12-26
Does anyone have any code samples or a web site that will show me how to call into a .pbd file to execute a function? The function works from PB, but now I need to call it from C# also.

I tried this code:

[DllImport("C:\\Program Files\\PBBase\\update1.pbd", EntryPoint = "run_update")]
static extern bool run_update(bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7);

public void CallPBUpdate()

but am getting this error:
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

C# 2.0
PB 10.0
Win XP


Question by:clu82
    LVL 6

    Accepted Solution

    Hi clu82, I'm afraid it's not so easy ...
    take a look to this article :
    LVL 14

    Expert Comment


    If you have source code you can compile powerbuilder application in machine code (.dll) instead of (.pbd) and try to call the same function from dll.

    I am not sure just guessing....


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
    How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from ( Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
    The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now