473,406 Members | 2,312 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,406 software developers and data experts.

VB.net Reference to a non-shared member Error?

I'm new to VB.net and using VB Studio 2008 to experiment with what it takes
to change from VB 6.0. I took a simple VB6 .dll and it converted it into
..net format. There is one error that I don't understand. In the .dll
control (clsWebTalk.vb) I reference a public function (connectToServer) in
a form (frmWebTalk)

I get an error, "Reference to a non-shared member requires an object
reference on the following statement:

call frmWebTalk.connectToServer(serverIP)

Help says, 1. declare the instance as an object variable and 2. Reference
the instance by the variable name.

I tried declaring a form object but apparently didn't do that right either.

Any direction would be greatly appreciated.

sr

Dec 18 '07 #1
1 7764
"Steve Ricketts" <ve*******@hotmail.comschrieb:
I'm new to VB.net and using VB Studio 2008 to experiment with what it
takes to change from VB 6.0. I took a simple VB6 .dll and it converted
it into .net format. There is one error that I don't understand. In the
.dll control (clsWebTalk.vb) I reference a public function
(connectToServer) in a form (frmWebTalk)

I get an error, "Reference to a non-shared member requires an object
reference on the following statement:

call frmWebTalk.connectToServer(serverIP)

Help says, 1. declare the instance as an object variable and 2. Reference
the instance by the variable name.
Try the following:

\\\
Dim f As New frmWebTalk()
f.connectToServer(serverIP)
///

If this doesn't work, try 'My.Forms.frmWebTalk.connectToServer(serverIP)'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Dec 18 '07 #2

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

Similar topics

15
by: David Fisher | last post by:
I have been encouraged by someone else to use a reference rather than a pointer as an "out" parameter to a function, eg. void doStuff(Thing &out1, Thing &out2) as opposed to: void...
3
by: ded' | last post by:
Hello ! I've read in a magazine "reference parameter in operator= must be const, because in C++, temporary objects are const" and then my operator would not work with temporary objets. But,...
5
by: klaus triendl | last post by:
hi, recently i discovered a memory leak in our code; after some investigation i could reduce it to the following problem: return objects of functions are handled as temporary objects, hence...
8
by: SpOiLeR | last post by:
Hello! I have a matrix class like this: class MyObject; // MyMatrix is contains MyObjects class MyMatrix { public: ...
6
by: amparikh | last post by:
I know this is something fundamental and I ought to have known it, but somehow this seems to be confusing me a lot. Fundamentally, rvalues and/or temporaries can be bound only to constant...
3
by: George2 | last post by:
Hello everyone, I am debugging MSDN code from, http://msdn2.microsoft.com/en-us/library/0eestyah(VS.80).aspx here is my output, 1>main.cpp
5
by: George2 | last post by:
Hello everyone, This is my understanding of non-const reference, const reference and their relationships with lvalue/rvalue. Please help to review whether it is correct and feel free to...
1
by: George2 | last post by:
Hello everyone, Is the conclusion correct? Both const reference and non-const reference are lvalue? I think it is true and I can not find a sample which does not follow it.
12
by: Bryan Parkoff | last post by:
I write my large project in C++ source code. My C++ source code contains approximate four thousand small functions. Most of them are inline. I define variables and functions in the global scope....
5
by: Daniel Oberhoff | last post by:
Hi, Can someone more proficient in the details of the c++ type system please tell me how I can instantiate the for constesses of references that I think should be possible: 1. non-constant...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...

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.