Farsad wrote:
pBufferSize = Nothing
pDeviceinfo = Nothing
perror = PSReCWrap.prGetDeviceInfo(prHandle, pBufferSize, pDeviceinfo)
perror = PSReCWrap.prInitiateReleaseControl(prHandle)
perror = PSReCWrap.prRC_StartViewFinder(prHandle, 0, _
AddressOf ViewFinderCallBackFunc)
I 99.9% sure! that prhandle is right becuase previous line
(prInitiateReleaseControl) work correctly and lens of my camera jumping.
As the documentation you sent me states, the second parameter to
PR_RC_StartViewFinder is user defined and probably is not used by the
SDK. From the documentation:
prCAPI PR_RC_StartViewFinder(
prHandle CameraHandle,
prContext Context,
prViewFinderCB* pViewFinderCB
);
Parameters
<snip>
Context [in] Specifies the data to be passed to the parameters
in the registered callback function. The client may use this
freely.
<snip>
Thus, the error you're experiencing either comes from a marshalling
error between .Net and the SDK when passing the address of the callback
function, or from a previous initialization error which you didn't
account for. I honestly doubt the first alternative. For the second
alternative, well, I notice that you don't actually check the error
code returned by each call to the SDK. For example, the call to
PR_GetDeviceInfo above is probably returning an error, because you pass
a value of 0 in pBufferSize, and this (according, again, to the
documentation) would cause an error code to be retrieved and the
initialization of pBufferSize to the correct value.
Therefore, I suggest you check the return code of each call to the SDK
previous to calling PR_RC_StartViewFinder to see if something comes up.
HTH.
Best Regards,
Branco.