Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Using .Net dll insinde powerbuilder code

Posted on 2004-10-11
Medium Priority
Last Modified: 2013-12-26

I'm totally new in powerbuilder development and I try to access to one of my .Net dll
The final objective is to access to an active directory to perform the user authentication.
I already code something using the EJB code over an EAServer provided by Sybase but I don’t want to use an EAServer just for that.
The idea is where do I need to put my dll to access it from powerbuilder.
I actually use the version 9 of PB and the dll is coded in VB .NET and with the version 1.1 of the .NET framework.

Question by:lcomes
  • 2
  • 2
LVL 18

Expert Comment

ID: 12279117

what u need to do is declare a 'Global External Function'...

i will give u an example...

first declare the dll as an global external function....
u can do this in the declare section of variable where one of the options is 'Global External Function'

write code as below in the variable declare section...
Function boolean GetUserNameA( ref string userID, ref ulong len ) library "ADVAPI32.DLL"

now in the code where u need to call it just call the function as ...


This should work...

Let me know if u need more assistance...


Author Comment

ID: 12279244

Here is what I did :

In the 'Global External Function' declare part I put :

Private Function string testLDAP () Library "LDAPTool.dll" Alias For "test"
 and I call the function like that :

string test
test = testLDAP()

and I get an beautifull bad runtime function exception R0021.

I already use external function to call Windows API as you suggest in you code but actually, I try to do the same task with a custom API coded in VB .NET

I have no idea if there is something "new" to do because of that or if this kind of call are compatible with .Net managed code.

If you have any suggestion I'll really appreciate it


LVL 18

Accepted Solution

diasroshan earned 1500 total points
ID: 12300929

try declaring ur function as follows...
Function string testLDAP () Library "LDAPTool.dll"

and i hope 'testLDAP()' is a function in ur dll...

well i have used dlls created in VC++ and i use it as above and it works fine...

Try it as above and let me know...



Author Comment

ID: 12308167
Thanks but it still not working, sounds like external function are not compatible with .NEt managed code.
I don't have the time to develop a wrapper. So, I've decided to use integrated login.
But Thank you for your answers.

Featured Post

Technology Partners: 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 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.
Suggested Courses

578 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