BasicScience wrote:I think Len(SerialNum) needs to be SizeOf(SerialNum). Len() returns 0 before a value has been assigned to SerialNum.
No Sir, you are totally wrong :-)
SerialNum is a char buffer allocate by Space(16) len() returns in this case 16.
SizeOf() would return the size of an FreeBASIC string descriptor.
AXC_GetSerialNumber() does not allocate space for the serial number it fills the space you allocated and maximal with 16 chars.
BasicScience wrote:For the dependency on AxHIDManager.Dll, I simply use: DyLibLoad("AxHIDManager.dll")
This should work, right?
The dynamic loader (a part of the OS) will resolve open references from your created and executed program .
The loader "looks" in a import section of the exe witch *.dll are involved to replace open references (addresses to functions or to resources in the dll).
So it reads "AxoclampDriver.dll" (your interface to the device stack) if this dll was loaded from other task before
the dynamic loader can replace all open references with virtual addresses.
The translation of virtual address to physical memory addresses
are done by a MMU (memory management unit) and a MPU (memory protection unit) are involved also.
Of course both units are a part of the CPU today (no physical chips)
so the slower bottleneck CPU -> BUS -> RAM -> BUS -> CPU comes after the address translation.
If AxoclampDriver.dll was not loaded in RAM before it loads the dll and resolves open references from this dll to "open-device" "close-device" ...
So it reads "AxHIDManager.dll" from the import section of "AxoclampDriver.dll" and loads the dll and replace open references and so on.
This steps are repeated for all open references and involved dll's
version.dll ->user.dll -> system32.dll -> gdi32.dll ... (there are more but not shown on the picture)
If we would talk about "normal" stuff that runs in user space like SDL or GTK+ using DyLibLoad("") would be a handy solution.
But in this special case (if AxHIDManager.Dll is a part of a driver stack/layer) for the acquisition system
it's more safe to let the job done by the OS and it's driver stack.
BasicScience wrote:Now I just need to figure out how to use it with essentially no documentation.
If "AxoclampDriver.h" is a part of the SDK you should find documentation or other C/C++ examples that used this lib also.
By the way this is one point why I like to translate include files by hand and not by fbfrog or h_to_bi.
If you do it by hand you knows witch data types (often structs with more or less meaningful member names) are used by witch functions.
Often I sort the declarations in a logical order that makes any sense for me.
(GetVersion, InitLib, Exitlib, OpenDevice, CloseDevice, Device->feature.a, feature.b,feature.c ...)
So for me a self translated *.bi file is more than a half of the documentation.
bla bla bla :-)