Solved

Calling a VB dll from within PowerBuilder

Posted on 2003-11-05
6
3,069 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
You can't do it.
VB 6 creates ActiveX DLLs
You can use CreateObject() for the DLL.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now