Help - About external function from PowerBuilder 11.5 - advapi32.dll

I am trying to call a windows wrapper getusername in
advapi32.dll from my powerbuilder source code, but failing.
This is because the active directory is either not installed
or is not enabled.Is my understanding right? How do i check
if active directory is enabled or not? And can anyone pls
confirm that active directory should be enabled for functios
in advapi32.dll to work? Pls help ...its urgent need
0
sap
11/24/2010 2:50:52 PM
sybase.powerbuilder.general 62418 articles. 17 followers. Follow

4 Replies
1108 Views

Similar Articles

[PageSpeed] 4

Hi Sap;

  I would not even bother ... just wrap the GetUserName ( ) method call in a 
TRY...CATCH and issue an error if the command fails.

Food for thought.

Regards ... Chris
President: OSUG / STD Inc.
Blog: http://chrispollach.blogspot.com
PBDJ: http://chrispollach.sys-con.com
SourceForge: http://sourceforge.net/projects/stdfndclass

"sap" wrote in message news:4ced264c.326c.1681692777@sybase.com...

I am trying to call a windows wrapper getusername in
advapi32.dll from my powerbuilder source code, but failing.
This is because the active directory is either not installed
or is not enabled.Is my understanding right? How do i check
if active directory is enabled or not? And can anyone pls
confirm that active directory should be enabled for functios
in advapi32.dll to work? Pls help ...its urgent need 

0
Chris
11/24/2010 2:53:06 PM
I prefer this function:

Function ulong WNetGetUser( string lpname, Ref string lpusername, Ref 
ulong buflen ) &
                Library "mpr.dll" Alias For "WNetGetUserW"


String ls_userid
ULong lul_result, lul_buflen

lul_buflen = 32
ls_userid = Space(lul_buflen)

lul_result = WNetGetUser("", ls_userid, lul_buflen)
If lul_result <> 0 Then
     SetNull(ls_userid)
End If

Return ls_userid


On 11/24/2010 9:50 AM, sap wrote:
> I am trying to call a windows wrapper getusername in
> advapi32.dll from my powerbuilder source code, but failing.
> This is because the active directory is either not installed
> or is not enabled.Is my understanding right? How do i check
> if active directory is enabled or not? And can anyone pls
> confirm that active directory should be enabled for functios
> in advapi32.dll to work? Pls help ...its urgent need
0
Roland
11/24/2010 4:20:19 PM
Yes, that API works well as well.



"Roland Smith [TeamSybase]"  wrote in message 
news:4ced3b43$1@forums-1-dub...

I prefer this function:

Function ulong WNetGetUser( string lpname, Ref string lpusername, Ref
ulong buflen ) &
                Library "mpr.dll" Alias For "WNetGetUserW"


String ls_userid
ULong lul_result, lul_buflen

lul_buflen = 32
ls_userid = Space(lul_buflen)

lul_result = WNetGetUser("", ls_userid, lul_buflen)
If lul_result <> 0 Then
     SetNull(ls_userid)
End If

Return ls_userid


On 11/24/2010 9:50 AM, sap wrote:
> I am trying to call a windows wrapper getusername in
> advapi32.dll from my powerbuilder source code, but failing.
> This is because the active directory is either not installed
> or is not enabled.Is my understanding right? How do i check
> if active directory is enabled or not? And can anyone pls
> confirm that active directory should be enabled for functios
> in advapi32.dll to work? Pls help ...its urgent need 

0
Chris
11/24/2010 7:30:14 PM
Thanks for the solution. This function indeed worked .. I
could get the current logged on user. I had one other
question. My powerbuilder application is called from Citrix
app. Citrix accepts user credentials and connects to the
database. In my PB app if i need to capture the data source
information that is connected, is there any function that i
can use?

> I prefer this function:
>
> Function ulong WNetGetUser( string lpname, Ref string
> lpusername, Ref  ulong buflen ) &
>                 Library "mpr.dll" Alias For "WNetGetUserW"
>
>
> String ls_userid
> ULong lul_result, lul_buflen
>
> lul_buflen = 32
> ls_userid = Space(lul_buflen)
>
> lul_result = WNetGetUser("", ls_userid, lul_buflen)
> If lul_result <> 0 Then
>      SetNull(ls_userid)
> End If
>
> Return ls_userid
>
>
> On 11/24/2010 9:50 AM, sap wrote:
> > I am trying to call a windows wrapper getusername in
> > advapi32.dll from my powerbuilder source code, but
> > failing. This is because the active directory is either
> > not installed or is not enabled.Is my understanding
> > right? How do i check if active directory is enabled or
> > not? And can anyone pls confirm that active directory
> > should be enabled for functios in advapi32.dll to work?
> Pls help ...its urgent need
0
sap
11/25/2010 4:41:34 PM
Reply:

Similar Artilces:

