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

Visual Basic

 
GeneralRe: convert visual basic 6.0 to visual basic 2010 Pin
kikyamelia18-Jan-14 20:21
kikyamelia18-Jan-14 20:21 
GeneralRe: convert visual basic 6.0 to visual basic 2010 Pin
Peter Leow18-Jan-14 20:36
professionalPeter Leow18-Jan-14 20:36 
AnswerRe: convert visual basic 6.0 to visual basic 2010 Pin
Eldar Zeynalov24-Jan-14 19:03
Eldar Zeynalov24-Jan-14 19:03 
AnswerRe: convert visual basic 6.0 to visual basic 2010 Pin
TheComputerMan31-Jan-14 5:07
TheComputerMan31-Jan-14 5:07 
QuestionSub reports Pin
Tsunamipudip17-Jan-14 2:10
Tsunamipudip17-Jan-14 2:10 
QuestionDelegates & Pointers Pin
Synth_Boy16-Jan-14 2:14
Synth_Boy16-Jan-14 2:14 
AnswerRe: Delegates & Pointers Pin
Paulo Zemek16-Jan-14 3:17
mvaPaulo Zemek16-Jan-14 3:17 
GeneralRe: Delegates & Pointers Pin
Synth_Boy16-Jan-14 4:20
Synth_Boy16-Jan-14 4:20 
Ok, that is what i had to start with;

XML
<DllImport("myCom.dll", CharSet:=CharSet.Unicode)> Public Function RFID_Comms(ByVal sTx As IntPtr, ByVal sRx As IntPtr, ByVal sRxSize As UShort, ByVal timeout As UShort) As Integer
   End Function


And the call....

VB
sTx = Marshal.AllocHGlobal(100)
       sRx = Marshal.AllocHGlobal(300)
       sTx = StringToBSTR("RSD" & vbCr)
       result = RFID_Comms(sTx, sRx, 3000, 1000)
       lblOuput.Text = "Result: " & result
       txtBxOutput.Text = PtrToStringUni(sRx)


AS i was getting a timeout error return code (result) i assumed i was going asbout it the wrong way.
Though i should have trusted myself as this code works (obtaining some version info from the DLL);

XML
<DllImport("myCom.dll", CharSet:=CharSet.Unicode)> Function RFID_wGetVersion(ByVal s As IntPtr, ByVal size As UShort) As Integer
   End Function

VB
Dim memString As String 
        Dim addrPTr As IntPtr = Marshal.AllocHGlobal(40) 
        res = RFIDP1_wGetVersion(addrPTr, 40)
        memString = PtrToStringUni(addrPTr)

        lblOuput.Text = "Result: " & res
        txtBxOutput.Text = memString
        lblOuput.Refresh()
        Marshal.FreeHGlobal(addrPTr)


You may have guessed but this prog reads an RFID tag. It is possible i'm missing another command (switch on and the like). I will persevere and recheck the other requisites for tag reading and post back. Thank you for confirming my initial thoughts and that I had got the function correct!
AnswerRe: Delegates & Pointers Pin
Dave Kreskowiak16-Jan-14 3:31
mveDave Kreskowiak16-Jan-14 3:31 
GeneralRe: Delegates & Pointers Pin
Synth_Boy16-Jan-14 4:24
Synth_Boy16-Jan-14 4:24 
GeneralRe: Delegates & Pointers Pin
Ron Beyer16-Jan-14 4:50
professionalRon Beyer16-Jan-14 4:50 
GeneralRe: Delegates & Pointers Pin
Synth_Boy16-Jan-14 5:15
Synth_Boy16-Jan-14 5:15 
GeneralRe: Delegates & Pointers Pin
Ron Beyer16-Jan-14 5:17
professionalRon Beyer16-Jan-14 5:17 
GeneralRe: Delegates & Pointers Pin
Synth_Boy16-Jan-14 6:03
Synth_Boy16-Jan-14 6:03 
AnswerRe: Delegates & Pointers Pin
Synth_Boy30-Jan-14 22:02
Synth_Boy30-Jan-14 22:02 
QuestionVb script Pin
Member 1052588115-Jan-14 4:25
Member 1052588115-Jan-14 4:25 
AnswerRe: Vb script Pin
Dave Kreskowiak15-Jan-14 4:38
mveDave Kreskowiak15-Jan-14 4:38 
AnswerRe: Vb script Pin
Ron Beyer15-Jan-14 5:00
professionalRon Beyer15-Jan-14 5:00 
Questionexe file Pin
Member 1052323315-Jan-14 2:23
Member 1052323315-Jan-14 2:23 
AnswerRe: exe file Pin
thatraja15-Jan-14 2:31
professionalthatraja15-Jan-14 2:31 
Questionvb 6.0 birthday reminder form code Pin
akcworld14-Jan-14 18:00
akcworld14-Jan-14 18:00 
AnswerRe: vb 6.0 birthday reminder form code Pin
Dave Kreskowiak14-Jan-14 18:13
mveDave Kreskowiak14-Jan-14 18:13 
Generalvisual basic 2010 homework Pin
Member 1052356014-Jan-14 5:10
Member 1052356014-Jan-14 5:10 
GeneralRe: visual basic 2010 homework Pin
Ron Beyer14-Jan-14 5:15
professionalRon Beyer14-Jan-14 5:15 
GeneralRe: visual basic 2010 homework Pin
Member 1052356014-Jan-14 5:21
Member 1052356014-Jan-14 5:21 

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.