Solved

Calling a VB dll from within PowerBuilder

Posted on 2003-11-05
6
3,113 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
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 use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

690 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