Find Jobs
Hire Freelancers

C DLL - Visual Basic Callback Function

$15-20 USD

Cerrado
Publicado hace más de 21 años

$15-20 USD

Pagado a la entrega
I'm primarily a Visual Basic programmer and I'm making calls to a DLL written in C. I have no problems using the DLL except when trying to implement a callback function in VB. All I need are the few lines of Visual Basic code that will implement the callback. Just want a simple example. I can only offer the header file, not the DLL. Below is the header file: #ifndef _USBCDDLL_HPP #define _USBCDDLL_HPP #define DEVICE_COMMANDOK 0 #define DEVICE_IDERROR 1 #define DEVICE_BUSY 2 #define DEVICE_UNKNOWERROR 3 extern "C" { typedef void (CALLBACK* CDDeviceChangePROC )(int); WINUSERAPI VOID WINAPI InitUSBCDLibrary(); WINUSERAPI VOID WINAPI CloseUSBCDLibrary(); WINUSERAPI VOID WINAPI SetCDCallbackProc( CDDeviceChangePROC lpProc ); WINUSERAPI int WINAPI GetDeviceNumber(); WINUSERAPI int WINAPI EnumDevice( int); // CD Device Operate function below WINUSERAPI int WINAPI USBCDReset( int ID ); WINUSERAPI int WINAPI USBCDMoveto( int ID, int Index ); WINUSERAPI int WINAPI USBCDGetCDDown( int ID ); WINUSERAPI int WINAPI USBCDLEDON( int ID ); WINUSERAPI int WINAPI USBCDLEDOFF( int ID ); WINUSERAPI int WINAPI USBCDGetStatus( int ID ); } #endif ADDITIONAL INFORMATION Here's some text from the documentation provided to me. Keep in mind I'm looking for the implementation that will work in VB. Our library support a callback function, when device is add or remove, you callback function will called with now device number pass in. The callback function should be below type: typedef void (CALLBACK* CDDeviceChangePROC )(int); use SetCDCallbackProc( CDDeviceChangePROC lpProc ) to set your callback function. Ex : // Callback function void CALLBACK OnCDDeviceChange( int nDeviceNumber ) { // Do what you want to do when device changed ( because user add or remove device ) } in your main code, use below code to set callback function: SetCDCallbackProc( (CDDeviceChangePROC)OnCDDeviceChange ); **Added Note** I have already tried the 'standard' callback procedure's as is used with the Win32 APIs using addressof. But, I get a runtime error: Run-time error '49' Bad DLL calling convention. ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. ## Platform Win32 Visual Basic
ID del proyecto: 2880837

Información sobre el proyecto

5 propuestas
Proyecto remoto
Activo hace 21 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
5 freelancers están ofertando un promedio de $8 USD por este trabajo
Avatar del usuario
See private message.
$3,40 USD en 14 días
5,0 (97 comentarios)
6,6
6,6
Avatar del usuario
See private message.
$17 USD en 14 días
4,9 (92 comentarios)
6,0
6,0
Avatar del usuario
See private message.
$8,50 USD en 14 días
4,5 (42 comentarios)
4,6
4,6
Avatar del usuario
See private message.
$8,50 USD en 14 días
5,0 (39 comentarios)
4,4
4,4
Avatar del usuario
See private message.
$3,40 USD en 14 días
5,0 (4 comentarios)
2,2
2,2

Sobre este cliente

Bandera de UNITED STATES
Hampton, United States
0,0
0
Miembro desde sept 15, 2001

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.