petermat1
Dec 8, 2016
ABCs of APIs 11 - Translating documentation for DLLs in MS "C" into Liberty BASIC
PetermatABCs of APIs 11 - Translating documentation for DLLs in MS "C" into Liberty BASIC | Introduction
Introduction
I am afraid this note is not by your friendly expert Alyce Watson, but by ignoramus Petermat. Why? Because Alyce did not write this, I needed it, and all I can do is to try to find my way. If I fail maybe someone will be encouraged to pick up and correct the note.Why is the note necessary? Because Microsoft documents it's API's using C / C++ examples
The example I am going to use.
The following LB code is due to Alyce Watson at http://libertybasicuniversity.com/lbnews/nl109/browse.htm .
<span style="color:The MS definition at https://msdn.microsoft.com/en-us/library/windows/desktop/bb762194(v=vs.85).aspxdarkblue;">open "ole32" for dll as #ole'free the block of memorycalldll #ole, "CoTaskMemFree",_darkblue;">calldll #shell32, "SHGetPathFromIDList",_
lpIDList as long,_
sPath$ as ptr,_
r aslongclose #ole</span>long</span>
<span style="font-family: Consolas,Courier,monospace; font-size: 14px;">BOOL SHGetPathFromIDList(This is C++ code. SHGetPathFromIDList is the name of a function - just like LB - and the comma delimited items inside the () are the two function parameters. A C++ function returns a value just like an LB function
_In_ PCIDLIST_ABSOLUTE pidl,
_Out_ LPTSTR pszPath
);
</span>