Nodes mit CVGenApi.dll

First,

I strongly advise to use Cvb .Net (which will also be installed with our upcoming release 13.2):

https://forum.commonvisionblox.com/t/getting-started-with-cvb-net

Regarding the API you used: this is a procedural API (a direct mapping of our C interface). If you want object oriented programming use the API described in the link above. Thus the documentation of the procedural .Net wrappers is the same as the C API. The documentation of the object oriented one can currently be easily found online (under .Net API):

https://help.commonvisionblox.com/NextGen/14.0/md_scripts_main__a_p_i__overview.html

Why your code is crashing in the way you described at runtime I cannot tell from this short snippet. First

var image = new Cvb.Image.IMG(1024, 448);

does not compile, as the IMG is a handle (single integer/pointer value) and thus cannot take two arguments. Also then the .CanNodeMapHandle would return false with such a manually assigned value.

Last, the GenApi.dll doesn’t export a SetForegroundWindow (it is defined in Microsoft’s User32.dll). Thus calling this function will result in an exception.

2 Likes