clu82
asked on
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,fal se,false,f alse,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
I tried this code:
[DllImport("C:\\Program Files\\PBBase\\update1.pbd
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,fal
}
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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