Re: [Jprogramming] Win API calls

2015-10-23 Thread Joe Bogner
bill, thanks. good examples. clean. On Fri, Oct 23, 2015 at 10:20 AM, bill lam wrote: > W is the unicode version,better to use the ascii version > since drive letter is always in latin. > > > 'len max var'=:'kernel32 GetLogicalDriveStringsA i i *c' cd > ((#;[)(4*26)#' ') > ><;._2 len{.var

Re: [Jprogramming] Win API calls

2015-10-23 Thread bill lam
W is the unicode version,better to use the ascii version since drive letter is always in latin. > 'len max var'=:'kernel32 GetLogicalDriveStringsA i i *c' cd ((#;[)(4*26)#' > ') ><;._2 len{.var > +---+---+---+---+---+---+---+---+---+---+---+---+ > |C:\|H:\|J:\|Q:\|R:\|S:\|T:\|U:\|V:\|W:\|Y

Re: [Jprogramming] Win API calls

2015-10-23 Thread Devon McCormick
Joe - thanks for the complete, working example. On Fri, Oct 23, 2015 at 9:12 AM, Joe Bogner wrote: > Here's a couple ways to do it (tested on j-64): > > NB. let J manage the memory > > z=: 2000 $ 'x' > > 'len max var'=:'kernel32 GetLogicalDriveStringsW x x *s' cd (2000;z) > > (len*JCHAR){.var >

Re: [Jprogramming] Win API calls

2015-10-23 Thread Joe Bogner
Here's a couple ways to do it (tested on j-64): NB. let J manage the memory z=: 2000 $ 'x' 'len max var'=:'kernel32 GetLogicalDriveStringsW x x *s' cd (2000;z) (len*JCHAR){.var NB. manually allocate the memory z2=: mema 2000 'len max var'=:'kernel32 GetLogicalDriveStringsW x x x' cd (2000;z

Re: [Jprogramming] Win API calls

2015-10-22 Thread bill lam
DWORD is uint32 : i LPTSTR is pointer to string, 2 versions, ascii version : *c unicode version : *w usually add suffix A for ascii, W for unicode version of function names. also look at the bottom of page to confirm the name of dll, in this case kernel32.dll 'kernel32 GetLogicalDriveStringsA​

Re: [Jprogramming] Win API calls

2015-10-22 Thread 'Pascal Jasmin' via Programming
probably, 'kernel32 GetLogicalDriveStrings​ i i *s'&cd the return value is first param. - Original Message - From: Devon McCormick To: J-programming forum Cc: Sent: Thursday, October 22, 2015 2:56 PM Subject: Re: [Jprogramming] Win API calls So, if I want to trans

Re: [Jprogramming] Win API calls

2015-10-22 Thread Devon McCormick
So, if I want to translate this call as shown on MSDN: DWORD WINAPI GetLogicalDriveStrings( _In_ DWORD nBufferLength, _Out_ LPTSTR lpBuffer ); ​I need to do something like 'kernel32 GetLogicalDriveStrings​ i *'&cd ? On Thu, Oct 22, 2015 at 12:35 PM, bill lam wrote: > You can still cpoy

Re: [Jprogramming] Win API calls

2015-10-22 Thread bill lam
You can still cpoy from the j602 winapi.dat file, eg the line kernel32 ReadFile i i * i *i * tell you the signature for ReadFile, and call it as 'kernel32 ReadFile i i * i *i *'&cd your parameters... However the signatures inside this winapi.dat are only correct for 32-bit windows. Anyways you

Re: [Jprogramming] Win API calls

2015-10-22 Thread chris burke
I am not sure what you are asking, but suggest that you google for example "MSDN ReadFile" to get the parameter definitions. On 22 October 2015 at 08:56, Devon McCormick wrote: > Can I figure out how to do this for the call I need by looking at one of > the existing API packages? > > > On Thu, O

Re: [Jprogramming] Win API calls

2015-10-22 Thread Devon McCormick
Can I figure out how to do this for the call I need by looking at one of the existing API packages? On Thu, Oct 22, 2015 at 11:38 AM, chris burke wrote: > It got dropped. The old winapi dated back to the Win95 days and was a > straight dump of VB calls. Some time ago we decided it was too out o

Re: [Jprogramming] Win API calls

2015-10-22 Thread chris burke
It got dropped. The old winapi dated back to the Win95 days and was a straight dump of VB calls. Some time ago we decided it was too out of date to distribute, and that it would be better to use MSDN. On 22 October 2015 at 07:48, Devon McCormick wrote: > I understand the forum traffic is light s

[Jprogramming] Win API calls

2015-10-22 Thread Devon McCormick
I understand the forum traffic is light since we're all riveted by the possibility of a Mets/Blue Jays world series, but I do have a J-related question. While attempting to load some old code, I get an error trying to load "winapi". I see a number of particular API libraries in the addons, but no