Link to home
Start Free TrialLog in
Avatar of wellwisher888
wellwisher888

asked on

Calling a VB dll from within PowerBuilder

I have Created DLL using VB 6.0 which return the name string. Contains 1 parameter, which query and return the name. i have defined in PB as.

FUNCTION STRING GetName(STRING userid ) LIBRARY "Dbinterface.dll"

In VB it works fine.

im calling in PB as.

STRING nm
nm = GetName("IMTIYAZ")
messagebox("",nm)

When PB application is executed it gives an error.
Power Builder Application Error: (R0021)
Err: bad runtime funtion at line 62 ..
where line 62 contains the above codes.

Please, help me if anyone is aware of how to use VB dll in PB.

Thanking you in advance
rgds
Imtiyaz

Avatar of Vikas_Dixit
Vikas_Dixit
Flag of United States of America image

If you have quickview or any other utility to see the exported function from dll, please confirm that the dll exports the function you are trying to call exports the function GetName?
ASKER CERTIFIED SOLUTION
Avatar of DaniPro
DaniPro
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of srikanth_a
srikanth_a

Try giving an alias to the function in your declaration.

Also please check where (scope)  have you declared the function.


Srikanth
You can't do it.
VB 6 creates ActiveX DLLs
You can use CreateObject() for the DLL.