Click here to Skip to main content
15,926,939 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: temp converter Pin
drdon3618-Feb-06 23:28
drdon3618-Feb-06 23:28 
QuestionCrystal Reports Save method doesn't work Pin
sagmam18-Feb-06 22:48
sagmam18-Feb-06 22:48 
Questionport programming Pin
sarahmeshte18-Feb-06 20:37
sarahmeshte18-Feb-06 20:37 
AnswerRe: port programming Pin
progload19-Feb-06 5:14
progload19-Feb-06 5:14 
Questionmultimedia database in vb.net code Pin
sarahmeshte18-Feb-06 20:23
sarahmeshte18-Feb-06 20:23 
Questionvisual brush.. Pin
peter rankel18-Feb-06 19:23
peter rankel18-Feb-06 19:23 
AnswerRe: visual brush.. Pin
progload19-Feb-06 6:04
progload19-Feb-06 6:04 
QuestionNeed help with the obsolete VarPtr routine from VB6 Pin
kil0byte^bandit18-Feb-06 18:21
kil0byte^bandit18-Feb-06 18:21 
Hi guys,
So I'm trying to code a sample application for a fingerprint scanner that I recently bought from supremainc.com. Now the sample they provided alongwith is in VB6. I've been successfully able to convert most of the code to VB.NET. The part upto capturing an image is working fine. But when it comes to verification, the old VB6 code uses the VarPtr function - which isn't there in .NET anymore.

Now testing the sample application won't be possible for any of you - coz you'd need the actual device to get it working. But still I'm including the code for both VB6 and .NET here - at least looking at it might help.

Searching for a VarPtr replacement, I came across this code from PlanetSourceCode
===========================================================================
Public Function VarPtr(ByVal o As Object) As Integer

Dim GC As System.Runtime.InteropServices.GCHandle = _
System.Runtime.InteropServices.GCHandle.Alloc _
(o, System.Runtime.InteropServices.GCHandleType.Pinned)

Dim ret As Integer = GC.AddrOfPinnedObject.ToInt32

GC.Free()

Return ret

End Function
===========================================================================



The VB6 code contains this segment:
===========================================================================

Private EnrollTemplate(383, 9) As Byte
.......
.....
Dim Buffer(9) As Long
............

For i = 0 To 9
Buffer(i) = VarPtr(EnrollTemplate(0, i))
Next i
===========================================================================


So I used that in my VB.NET application - and am calling the routine this way:
===========================================================================

Private EnrollTemplate(383, NUM_RECORDS) As Byte
............
Dim Buffer(10) As Integer
...............
For Counter As Integer = 0 To NUM_RECORDS - 1
Buffer(Counter) = VarPtr(CType(EnrollTemplate(0, Counter), Object))
Next
===========================================================================

But it doesn't seem to have the same effect - so my verification is failing.

Also as per the discussion in this thread: http://www.vbcity.com/forums/topic.asp?tid=121051 I've converted the Long variables in the VB6 code to Integer for VB.NET. The code samples (full) I'm talking about can be found attached to the vbCity thread, as the posts here don't permit attachments.

Please find both versions of the project included as .zip attachments. Kindly take a look at them and see if any of you can spot what's going wrong. I know it's difficult to do so - without the code actually running.. but still.

In case you want to look into the Scanner SDK API calls, I'm including the API documentation too in form of a .PDF file.

Any help will be greatly appreciated. Please check out the discussion in the vbCity thread first and go through the code files.

Best Regards & Thanks,
kil0byte^bandit Big Grin | :-D

PeoPLe aRe cRazY anD tiMeS aRe sTRaNGe, i'M LoCKeD iN tiGhT, i'M OuT oF raNGe, i uSeD t0 caRe BuT - thiNGs haVe chaNGeD.

-- modified at 0:21 Sunday 19th February, 2006
QuestionCreating A Thread for The Main form of the Project!! Pin
Devraj Raut18-Feb-06 8:23
Devraj Raut18-Feb-06 8:23 
AnswerRe: Creating A Thread for The Main form of the Project!! Pin
Joshua Quick18-Feb-06 10:19
Joshua Quick18-Feb-06 10:19 
Questioncatching the passed filename Pin
Pruck18-Feb-06 6:57
Pruck18-Feb-06 6:57 
AnswerRe: catching the passed filename Pin
Joshua Quick18-Feb-06 10:03
Joshua Quick18-Feb-06 10:03 
QuestionRe: catching the passed filename Pin
Pruck18-Feb-06 11:10
Pruck18-Feb-06 11:10 
AnswerRe: catching the passed filename Pin
Joshua Quick18-Feb-06 11:38
Joshua Quick18-Feb-06 11:38 
GeneralRe: catching the passed filename Pin
Pruck18-Feb-06 15:05
Pruck18-Feb-06 15:05 
GeneralRe: catching the passed filename Pin
Joshua Quick18-Feb-06 15:26
Joshua Quick18-Feb-06 15:26 
GeneralRe: catching the passed filename Pin
Pruck18-Feb-06 15:55
Pruck18-Feb-06 15:55 
QuestionControl internet using vb.net and sql server Pin
Mekong River18-Feb-06 5:13
Mekong River18-Feb-06 5:13 
AnswerRe: Control internet using vb.net and sql server Pin
Dave Kreskowiak19-Feb-06 7:37
mveDave Kreskowiak19-Feb-06 7:37 
GeneralRe: Control internet using vb.net and sql server Pin
Mekong River19-Feb-06 12:13
Mekong River19-Feb-06 12:13 
GeneralRe: Control internet using vb.net and sql server Pin
Dave Kreskowiak19-Feb-06 14:59
mveDave Kreskowiak19-Feb-06 14:59 
Questionwhere to place commmon code Pin
_tasleem18-Feb-06 4:44
_tasleem18-Feb-06 4:44 
AnswerRe: where to place commmon code Pin
Mekong River18-Feb-06 5:18
Mekong River18-Feb-06 5:18 
GeneralRe: where to place commmon code Pin
Dave Kreskowiak19-Feb-06 7:25
mveDave Kreskowiak19-Feb-06 7:25 
AnswerRe: where to place commmon code Pin
Dave Kreskowiak19-Feb-06 7:30
mveDave Kreskowiak19-Feb-06 7:30 

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.