Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 19th, 2007, 09:52 PM
Authorized User
 
Join Date: Mar 2007
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default convert C++ syntax to VB .NET

Dear friends,

I wrap an unmanaged VC++ 6.0 class in VB .NET like below :
=============================
Code:
    Declare Function ACR120_ReadATQB Lib "ACR120U.DLL" (ByVal rHandle As Short, ByRef pATQB As Byte) As Short
    Declare Function PICC_RATS Lib "ACR120U.DLL" (ByVal rHandle As Short, ByVal FSDI As Byte, ByRef atslen As Byte, ByRef ats As Byte) As Short
======================================

but when i start coding , i encounter the following difficulties, please kindly help :

Code:
1.
i change pResponseData in C++ becoming pResponseData(0), is this true ?
 
C++
..
if (ACR120_ReadATQB(rHandle, pResponseData)==0) {
ResponseDataLength=7;
// if (ACR120_DirectSend(rHandle, 2, pData, &ResponseDataLength, pResponseData, TimeOut)==0) {
CardFrameSize=pResponseData[10]>>4;
}
..
 
VB
..
If ACR120U.ACR120_ReadATQB(G_rHandle, pResponseData(0)) = 0 Then
ResponseDataLength = 7
CardFrameSize = pResponseData(10) >> 4
End If
..
 
 
2.
i change pResponseData in C++ becoming pResponseData(0), and   &ResponseDataLength (C++) becoming ResponseDataLength(VB), is this true ?
and how to write pResponseData[1]&0x0f;  in VB .NET ??
C++
..
if (PICC_RATS(rHandle, 4, &ResponseDataLength, pResponseData)>=0) {
CardFrameSize=pResponseData[1]&0x0f;
}
..
VB
..
If ACR120U.PICC_RATS(G_rHandle, 4, ResponseDataLength, pResponseData(0)) >= 0 Then
CardFrameSize = pResponseData(1) & 0x0f 
End If
..
 
 
3.
 
And how to write the following statements in VB .NET correctly, i try but they are not right...
 
C++
...
for (i=0; i<ResponseDataLength; i++) {
StrMsg.Format(" %02X", pResponseData[i]);
strcat(pdata,StrMsg);
}
StrMsg.Format("%s = %s", ATS_ATQB, pdata);
LstIndx=m_List.AddString(StrMsg);
...
 
 
my VB .NET code which triggers error : 
..
For i = 0 To ResponseDataLength - 1
pData = pData + pResponseData(i).ToString() + "02X"
Next
ListBox1.Items.Add(ATS_ATQB.ToString + " = " + pData)
..
 
...
 
Thank you,
hendy






Similar Threads
Thread Thread Starter Forum Replies Last Post
convert PHP to VB.NET or C# eugz VB.NET 4 April 24th, 2007 01:12 PM
convert dsr file from vb to vb.net Shashi001 VB Components 1 September 22nd, 2006 12:24 PM
What is the Equivalent Syntax in VB.NET r_taduri VB.NET 2002/2003 Basics 1 June 2nd, 2006 12:49 PM
Syntax Help - Convert C# to VB.NET ank2go ASP.NET 1.0 and 1.1 Professional 3 July 7th, 2004 09:33 PM
Help - Convert from C# to VB.Net CrazyLegsCooper VS.NET 2002/2003 1 July 20th, 2003 10:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.