PowerBuilder API-Call Problem

I have a PowerBuilder application running under PB 6.5 and Win NT.  I am
running a WinAPI function, GetWindowsDirectory.
It is initialized by the following declaration:
Function long GetWindowsDirectory(String lpBuffer, Long nSize) LIBRARY
"kernel32.DLL"  Alias For "GetWindowsDirectoryA"
 
In a window function I make a call to GetWindowsDirectory like this:
 
string sWinDir
long lReturn
long iSysPath
 
lSysPath = 256
sWinDir = space(lSysPath)
lReturn = GetWindowsDirectory(sWinDir, lSysPath)
 
lReturn returns 8, but sWinDir is empty.  The code works in Visual
Basic.
 
Any suggestions?
 
Thanks,
 
James
0
jjohnso9
7/26/1999 6:28:07 PM
sybase.powerbuilder.general 62418 articles. 17 followers. Follow

2 Replies
914 Views

Similar Articles

[PageSpeed] 27

I believe the declaration needs to be 'ref String lpBuffer' so that the data
can be changed in the external function. Otherwise you get back exactly what
you put in....spaces.

jjohnso9@ix.netcom.com wrote in message <379CA8B7.4D1D@ix.netcom.com>...
>I have a PowerBuilder application running under PB 6.5 and Win NT.  I am
>running a WinAPI function, GetWindowsDirectory.
>It is initialized by the following declaration:
>Function long GetWindowsDirectory(String lpBuffer, Long nSize) LIBRARY
>"kernel32.DLL"  Alias For "GetWindowsDirectoryA"
>



0
Ken
7/26/1999 6:56:05 PM
Your declaration should be:
Function long GetWindowsDirectory(ref String lpBuffer, Long nSize) LIBRARY
"kernel32.DLL"  Alias For "GetWindowsDirectoryA"

<jjohnso9@ix.netcom.com> wrote in message
news:379CA8B7.4D1D@ix.netcom.com...
> I have a PowerBuilder application running under PB 6.5 and Win NT.  I am
> running a WinAPI function, GetWindowsDirectory.
> It is initialized by the following declaration:
> Function long GetWindowsDirectory(String lpBuffer, Long nSize) LIBRARY
> "kernel32.DLL"  Alias For "GetWindowsDirectoryA"

0
Philip
7/26/1999 7:02:45 PM
Reply:

Similar Artilces:

PowerBuilder API Call Problem
I have a PowerBuilder application running under PB 6.5 and Win NT. I am running a WinAPI function, GetWindowsDirectory. It is initialized by the following declaration: Function long GetWindowsDirectory(String lpBuffer, Long nSize) LIBRARY "kernel32.DLL" Alias For "GetWindowsDirectoryA" In a window function I make a call to GetWindowsDirectory like this: string sWinDir long lReturn long iSysPath lSysPath = 256 sWinDir = space(lSysPath) lReturn = GetWindowsDirectory(sWinDir, lSysPath) lReturn returns 8, but sWinDir is empty. The code works in Visual B...

API Calls from PowerBuilder.
Hi all, I have a problem with API calls. I'd like to now how to call api functions in a DLL that have some functions with parameters like this: DLL: function x ( stru_a ) Structure stru_a { char * name, integer * value_1, Double * value_2, .... } I hope somebody can help me. Thank's. Luiz Paes. Search the Help file for Declaring External Functions and then Calling External Functions. This will explain how (and where) to declare and call your API functions. Zane Knight. ...

Better to use API fn call/Powerbuilder fn call ...
I have a rather elementary question. Is there any difference in application performance if I use an API call rather than a PowerBuilder function call ? eg Suppose there is PowerBuilder function 'X' which will bring a window to the foreground. An API function 'Y' does the same. Assuming that I need not prepare/initialize any structure etc to be passed to the API function 'Y', does it make any difference to the app performance if I make an API call instead of the PowerBuilder function call 'X' ? Thx Ganesh The difference would be virtually i...

Problems calling Excel from Powerbuilder
I have an application that reads data from an excel spreadsheet, then process the data and sends it to a Unix server. When the app is finished processing the data, it is supposed to update the error worksheet in the spreadsheet with an errors. If there are no errors, it will just put the date it was processed. The problem is, when it goes to update the errors worksheet, it gives a Powerbuilder runtime error and the application terminates. Here is the error message: Application Terminated. Error: Error calling external object function worksheets at line 15 in fun...

How to call MSMQ API from Powerbuilder
Hi all, can someone point me to a site/newsgroup, etc. that explains/shows how to get Powerbuilder to communicate with MSMQ? I am working in a legacy App that now requires to send messages to a MSMQ queue. Any help very appreciated! Don't know about MSMQ, but here's one for MQSeries: http://www.rgagnon.com/howto.html Click on PowerBuilder --> What's New --> Use MQSeriers HTH Greg <Gabriel Gutierrez> wrote in message news:3fa7c6b2.653e.846930886@sybase.com... > Hi all, > > can someone point me to a site/newsgroup, etc. that > e...

