Click here to Skip to main content
16,016,783 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Several instances of a control... Pin
Tom John5-Jan-05 22:11
Tom John5-Jan-05 22:11 
GeneralRe: Several instances of a control... Pin
TAlvord6-Jan-05 6:24
TAlvord6-Jan-05 6:24 
QuestionValidating user input text entered into an Edit Control? Pin
quickfix764-Jan-05 12:08
quickfix764-Jan-05 12:08 
General? - Confused about datasets Pin
normschaef4-Jan-05 7:55
normschaef4-Jan-05 7:55 
GeneralRichTextBox Selection Block Pin
Dave Londeck4-Jan-05 5:00
Dave Londeck4-Jan-05 5:00 
GeneralnetworkStream.BeginRead() / Threading doubt Pin
carlos_rocha4-Jan-05 4:00
carlos_rocha4-Jan-05 4:00 
GeneralRe: networkStream.BeginRead() / Threading doubt Pin
carlos_rocha5-Jan-05 1:11
carlos_rocha5-Jan-05 1:11 
GeneralCallback function Pin
Tomaz Rotovnik4-Jan-05 3:26
Tomaz Rotovnik4-Jan-05 3:26 
Hello

I have some problems with integrating dll (written in VC++) into VB application. I looked for some advices through google.

I create three functions packed in dll:

int_4 __stdcall Konec_RecToR(); //Stop
int_4 __stdcall Start_RecToR(); //Start
int_4 __stdcall RecToR_Init_Cap(void (*tmp)(unsigned char* array, int size, unsigned char first_frame, unsigned char last_frame, void* ex_param), void* ex_param);

First two functions work well in VB application. The problem is the third function which includes two parameters: callback function with five parameters and extra parameter.

The syntax in VB is:

Private Declare Function Start_RecToR Lib "RecToR.dll" () As Long
Private Declare Function Konec_RecToR Lib "RecToR.dll" () As Long
Private Declare Function RecToR_Init_Cap Lib "RecToR.dll" (ByVal CalBckFunc As Long, ByRef param As Long) As Long

Dim Success As Long
Dim param As Long

Private Sub Command1_Click()
Text1.Text = "ASCII" & vbCrLf & "FG"
param = 10
Success = RecToR_Init_Cap(AddressOf CallBackFunc, param)
Success = Start_RecToR
End Sub

Private Sub Command2_Click()
Success = Konec_RecToR
End Sub


//this is in separate module.bas file

Public Sub CallBackFunc(ByRef inarray As Byte, ByVal size As Long, ByVal flag_start As Byte, ByVal flag_stop As Byte, ByRef param As Long)
Text1.Text = Text1.Text & "TEST"
End Sub


Application crashes when my dll calls calback function. Did I miss something?


Tomaz Rotovnik
GeneralRe: Callback function Pin
OICU8125-Jan-05 18:19
OICU8125-Jan-05 18:19 
GeneralRe: Callback function Pin
Tomaz Rotovnik5-Jan-05 20:03
Tomaz Rotovnik5-Jan-05 20:03 
GeneralRe: Callback function Pin
OICU8125-Jan-05 20:47
OICU8125-Jan-05 20:47 
Generaltextboxes to datagrid Pin
Makniteasy3-Jan-05 23:25
Makniteasy3-Jan-05 23:25 
GeneralRe: textboxes to datagrid Pin
Ritesh12344-Jan-05 3:53
Ritesh12344-Jan-05 3:53 
GeneralRe: textboxes to datagrid Pin
Makniteasy4-Jan-05 8:51
Makniteasy4-Jan-05 8:51 
Generaloledb error Pin
GaryKoh3-Jan-05 21:17
GaryKoh3-Jan-05 21:17 
GeneralRe: oledb error Pin
Dave Kreskowiak4-Jan-05 5:56
mveDave Kreskowiak4-Jan-05 5:56 
GeneralAdding image to listview Pin
kobezt083-Jan-05 20:47
kobezt083-Jan-05 20:47 
QuestionADO and MySql Database in VB6 ? Pin
paykani3-Jan-05 20:12
paykani3-Jan-05 20:12 
AnswerRe: ADO and MySql Database in VB6 ? Pin
Roger Wright4-Jan-05 4:56
professionalRoger Wright4-Jan-05 4:56 
Generalrichtextbox askin for help Pin
Mohammad Daba'an3-Jan-05 20:07
Mohammad Daba'an3-Jan-05 20:07 
GeneralSecurity Pin
lafser633-Jan-05 15:19
lafser633-Jan-05 15:19 
GeneralRe: Security Pin
Dave Kreskowiak4-Jan-05 5:47
mveDave Kreskowiak4-Jan-05 5:47 
Generalimage property Pin
Fantasca3-Jan-05 13:15
Fantasca3-Jan-05 13:15 
GeneralRe: image property Pin
Tom John3-Jan-05 23:42
Tom John3-Jan-05 23:42 
GeneralRe: image property Pin
Fantasca4-Jan-05 0:08
Fantasca4-Jan-05 0:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.