16.01.2015 Views

HALCON/COM User's Manual

HALCON/COM User's Manual

HALCON/COM User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.8. <strong>HALCON</strong>/<strong>COM</strong> AND VISUAL BASIC 15<br />

message (the textual error representation) to the Visual Basic’Immediate’-window and stores<br />

the error code in a global integer variable. The global Visual Basic object ÖÖ is the source<br />

of information in this case. Afterwards, control is put back to the line following the statement<br />

which produced the error. This is done by the Visual Basic command Ê×ÙÑ ÆÜØ. The next<br />

line of code then would be responsible for checking the error code stored in Ä×ØÖÖÓÖÓ.<br />

Of course, this method is a little long winded and not quite up-to-date — an exception handling<br />

mechanism in general is much more flexible and robust — but it’s quite easy to understand.<br />

We have seen, that there are two types of errors: <strong>HALCON</strong>-related errors and <strong>COM</strong>-interfacerelated<br />

ones. Since the <strong>COM</strong>-interface errors have smaller error numbers than the <strong>HALCON</strong><br />

error codes, the above mechanism would lead to negative numbers. In that case, the produced<br />

error code would have to be subtracted from ËÝ×ÇغÖÖÓÖ×ÇÅ to get the correct (then<br />

interface related) error code.<br />

<strong>HALCON</strong> 6.0

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

Saved successfully!

Ooh no, something went wrong!