Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
Back to article list Search Articles Add Comment Printer friendly Direct link Windows API: Passing null terminated arrays to PathFindOnPath 2003-08-31 -- John E. Christ III Newsgroups: softvelocity.products.c55ee
One more time... A line that wasn't supposed to be there (PathPtr[1] = 0)
somehow crept in.
Maarten,
> > >How do I define a null-terminated array (ppsz) for an API call?
For the non-UNICODE version
MODULE('Win32.lib')
PathFindOnPath(*CSTRING, LONG), LONG, RAW, PASCAL, DLL,|
NAME('PathFindOnPathA')
END
Data:
Filename CSTRING(256)
Paths CSTRING(256), DIM(100)
PathPtr LONG, DIM(100)
Code:
Filename = 'MyApp.app'
Paths[1] = 'c:\MyDir1'
PathPtr[1] = ADDRESS(Paths[1])
Paths[2] = 'c:\MyDir2'
PathPtr[2] = ADDRESS(Paths[2])
PathPtr[3] = 0 ! Null terminate the array of pointers
X# = PathFindOnPath(Filename, ADDRESS(PathPtr))
IF X#
MESSAGE('Found it!')
ELSE
MESSAGE('Didn''t find it!')
END
John
Today is November 21, 2024, 6:30 am This article has been viewed 35203 times. Google search has resulted in 151 hits on this article since January 25, 2004.
|
|