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

Using .Net dll insinde powerbuilder code

Posted on 2004-10-11
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 500 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

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

Suggested Solutions

Title # Comments Views Activity
My eclipse editor won't start ? 4 161
Eclipse versons - run configurations 2 86
In Notepad++ how to tell if tab files have been changed? 4 67
C#  WebForms or MVC 4 122
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
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…
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 perform CRUD operations on a MySql database.

792 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