Powerbuilder
Does anybody have a cross reference list of the PowerBuilder powerscript to obsolete windows API calls?? Has anybody created new functions to handle the new windows API calls?? Thanks, Denise ---== Posted via the PFCGuide Web Newsreader ==--- http://www.pfcguide.com/_newsgroups/group_list.asp ...

PowerBuilder calling MTS GetObjectContext Problems
I am using PowerBuilder 6.0 to build NVO�s which I am deploying as components in Microsoft Transaction Server. I am able to deploy basic components, but I am having some trouble calling the �global� GetObjectContext() function out of mtxas.dll. This call is obviously necessary as the first step to being able to take advantage of the major features of MTS transactions. I have also tried calling the GetObjectContext() from mtxex.dll (where it seems to be an exposed interface) with no luck. Here�s what I AM doing which I know is not right, but gets me some limited functionality w...

Powerbuilder 9.0 Migration from powerbuilder 7.0.3 problem
Hi all, i was trying an migrate an powerbuilder 7.0.3 application to powerbuilder 9.0(PFC BASED APPLICATION (PFC objects version PB 6.5) ) during migration i am getting this error. tcmborrower.pbl(w_cursor_check).w_cursor_check.open.2: Error C0163: The definition of referenced global variable sqlca was improperly compiled in object trcomps Did anybody faced this kind of error? Thx Ashok JPMORGAN ---== Posted via the PFCGuide Web Newsreader ==--- http://www.pfcguide.com/_newsgroups/group_list.asp First error message which i got during the migration is : tcmappl.pb...

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

Powerbuilder crash when calling API function Openfile()
lul_Handle = gu_ext.OpenFile(ls_file, lstr_FileInfo, 2) To get the handle of the file I use command above... Most of the time, the first time I run the script it works, the second time I get a powerbuilder crash... Anyone any idea? The function is declared in the user object gu_ext Function ulong OpenFile (ref string filename, ref s_fileopeninfo of_struct, ulong action) LIBRARY "KERNEL32.DLL" Any ideas? Thanks Don't forget to free the handle afterwards with Private Function Long CloseHandle(Long hObject) Library "kernel32" CloseHandle(lul_Hand...

Powerbuilder API call to stop datawindow retrieval
When I used SQLNET v1.x with Powerbuilder v4.x, I was able to stop a datawindow retrieve in my apps with a key combination of <CTRL>-<C>. This was a very nice feature to have, especially, with a datawindow retrieval lasting several minutes. With Powerbuilder v5.0.0.3 and SQLNET v2.0, the <CTRL>-<C> feature does not work. Powersoft tech support says that Oracle SQLNET v2.0 does not support this feature. But, SQLNET v2.0 documentation says that it does support this feature. I tested this successfully via SQLPLUS. I could use the RetrieveRow datawindow eve...

Making Third Party API Calls From Powerbuilder
Hi, I don't think this is possible but... Let's say I've got a Java API or a Python API. Is there anyway to use them in powerbuilder? (PB 8 to be specific) Thanks Not with PB8. PB9 provided PBNI and the EJBConnection object that can be used to talk with Java. <Dan Black> wrote in message news:461c12c1.5851.1681692777@sybase.com... > Hi, > > I don't think this is possible but... > > Let's say I've got a Java API or a Python API. Is there > anyway to use them in powerbuilder? (PB 8 to be specific) > > Thanks ...

Powerbuilder API call to stop datawindow retrieval
When I used SQLNET v1.x with Powerbuilder v4.x, I was able to stop a datawindow retrieve in my apps with a key combination of <CTRL>-<C>. This was a very nice feature to have, especially, with a datawindow retrieval lasting several minutes. With Powerbuilder v5.0.0.3 and SQLNET v2.0, the <CTRL>-<C> feature does not work. Powersoft tech support says that Oracle SQLNET v2.0 does not support this feature. But, SQLNET v2.0 documentation says that it does support this feature. I tested this successfully via SQLPLUS. I could use the RetrieveRow datawindow eve...

Calling dbtools API from Powerbuilder or Visual Basic
Hello, I have read (here on the newsgroup) about the "wrapper" dll in c / c++ needed to call the dbTools api from powerbuilder. Has somebody written such a dll? Is there an example on sybase codexchange. Has sombody got such a template in c / c++ ready for coding. Can somebody please explain the bare basics of writing such a dll. It would be nice to know the status in powerbuilder which table is currently being backed up or which table is being unloaded with the percentage progress rather than have to see a dos box. Is it possible to call the dbTools api from visua...

Web resources about - PowerBuilder API-Call Problem - 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: 12/6/2015 7:02:14 PM