Visual Basic - Codigo de Delphi a VB

Life is soft - evento anual de software empresarial
   
Vista:

Codigo de Delphi a VB

Publicado por Lino cgvm@yahoo.com (37 intervenciones) el 24/05/2011 01:13:53
Hola Amigos

Necesito la equivalencia de este codigo de delphi a vb6.
Lo baje de internet y es para controlar un dispositivo usb dvr.

Ayuda ...

function KRDevice(DeviceName: PChar): Longint; cdecl; external 'krpgio.dll' name '?KRDevice@@YA_NPAD@Z';
procedure KRReadI2cReg (A: Integer; pB: PInteger); cdecl; external 'krpgio.dll' name '?KRReadI2cReg@@YAXHPAH@Z';
procedure KRSetReg (A, B, C, D: Integer); cdecl; external 'krpgio.dll' name '?KRSetReg@@YAXHHHH@Z';

We have also created a proxy/stub for the krgpio.dll and logged all communication to the library.
We found that the function KRDevice and KRReadI2cReg are executed every 200ms. The KRDeivce parameter is always “CAM” and the KRReadI2cReg first parameter is always 0x15 and the second points to DWORD size buffer.

// Every 200ms
KRDevice (“CAM”)
KRReadI2cReg(0x15, pBuffer)

// Initialization phase
KRSetReg(1, 0, 3, 1)
KRSetReg(0, 128, 2, 128)
KRSetReg(1, 1, 3, 1)

// Finalization phase (app termination)
KRSetReg(1, 0, 3, 1)
KRSetReg(0, 0, 2, 128)
KRSetReg(1, 1, 3, 1)

// Source switching cycle is about a second
KRSetReg(0, 152, 2, 152) // Ch1
KRSetReg(0, 144, 2, 152) // Ch2
KRSetReg(0, 152, 2, 152) // Ch1
KRSetReg(0, 144, 2, 152) // Ch2 … and so on …
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder