Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 23rd, 2004, 04:48 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old January 26th, 2004, 11:49 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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.
Reply With Quote
  #3 (permalink)  
Old January 28th, 2004, 10:51 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:45 PM.


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