p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   VB.NET 2002/2003 Basics (http://p2p.wrox.com/forumdisplay.php?f=76)
-   -   vb6 to vb.net conversion question (http://p2p.wrox.com/showthread.php?t=8527)

tomz January 23rd, 2004 04:48 PM

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?

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.


planoie January 26th, 2004 11:49 AM

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:

Work smarter, not harder.

Hal Levy January 28th, 2004 10:51 AM

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

All times are GMT -4. The time now is 07:53 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.