Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
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 January 23rd, 2004, 04:48 PM
Registered User
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default vb6 to vb.net conversion question

I have a vb6 appl that I am converting to vb.net. I am having trouble replacing/converting vb6 use of the LSet stmt (LSet is not supported in vb.net). Does anyone have any ideas?
Thanks!

The vb6 code uses the following public types:
Public Type SecurityAccessProps
    strUserName As String * 30
    strApplID As String * 30
    strApplType As String * 1
    strApplDesc As String * 50
    lngAccessLevel As Long
    dtDateLastUpdated As Date
    strLastUpdatedBy As String * 30
    dtDateCreated As Date
    strCreatedBy As String * 30
    blnIsNew As Boolean
    blnIsDeleted As Boolean
    blnIsDirty As Boolean
End Type

Public Type SecurityAccessBuffer
    strBuffer As String * 186
End Type
__________________________________________________ ___

The vb6 code is as follows:

Private mudtProps As SecurityAccessProps

Private Sub SetState(strBuffer As String)
    Const SUB_NAME = "SetState"
    Dim udtData As SecurityAccessBuffer

    udtData.strBuffer = strBuffer
    LSet mudtProps = udtData
End Sub

Private Function GetState() As String
    Const SUB_NAME = "GetState"
    Dim udtData As SecurityAccessBuffer

    LSet udtData = mudtProps
    GetState = udtData.strBuffer

End Function

Is there a way in vb6 to re-write/replace the LSet stmt so the udtdata string buffer can be assigned the SecurityAccessType data and vice versa for the SetState & GetState functions? I need to keep the String functionality of the SetState & GetState functions.
OR ...
Is there a way to convert this code to vb.net without the LSet stmt? Again, I need to keep SetState & GetState as Strings.

Thanks
Tomz

 
Old January 26th, 2004, 11:49 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Pardon my ignorance, I didn't have the pleasure of working with VB a whole lot.

What is LSet? Goggle spit back this which might help you:
http://www.dotnet247.com/247referenc...38/192700.aspx

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old January 28th, 2004, 10:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Personally, I wouldn't try to Port anything over- I'd rewrite.. it's usually less work.


Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee





Similar Threads
Thread Thread Starter Forum Replies Last Post
VB 2005 question, binary to text file conversion pitcher General .NET 0 September 24th, 2007 07:45 PM
File Conversion in VB.net? yuvin Visual Studio 2005 1 February 5th, 2007 03:36 PM
Help w/conversion from C# to VB.NET kwilliams VB.NET 9 October 16th, 2006 12:06 PM
Conversion from .Net 2003 to .Net 2005 using VB.Ne coleenh Visual Basic 2005 Basics 0 September 19th, 2006 02:48 PM
Should I go VB.NET or VB 2005 from VB6? HB Visual Studio 2005 1 December 9th, 2005 03:13 AM





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