Click here to Skip to main content
15,887,267 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: XP panel Pin
Henry Minute22-Jun-09 1:20
Henry Minute22-Jun-09 1:20 
GeneralRe: XP panel [modified] Pin
mirzamujib22-Jun-09 1:39
mirzamujib22-Jun-09 1:39 
GeneralRe: XP panel Pin
Henry Minute22-Jun-09 1:56
Henry Minute22-Jun-09 1:56 
GeneralRe: XP panel Pin
mirzamujib22-Jun-09 3:31
mirzamujib22-Jun-09 3:31 
GeneralRe: XP panel Pin
Henry Minute22-Jun-09 3:56
Henry Minute22-Jun-09 3:56 
GeneralRe: XP panel Pin
mirzamujib22-Jun-09 20:09
mirzamujib22-Jun-09 20:09 
GeneralRe: XP panel Pin
Henry Minute23-Jun-09 1:05
Henry Minute23-Jun-09 1:05 
QuestionProblem with passing and getting values to variables in vb6 Pin
ramuluj21-Jun-09 21:32
ramuluj21-Jun-09 21:32 
Dear All,
I have a problem whle declaring input and output variable to pass a 'C' based Dll.
The Dll Api is as follows:

int rw_polling(int PortNumber,unsigned char *SelSysCode, unsigned char *IDm, unsigned char *PMm,int *Response)

Function :Send Polling Command to Card
Return :TRUE = succeeded FALSE = failed
Input :
*PortNumber : com port number (1-8)
*SelSysCode(2bytes) : systemcode of target card
Output :
*IDm(8bytes) : IDm from card
*PMm(8bytes) : PMm from card
*Response : 0 = succeeded
1 = Reader Writer is not open
2 = no response (ACK) from reader/writer
3 = check sum error of received data
10 = card is not detected


Problem:

In the above function I want to pass values of the variable
Input Variables
1) PortNumber=1
2) unsigned char *SelSysCode = 2bytes i.e FF and FF
Output variables
3)IDm (8 Bytes)
4) PMm (8 Bytes)
5) Response.

How I tried:
in Declarations:
Declare Function rw_polling Lib "RCS962INSPCT.dll" (ByVal PortNumber As Long, ByRef SelSysCode As Long, ByRef IDm As Long, ByRef PMm As Long, ByRef Response As Long) As Long

While calling through VB Form:
Dim PortNumber As Long
Dim SelSysCode(1) As Byte
Dim IDm(7) As Byte
Dim PMm(7) As Byte
Dim Response As Long
Dim ReturnCode As Long

'PortNumber = cmbComPort.ItemData(Me.cmbComPort.ListIndex)
PortNumber=1
'Here I want to pass value of 2 bytes i.e FF and FF
SelSysCode(0) = &HFF
SelSysCode(1) = &HFF

ReturnCode = rw_polling(PortNumber, VarPtr(SelSysCode(0)), VarPtr(IDm(0)), VarPtr(PMm(0)), Response)

Result: Function is returning false
Response: 10

If Response = 0 Then
pp = "succeeded"
ElseIf Response = 1 Then
pp = "Reader Writer is not open"
ElseIf Response = 2 Then
pp = "no response (ACK) from reader/writer"
ElseIf Response = 3 Then
pp = "check sum error of received data"
ElseIf Response = 10 Then
pp = "card is not detected"
End If
If ReturnCode = 0 Then
txtMsg.Text = Trim(txtMsg.Text) & vbCrLf & pp
txtMsg.Text = Trim(txtMsg.Text) & vbCrLf & "Pooling Fail"
Else
txtMsg.Text = Trim(txtMsg.Text) & vbCrLf & pp
txtMsg.Text = Trim(txtMsg.Text) & vbCrLf & "Pooling Success"
End If

What I want is:

by which way can I pass the value (FF and FF 2bytes) Input Variable for SelSysCode.
I am able to caputre the Response also.
Please anybody help me in this regarding in VB6



Ram
RantRe: Problem with passing and getting values to variables in vb6 Pin
Vimalsoft(Pty) Ltd21-Jun-09 21:50
professionalVimalsoft(Pty) Ltd21-Jun-09 21:50 
GeneralRe: Problem with passing and getting values to variables in vb6 Pin
Mycroft Holmes21-Jun-09 22:12
professionalMycroft Holmes21-Jun-09 22:12 
GeneralRe: Problem with passing and getting values to variables in vb6 Pin
Vimalsoft(Pty) Ltd21-Jun-09 22:16
professionalVimalsoft(Pty) Ltd21-Jun-09 22:16 
Questionhow to check printer is install? Pin
JC.KaNNaN21-Jun-09 18:35
JC.KaNNaN21-Jun-09 18:35 
AnswerRe: how to check printer is install? Pin
vidhish21-Jun-09 20:07
vidhish21-Jun-09 20:07 
GeneralRe: how to check printer isavilable or not? Pin
JC.KaNNaN21-Jun-09 21:16
JC.KaNNaN21-Jun-09 21:16 
GeneralRe: how to check printer isavilable or not? Pin
Dave Kreskowiak22-Jun-09 2:16
mveDave Kreskowiak22-Jun-09 2:16 
GeneralRe: how to check printer isavilable or not? Pin
JC.KaNNaN22-Jun-09 18:28
JC.KaNNaN22-Jun-09 18:28 
GeneralRe: how to check printer isavilable or not? Pin
Dave Kreskowiak23-Jun-09 1:30
mveDave Kreskowiak23-Jun-09 1:30 
AnswerRe: how to check printer is install? Pin
Eslam Afifi21-Jun-09 21:04
Eslam Afifi21-Jun-09 21:04 
QuestionHow do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Graham Irons21-Jun-09 18:15
Graham Irons21-Jun-09 18:15 
AnswerRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Henry Minute22-Jun-09 1:24
Henry Minute22-Jun-09 1:24 
GeneralRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Graham Irons22-Jun-09 2:00
Graham Irons22-Jun-09 2:00 
GeneralRe: How do you Draw around (inside) a Group of adjacent Cells in a Column of a DataGridView Control Pin
Henry Minute22-Jun-09 2:07
Henry Minute22-Jun-09 2:07 
QuestionDGV with duplicate rows Pin
cstrader23221-Jun-09 15:04
cstrader23221-Jun-09 15:04 
AnswerRe: DGV with duplicate rows Pin
Luc Pattyn21-Jun-09 15:08
sitebuilderLuc Pattyn21-Jun-09 15:08 
GeneralRe: DGV with duplicate rows Pin
cstrader23221-Jun-09 15:32
cstrader23221-Jun-09 15:32 

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.