Solved

Calling a VB dll from within PowerBuilder

Posted on 2003-11-05
6
3,097 Views
Last Modified: 2013-12-26
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

0
Comment
Question by:wellwisher888
6 Comments
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 9692503
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?
0
 
LVL 6

Accepted Solution

by:
DaniPro earned 20 total points
ID: 9700137
I'm afraid but PB can call only DLL compiled in "FAR PASCAL" mode and VB6 can't create this type of DLL.
You have two solutions:
Create the dll with C++;
Create an OCX with VB6 instead of DLL
0
 
LVL 1

Expert Comment

by:srikanth_a
ID: 9718388
Try giving an alias to the function in your declaration.

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


Srikanth
0
 
LVL 6

Expert Comment

by:BenClark
ID: 14087453
You can't do it.
VB 6 creates ActiveX DLLs
You can use CreateObject() for the DLL.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question