473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

tfm.dll API call different results on VB6 and VB.Net

Hello There,

I'm coding an application which uses a library, "tfm.dll", to communicate
with a finger print reader.I'm converting the communication API function
declarations from the provided VB6 source codes to VB.Net and having a weird
issue :

The VB6 declaration of these functions are :

Public Declare Function PTInitialize Lib "tfm.dll" (ByVal pMemoryFuncs As
Any) As Long

Public Declare Function PTOpen Lib "tfm.dll" (ByVal pszDsn As String, ByRef
phConnection As Long) As Long

And here's the VB.Net equvalents that I ported :

Public Declare Function PTInitialize Lib "tfm.dll" (ByVal pMemoryFuncs As
Integer) As Integer

Public Declare Function PTOpen Lib "tfm.dll" (ByVal pszDsn As String, ByRef
phConnection As Integer) As Integer

In VB6, these are used to call these functions :

lngResult = PTInitialize(0&)

lngResult = PTOpen(pszDsn, phConnection)

In VB.Net, I use this way :

lngResult = PTInitialize(0) à I also used Nothing as the parameter and both
seems to work.

lngResult = PTOpen(pszDsn, phConnection)

In VB.Net, result of PTOpen always return as communication error where in
VB6 it works fine. The Initialize function works normally in VB.Net as I see
that the communication led on reader gets active when the Initialize
function is called and the return value is 0 which means everything is ok.

Does anybody has any idea why these two environments does not produce the
same result? Maybe some of you who has experience on those kind of ports can
point me to the right direction.

Many thanks in advance...

Özden
Jan 7 '08 #1
1 2257
I believe you should not have ported type "Any" to type "Integer" in
PTInitialize. I think it should be "IntPtr".

"Özden Irmak" wrote:
Hello There,

I'm coding an application which uses a library, "tfm.dll", to communicate
with a finger print reader.I'm converting the communication API function
declarations from the provided VB6 source codes to VB.Net and having a weird
issue :

The VB6 declaration of these functions are :

Public Declare Function PTInitialize Lib "tfm.dll" (ByVal pMemoryFuncs As
Any) As Long

Public Declare Function PTOpen Lib "tfm.dll" (ByVal pszDsn As String, ByRef
phConnection As Long) As Long

And here's the VB.Net equvalents that I ported :

Public Declare Function PTInitialize Lib "tfm.dll" (ByVal pMemoryFuncs As
Integer) As Integer

Public Declare Function PTOpen Lib "tfm.dll" (ByVal pszDsn As String, ByRef
phConnection As Integer) As Integer

In VB6, these are used to call these functions :

lngResult = PTInitialize(0&)

lngResult = PTOpen(pszDsn, phConnection)

In VB.Net, I use this way :

lngResult = PTInitialize(0) Ã* I also used Nothing as the parameter and both
seems to work.

lngResult = PTOpen(pszDsn, phConnection)

In VB.Net, result of PTOpen always return as communication error where in
VB6 it works fine. The Initialize function works normally in VB.Net as I see
that the communication led on reader gets active when the Initialize
function is called and the return value is 0 which means everything is ok.

Does anybody has any idea why these two environments does not produce the
same result? Maybe some of you who has experience on those kind of ports can
point me to the right direction.

Many thanks in advance...

Özden
Jan 7 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Hubert Baumeister | last post by:
Fifth International Conference on eXtreme Programming and Agile Processes in Software Engineering XP2004 June 6-10, 2004, Garmisch-Partenkirchen, Germany http://www.xp2004.org/
2
by: Jason Gates | last post by:
Dear all I have written a very complex web app for intranet use. It allows users to search a large database and then returns formatted results. I am currently employing a method as below: 1....
12
by: Gustavo L. Fabro | last post by:
Greetings! Getting straight to the point, here are the results of my experiment. I've included my comments and questions after them. The timing: (The total time means the sum of each line's...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
3
by: cberthu | last post by:
Hi all, Is it possible to have two connects in the same rexx script to different DB's? I have to get data form on DB (with specifics selects and filter out some values with RExx) and save the...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
6
by: plork | last post by:
hi all i'm calling a web service method and can get it's results just fine however i want to grab the repsonse message from the call is anyone able to tell me how i do this? results =...
9
by: Yannick | last post by:
Hi everyone - I am not quite sure to understand what is really going on when a function defined in one translation unit calls a function defined in a different translation unit without knowing...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.