Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How declare and execute a visualbasic dll in powerbuilder

Status
Not open for further replies.

jsoltero

Programmer
May 4, 2001
3
0
0
US
I have a problem, I need to execute a visualbasic dll in powerbuilder, but I don't know how declare and how execute it. This dll has two funtions that I need to call and execute pasing some parameters.

But my problem is how declare this dll and call that funtions.

Thanks a lot.
Joel
 
Joel,

This isn't difficult IF the VB DLL is compiled correctly.

Look up "Declaring External Functions" in the help. Basically, the format is:
+++++
Use the following syntax to declare an external function:

{ access } FUNCTION returndatatype name ( { { REF } datatype1 arg1, ..., { REF } datatypen argn } ) LIBRARY "libname" ALIAS FOR "extname"
+++++

And an examle would be:
+++++
FUNCTION ulong GetSysColor (int index) LIBRARY "USER32.DLL"

RETURN GetSysColor (ai_index)
+++++

More important than the PB side is to unsure that the VB DLL is compiled correctly. The functions you want to call internal to it must be compiled as "Exported". Otherwise, PB will not be able to see them

To know if this is the case, do a Right Mouse Click on the DLL and look for Quick View in the menu. This window will show you what functions are exported and can be called. If you do this on your DLL and can't see the functions, they haven't been declaired and compiled so you can see them.

Hope this helps

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top