PowerBuilder 10.5.2 Build 7826 differs from PowerBuilder 11.5.1 Build 4675
Apparently there's some data conversion issues that differ from PowerBuilder 10.5.2 and 11.5.1 (builds listed in subject). The following mini scrip results in different returned values: Byte lb_test Decimal ld_test lb_test = 48 ld_test = Dec(lb_test) MessageBox("Test", String(ld_test)) In PowerBuilder 10.5.2, the messagebox displays the value "48". In PowerBuilder 11.5.1 the messagebox displays the value "0.48". It appears that in PB 11.5.1, it's dividing the result by 100 for some reason. It appears to be a bug, just wanted to ve...

Powerbuilder 11.5 help
Hi. I am developing a application in pb 11.5.My application runs fine using IDE and in debug mode. But when i deploy it using the exe and then run it from the exe , my application crashes on the open only. when i try to debug the exe using message boxes , all the messages are displayed, but i have no clue why it crashes. I open a window in the open event.It goes to the open event of the window. But it again comes back to the application open script even though i have no lines after the window open comand. Any help appreciated. Can you tell us ... 1) Version of ...

PowerBuilder 5.0 with external functions
I am developing a PB application with PB 5.0.2 which has to access external functions.I am accessing a library x.dl and I have around 16 function calls to the same.My application seems to get a GPF after the 5 function.Has somebody got an insight to any other settings I may have to use (Memory setting) etc. Any further information (technical white papers information would be appreciated. Whoever you are <usernamepc>, You are not giving us much here to work with... What platform are you using (16/32-bit)? Can you provide the DLL function prototypes and corresponding PB fu...

PowerBuilder 11 and .NET: Callback function that passes foreign types to PowerBuilder
Hi I'm using a C# assembly to catch COM events (using IConnectionPoint etc) from a particular API. But instead of handling the events in .NET, I pass the information on back to PB so it simulates a type of callback. It seems to work, but I don't know for how long. This is the one the events that gets raised. The _notifyItemMethod is the name of the method on the PowerBuilder object. The _pbSession is obtained from the .Session property of the PowerBuilder object that I pass to the constructor of the event handler. public void NtfyItem(string oper, int flags, ...

Problem registering dll created in Powerbuilder 8 and migrated to Powerbuilder 11
Hi, We have created a dll in Powerbuilder 8 as a com/mts application. This dll was then migrated to powerbuilder 11.1 build 8204. I am able to build the dll on my development machine and properly register the dll on my development machine on windows 7. When i deploy my dll and test application to a clean windows xp box, i am unable to register my dll using regsvr32. No error is displayed and the message box identifing that the registration was successful is never displayed. I have deployed all Powerbuilder 11 runtime using the powerbuilder runtime packager. I also deployed...

External functions in PowerBuilder 5.0 DLLs
I once received a reply to a problem I posted in this discussion group in which I found out that some of PowerBuilder 5.0.x's DLLs have functions in them which can be called by a PowerBuilder programmer by declaring them as external functions... I would like to know if anyone has a complete list of all the functions within the DLLs, as well as some documentation for each function, which can be declared as external functions in PowerBuilder. I could really use the information because I sometimes need to call API functions in PowerBuilder but sometimes that still isn't enough....

Use PowerBuilder DLL in PowerBuilder
We use PB6.5. We would want to use a DLL create from PB in a PB application. We compiled an a PBL as DLL. After we tried to use DLL in a user object external, but without success. How can we do to use DLL create from PB or use in a new PB application some object (visual and no) before compiled with PB? Any help will be appreciated. Saul.Convalle@mail.cec.it Thanks When you create a DLL from a PB library it is not really a standard Windows DLL. I'm not sure what the difference is. If you are making calls from PB then just use the standard PB calling syntax the ...

Powerbuilder 5 to Powerbuilder 10
Hi all We have migrated our application from powerbuilder 5 to powerbuilder 10. after migration to version 10, alignment in most of reports disturbed. please advice me some solution. On Fri, 29 Feb 2008 12:45:01 +0100, Adnan Jamil <adnanjamil@nji.com.pk> wrote: > Hi all > > We have migrated our application from powerbuilder 5 to powerbuilder 10. > after migration to version 10, alignment in most of reports disturbed. > please advice me some solution. Adnan, Is this a SQL Anywhere question? If not, you have posted to the wrong forum. If yes,...

Using Paintdesktop (user32.dll) in PowerBuilder 11.5
Dear all, Is'it posible using API PaintDesktop in PB, once it works in VB, how to make it work in PB? The purpose of this API is to copy wallpaper into a form-VB(window-PB). Private Declare Function PaintDesktop Lib "user32" (ByVal hdc As Long) As Long in Form_Paint() event: Private Sub Form_Paint() PaintDesktop Me.hdc End Sub it works fine in VB, how to make it works in PB? TIA PowerBuilder windows don't have hdc as a property, you need to get it using an API function. Function long GetDC ( long hWnd ) Library "user32.dll" Function ...

declaring and calling dll callback functions in Powerbuilder 6.5
Hello! > > I have several .dll C callback functions and a function that takes as its > arguments these callback functions. > > The headers look like this: > > // this is one of the callback functions > typedef long (CALLBACK *PFNINFO) (long lCurrentStatus, // Status code > LPCTSTR lpszInfoString, // Text information > LPCTSTR lpszWorkstation); // Workstation > > // and now the function that uses it > long _declspec(dllexport) MMIRegisterCallbacks(PFNINFO pFnInfo,....

using c# generated dll inside powerbuilder 11.5
HI there BAckground> I building my dll inside c# in VS2010 using .net 2.0. I would like to use this simple dll which gets Outlook data from the clipboard and generates a file inside my powerbuilder application. So nothing too fancy. Please help. I have seen some examples of how this should work, but having followed a lot of them i still can not get this to do the job. Basically I created a simple c# class and I have the dll. IN the options I set cominterop and under the namespace in the class I entered > [ComVisible(true)] [ClassInterface(ClassInterfaceTy...

Powerbuilder 11.5/EAServer5.5 ConnectToServer
OK, I don't have to configure development stations every day in fact the last time was 4+ years ago. I know this is simple but it's not coming to me at the moment. I've installed Powerbuilder 11.5. I've installed EAServer 5.5. I can connect to my server through EAServer manager. I can deploy objects from PB into EAServer. When I run my application, I'm getting a connecttoserver error 57, not connected to the server. application = 'PACKAGE01' /* Package on EAServer connectstring = '' location = 'laptop:9000' /* EAserver locat...

Upgrade from powerbuilder 10.5 to 11.5
Hi, were are investigating the process of upgrading powerbuilder 105 to powerbuilder 11.5. are there any steps to watch out for. my initial plan is to backup the current source. Copy the source to a temp location. Perform an upgrade of PB10.5 to 11.5 and 'upgrade' the source. Does this sound about right at all? Many Thanks Anish, although I'm not a [TeamSybase] member, we have converted over 25 applications (most very large) from PB 10.5 to PB 11.5 without any problems (no additional steps or changes to objects or code was required, for us at least). The only cav...

How to call AJAX function from a PowerBuilder 11.5 .NET Web Forms application?
Dear All, I would like to know if it is possible (if yes then how) to call AJAX function from a PowerBuilder 11.5 .NET Web Forms application. Any pointer or information is much appreciated. Thank you very much in advance. Thanks and Best Regards, Jessica The first thing you need to do is install the AJAX Extensions for ASP.Net. They can be downloaded here: http://www.microsoft.com/downloads/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6&displaylang=en You write a client-side JavaScript event handler - say myScriptFile.js. Then, in the PowerBuilder ...

Migrating PowerBuilder 8 to Powerbuilder 11
Hi, I am migrating a PFC based Powerbuilder 8 App. to PowerBuilder 11, I am getting errors like illegal data type. for a NVO n_cst_platformwin32 i am getting a syntax error, its not allowing me to open that object. Requesting your help thanks & regards Vimal Sanghvi If you're object (or any related object) failed to migrate successfully, you won't be able to edit it in a regular painter; you'll have to Edit Source to modify it. If you're migrating, a glance through my Migration Guide (see below) may help. The methodology there would allow you to identify...

Web resources about - Help - About external function from PowerBuilder 11.5 - advapi32.dll - sybase.powerbuilder.general

PowerBuilder - Wikipedia, the free encyclopedia
PowerBuilder is an integrated development environment owned by Sybase , a division of SAP . It has been in use since 1991, peaking around 1998 ...

Sybase PowerBuilder tool readied for Microsoft's .Net
... Win32 or newer style .Net development After several years of work, Sybase is ready to deliver on the final step in its plan to move PowerBuilder ...

Jim O'Neil (@jimoneil) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Open Directory - Computers: Programming: Languages
about dmoz - dmoz blog - report abuse/spam - help the entire directory only in Programming/Languages Description Top : Computers : Programming ...

The HP Booth Staff (Goons) Owe Me an Apology
... when you might need to use it. For instance, when I was in the WinRunner world there were plugins for driving terminal emulators and powerbuilder ...

Contact Us - Sybase Inc
Thanks for visiting the 主页 section of Sybase.com. Here you will find information about Contact Us. For more information about Business Intelligence, ...

热门搜索 - 我的异常网
... 我的异常网 » 热门搜索 sdpnet2 移动【A111】其它用户原因鉴权失败,是什么意思啊 http:// 192.168.1.102:22578 本网站服务器位于美国,受美国法律保护 MiniUI js 破解 http://192.168.1.103:8080/ powerbuilder ...

Mobile app security: Always keep the back door locked
The best way to keep mobile apps safe is to secure the services they connect to.

10 Tech Skills That Will Instantly Net You A $100,000+ Salary
... that let's developers run Java applications. Java is highly popular language for writing web apps and custom enterprise apps. No. 8: PowerBuilder ...

Top Ranked Articles
Top Ranked Articles - Free source code and tutorials for Software developers and Architects.; Updated: 23 Feb 2013

Resources last updated: 2/8/2016 5:11:24 PM