[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Calling a VB dll from within PowerBuilder

Posted on 2003-11-05
6
Medium Priority
?
3,166 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
4 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 80 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
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 column That will then direct you to their download page. From that p…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
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…
Suggested Courses
Course of the Month19 days, 10 hours left to enroll

873 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