Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using .Net dll insinde powerbuilder code

Posted on 2004-10-11
4
Medium Priority
?
774 Views
Last Modified: 2013-12-26
Hi,

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.

Thanks.
0
Comment
Question by:lcomes
  • 2
  • 2
4 Comments
 
LVL 18

Expert Comment

by:diasroshan
ID: 12279117
HI,

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 ...

GetUserNameA(ls_userid,ll_len)

This should work...

Let me know if u need more assistance...

Cheers,
Rosh
0
 

Author Comment

by:lcomes
ID: 12279244
Hi,

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

M.

0
 
LVL 18

Accepted Solution

by:
diasroshan earned 1500 total points
ID: 12300929
hi,

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...

Cheer,
Rosh


0
 

Author Comment

by:lcomes
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.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
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

916 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