11.04.2014 Views

Description for iowkit.dll - Code Mercenaries

Description for iowkit.dll - Code Mercenaries

Description for iowkit.dll - Code Mercenaries

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

IO-Warrior Dynamic Library<br />

<strong>for</strong> Windows V1.5<br />

<strong>Code</strong> <strong>Mercenaries</strong><br />

IowKitOpenDevice<br />

Declaration:<br />

IOWKIT_HANDLE IOWKIT_API IowKitOpenDevice(void);<br />

function IowKitOpenDevice: IOWKIT_HANDLE; stdcall;<br />

Opens all available IO-Warrior devices and returns the handle to the first device found.<br />

The value returned is an opaque handle to the specific device to be used in most of the other functions of<br />

the API.<br />

The return value <strong>for</strong> failure is NULL (which is nil <strong>for</strong> Delphi and 0 <strong>for</strong> VB6). Use GetLastError()<br />

to learn more about the reason <strong>for</strong> failure. The most common reason <strong>for</strong> failure is of course that no IO-Warrior<br />

is connected. GetLastError() returns ERROR_DEV_NOT_EXIST <strong>for</strong> that.<br />

Calling this function several times is possible, but not advisable. The devices get reenumerated and<br />

there<strong>for</strong>e the position in the list <strong>for</strong> a specific device may change.<br />

Returning the first IO-Warrior found makes it simpler <strong>for</strong> programmers to handle the use of only one IO-<br />

Warrior.<br />

Linux only handles a maximum of 8 IO-Warriors.<br />

Sample usage C:<br />

IOWKIT_HANDLE ioHandle;<br />

ioHandle = IowKitOpenDevice();<br />

if (ioHandle != NULL)<br />

{<br />

// ... success, access devices<br />

}<br />

else<br />

{<br />

// ... didn't open IoWarrior, handle error<br />

}<br />

Sample usage Delphi:<br />

var<br />

ioHandle: IOWKIT_HANDLE;<br />

begin<br />

ioHandle := IowKitOpenDevice;<br />

if Assigned(ioHandle) then<br />

begin<br />

// ... success, access devices<br />

end<br />

else<br />

begin<br />

// ... didn't open IoWarrior, handle error<br />

end;<br />

end;<br />

IO-Warrior Dynamic Library V1.5 8. Dez 2005 4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!