473,440 Members | 1,659 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,440 software developers and data experts.

Upgrading VB6 --> .Net 1.1: How to make a property set ByRef?

My VB6 application has some properties which are set ByRef but upgrade to
ByVal. [I read in the documentation that Property SET ByRef is not allowed
in VB.Net] How can I assure that the new code behaves the same as the old?
Nov 23 '05 #1
1 4094
"katzky" <ka****@discussions.microsoft.com> wrote in message
news:42**********************************@microsof t.com...
My VB6 application has some properties which are set ByRef but upgrade to
ByVal. [I read in the documentation that Property SET ByRef is not
allowed
in VB.Net] How can I assure that the new code behaves the same as the
old?


How did the old code behave? The only reason I can think of to support ByRef
property assignments would be for array support.

Were you manipulating the values before returning in VB6? If so, that
doesn't seem to work in VB6 either....
'======
Option Explicit

Private msTest As String

Public Property Get Test() As String
Test = msTest
End Property

Public Property Let Test(ByRef Setting As String)
msTest = Setting
'attempt to manipulate the ByRef variable
Setting = "Property has been set"
End Property

Private Sub Form_Load()
Dim s As String

s = "This is a test"

Test = s

'shows "This is a test", instead of the expected "Property has been set"
Debug.Print s

End Sub
'======

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
Nov 23 '05 #2

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

Similar topics

22
by: Dr Duck | last post by:
GDay all, Something seems odd to me.... I wrote a simple C# function public void bind(ref object a, ref object b, bool atob) { if(atob) b = a; else
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.