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

Accessing variables in referenced class library

Hi,

I have created a class library creating a number of forms and a few public
variables. I have a project that references the .dll for this class
library, and in that project I need to access those public variables.

For instance, the main app calls a form in the referenced library, that form
changes the value of PublicVar1 and then closes. The main app now needs to
know the value of PublicVar1.

How can I do this?

Thanks,
Nathan

Nov 20 '05 #1
1 1183
One way to do it is with show dialog -

Dim frm As New QueryPicker(qoOS, Tables.OSTable.IDFIELD)
If frm.ShowDialog = DialogResult.OK Then
intID = frm.SelectedID
frm.Dispose()
<< do stuff >>
Else
frm.Dispose()
End If

This makes a modal dialog however. If you don't want it to be modal, then
you can have the form raise an event that the main app can catch and handle
appropriately when the user hits OK.

Josh Moody
Developer Division Sustained Engineering Team

--

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
From: "Nathan" <nk*********************@softhome.net>
Subject: Accessing variables in referenced class library
Date: Sun, 1 Feb 2004 21:08:55 -0600
Lines: 17
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <O2**************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: 1Cust68.tnt4.ofallon.mo.da.uu.net 65.239.207.68
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTN GP08.phx.gbl!TK2MSFTNGP11.
phx.gblXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:178200
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hi,

I have created a class library creating a number of forms and a few public
variables. I have a project that references the .dll for this class
library, and in that project I need to access those public variables.

For instance, the main app calls a form in the referenced library, that formchanges the value of PublicVar1 and then closes. The main app now needs to
know the value of PublicVar1.

How can I do this?

Thanks,
Nathan


Nov 20 '05 #2

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

Similar topics

4
by: Alpha | last post by:
Hi, I'm working on different projects that each is a class library which is run off of a main application. Can I change the output path of just the compiled DLL file to the path of the main...
1
by: Ya Ya | last post by:
I am developing a DLL (class library) for a web application of mine. In the web.config of the web application I have set: culture="en-GB" uiCulture="en" in order that the date format will be...
3
by: Random | last post by:
I'm writing a class library for my web app data access, but don't want to hard code the database connection string in the class. Nor do I want to pass the connection string in from the web app...
6
by: Peter Strřiman | last post by:
Hi. I have a situation where I have a web project and a class library in the same solution. The web project uses the class library. Therefore, I created a "project reference" in the web project...
3
by: Martyn Fewtrell | last post by:
Hi there. First of all let me apologise for this is a somewhat general question to which I would be interested in any opinions. As far as I can see when I create a web application the...
5
by: Jesper Schmidt | last post by:
When does CLR performs initialization of static variables in a class library? (1) when the class library is loaded (2) when a static variable is first referenced (3) when... It seems that...
0
by: =?Utf-8?B?bWFuZ29tYW4=?= | last post by:
The connection string used by the typed dataset that is in the Class library is placed in the Settings and then accessed using the generated code. What is the best approach for having the actual...
2
by: Jurek Dabrowski | last post by:
hi all, I have a question in reference to accessing variables in another class maybe someone has dealt with before. I have some public variables declared in my main plug-in class...
4
by: Steve Baer | last post by:
I've already tested this with C# and it works, but I'm being paranoid and I wanted to also check here. Our application has a large class library written in C++/CLI for plug-in projects. The...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.