Find Jobs
Hire Freelancers

C DLL - Visual Basic Callback Function

$15-20 USD

Fechado
Publicado há mais de 21 anos

$15-20 USD

Pago na 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 do Projeto: 2880837

Sobre o projeto

6 propostas
Projeto remoto
Ativo há 21 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
6 freelancers estão ofertando em média $9 USD for esse trabalho
Avatar do Usuário
See private message.
$3,40 USD em 14 dias
5,0 (92 avaliações)
6,4
6,4
Avatar do Usuário
See private message.
$17 USD em 14 dias
4,9 (92 avaliações)
6,0
6,0
Avatar do Usuário
See private message.
$12,75 USD em 14 dias
5,0 (34 avaliações)
5,4
5,4
Avatar do Usuário
See private message.
$8,50 USD em 14 dias
4,5 (41 avaliações)
4,6
4,6
Avatar do Usuário
See private message.
$8,50 USD em 14 dias
5,0 (38 avaliações)
4,4
4,4
Avatar do Usuário
See private message.
$3,40 USD em 14 dias
5,0 (4 avaliações)
2,2
2,2

Sobre o cliente

Bandeira do(a) UNITED STATES
United States
0,0
0
Membro desde set. 15, 2001

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos 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)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.