• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 558
  • Last Modified:

Calling a function in a .pbd from C#

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()
{
run_update(false,false,false,false,false,false,false);
}


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

Info:
C# 2.0
PB 10.0
Win XP

tia,
clu

0
clu82
Asked:
clu82
1 Solution
 
tr1l0b1tCommented:
Hi clu82, I'm afraid it's not so easy ...
take a look to this article : http://pbdj.sys-con.com/read/170848.htm
0
 
sandeep_patelCommented:
Hi,

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....

Regards,
Sandeep
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now