473,569 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MyDialog and MyClass.cs share a member

Hi,

I've created a windows form application. I have a form and a .cs file
in the application, and I've renamed them to MyDialog and MyClass.cs.

In MyClass.cs, I have a member called "Publisher" and I assign value
to this member in MyClass.cs.

In MyDialog (upon a button click), I'll need to use the current value
of "Publisher" from MyClass.cs. But I don't know how. Anyone can
help?

FYI, my code is below:

namespace MyNamespace
{
public class MyClass
{
string Publisher;

public MyClass()
{

Publisher = String.Format(" _FTDIALOG_{0}",
TritonObjectMan ager.User.GetFi eld("RTGRP").To String().ToUppe r());

Logger.LogMessa geBarMessage(ES everity.Detail, "In MyClass --
Publisher: " + Publisher + "|");

}
}
}

namespace MyNamespace
{
public partial class MyDialog : Form
{
string Publisher;

public MyDialog()
{
InitializeCompo nent();
}

private void btExecute_Click (object sender, EventArgs e)
{

//Need to get the value of Publisher from MyClass here!
// How to use the current value of Publisher from MyClass?

Logger.LogMessa geBarMessage(ES everity.Detail, "In MyDialog --
Publisher: " + Publisher + "|");
}
}
}

Oct 9 '08 #1
0 1297

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

Similar topics

32
2703
by: Mario Fratelli | last post by:
MyClass *p = new MyClass; MyClass *p = new MyClass(); do they mean something different? Thanks a lot, Mario Fratelli.
1
1200
by: Dave | last post by:
Hello all, Below is an adaptation of an example Victor gave for testing compiler behavior with regard to the issue of the difference between new MyClass; and new MyClass();. I have included in comment form the behavior on my platform. Is this behavior that of C++98, C++2003 or neither?
5
1620
by: modemer | last post by:
I saw someone use the following code: void func(MyClass *& myCls) { myCls->test(); } // call func(): func(new MyClass);
11
2498
by: modemer | last post by:
If I define the following codes: void f(const MyClass & in) {cout << "f(const)\n";} void f(MyClass in) {cout<<"f()\n";} MyClass myclass; f(myclass); Compiler complain that it can't find the best match. Anyone could give a detail explanation in theory? Which one is good?
4
2397
by: John | last post by:
I have a function declaration that gives an error while compiling. Can anyone help me figure this one out? inline void create(const std::vector< myclass >& plist, std::vector< myclass >::iterator left, std::vector< myclass >::iterator right); x.hpp:153: error: `class std::vector<myclass, D>, std::alloca
24
3552
by: Water Cooler v2 | last post by:
What is the difference between the Me and the MyClass keywords? I understand Me that it represents the specific instance of the class. When you're inside the object instance, it refers to itself using the Me keyword. What is the MyClass keyword used for?
5
1875
by: tom | last post by:
Hi, I'm overriding my operator new and operator delete for two classes, one inherited from the other, so I can use my own memory pool. A simplified version of what I have is below: class BaseClass { BaseClass(); virtual ~BaseClass(); virtual void baseFunction();
6
2172
by: Immortal Nephi | last post by:
First class is the base class. It has two data: m_Base1 and m_Base2. Second class and third class are derived classes and they are derived from first class. m_Base1 and m_Base2 are inherited into two derived classes. Second class has its own m_Base1 and m_Base2 and third class does the same. I am curious. How can second class and third...
2
5315
by: unauthorized | last post by:
The short story: I need to be able to cast a function pointer for any function and class to an intermediate type, so I could call it from any point of my program using the "__asm call" instruction. The long story: I have been trying to develop a data driven method to call C++ functions, that allows calling them with minimal overhead. The...
0
7700
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.