1. Flo Vy
  2. PowerBuilder
  3. Thursday, 3 September 2020 08:23 AM UTC

Hello,

I want to call powerbuilder code from Java and all my research lead to PBNI features.

Unfortunatly, it's not so simple to build JNA or JNI mapping to call the PBVM.dll.

It's look like an example (java2pb2) existed in the old codeexchange at this URL : http://powerbuilder.codexchange.sybase.com/files/documents/67/304/Java2pb2.zip

Does anyone still have this example ?

Thank's in advance !

Regards,

Olan Knight Accepted Answer Pending Moderation
  1. Thursday, 3 September 2020 21:46 PM UTC
  2. PowerBuilder
  3. # 1

That would be pretty much the same answer. You would call the EXE from the RUN command:

public void excCommand(String new_dir){
    Runtime rt = Runtime.getRuntime();
    try {
        rt.exec(new String[]{"cmd.exe","/c","start"});

    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

Pass in any parameters you need to, as well.
And of course you can  pass in a string variable instead of hardcoding the
"cmd.exe".
 

Good Luck,
Olan


Comment
There are no comments made yet.
Flo Vy Accepted Answer Pending Moderation
  1. Thursday, 3 September 2020 20:49 PM UTC
  2. PowerBuilder
  3. # 2

Actually, I want the exact opposite !

I need to call PowerBuilder code from a Java program.

Comment
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Thursday, 3 September 2020 20:24 PM UTC
  2. PowerBuilder
  3. # 3

Answered in the duplicate post above!  :)

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.