Syntax error while declaring Global External Function in PowerBuilder 11.5

I am trying to declare an global external function GetUsernameA in PowerBuilder 11.5 by as below:

Public FUNCTION boolean GetUsernameA( ref string userID, ref ulong len ) library "ADVAPI32.DLL"
I get syntax error for the above declaration.
Can anyone help to point out what is the issue with the above declaration? Also, in PB 11.5 do we need to set any system options to recognise the declaration for external functions?
adithyaAsked:
Who is Participating?
 
kmanoharnaikConnect With a Mentor Commented:

great!! ;-)

if it had helped you, please share the points.

Thanks in advance
msn

0
 
kmanoharnaikCommented:
Hi,

Even I have 11.5 in my system , I could copy the syntax provided by you and no compile error occured.
do you have problem with only this ext.function declaration or with any?

Can you try adding alias name as follows at the end of declaration?

alias for "GetUserNameA;Ansi"

it would be Public FUNCTION boolean GetUsernameA( ref string userID, ref ulong len ) library "ADVAPI32.DLL" alias for "GetUserNameA;Ansi"

please let me know if it does not work.

thanks
msnaik


0
 
adithyaAuthor Commented:
Hi,

Thanks for the response...
Even with aliasing it shows the syntax error. This happens to any external function declaration, not only to GetUsernameA... Any idea what could be the issue?
Thanks..
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
kmanoharnaikCommented:
Hi,

oh is it so??

What is the syntax error, can you send the error message?

meanwhile i check the settings if i get any i will update you.

Thanks
msn
0
 
adithyaAuthor Commented:
Enclosing the screen shot... It just says Syntax error.
We are basically accessing PowerBuilder 11.5 on a remote machine. Is this the reason ?
syntax-err.bmp
0
 
kmanoharnaikCommented:
Hi,

you should select the global external from dropdown.

please see the screen shot in attached document.

let me know if you still cant fix the issue/.

thanks
msn

 Global-ext-function.doc
0
 
kmanoharnaikCommented:
Hi,

please find the updated document which has screen shots

thanks
msn
Global-ext-function.doc
0
 
adithyaAuthor Commented:
It worked.. Thanks a lot.. :)
0
 
adithyaAuthor Commented:
excelleent response
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.