473,513 Members | 2,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Global user type definition

Ole
Hi,

Is it possible to create a type that I can import in any solution and user
control etc so that it can be used the same way as system types (like Int32,
String etc.)?

Thanks,
Ole
Mar 23 '07 #1
2 1699
Sure - just declare a type in a library assembly (dll), and reference
it from the other projects. Job done. Types that represent small
values "like numbers" are generally structs, and are almost always
immutable. But most user types should be classes. If in doubt, it
should probably be a class. Have I understood correctly?

Marc

Mar 23 '07 #2
Ole
Yes - you understood exactly what I meant - thanks!

My user type is a class, so theree'll be no problem.

Thanks
Ole

"Marc Gravell" <ma**********@gmail.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
Sure - just declare a type in a library assembly (dll), and reference
it from the other projects. Job done. Types that represent small
values "like numbers" are generally structs, and are almost always
immutable. But most user types should be classes. If in doubt, it
should probably be a class. Have I understood correctly?

Marc

Mar 23 '07 #3

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

Similar topics

3
6403
by: Eric Lilja | last post by:
Hello, I have a few global variables in my program. One of them holds the name of the application and it's defined in a header file globals.hpp (and the point of definition also happen to be the...
2
7500
by: Tony Johansson | last post by:
Hello! I'm reading a book about C++ and there is something that I don't understand so I ask you. Below I have the text from the book and the code from the file where main is located and some...
13
3054
by: Sunil | last post by:
Hi all, I want to know how good or bad it is using global variables i.e advantages and disadvantages of using global variables. Sunil.
5
3928
by: WJ | last post by:
I am attempting to use the Global.Asax to store my user's configuration. Here is the concept: 1. User logs on into the site using Form Authentication. 2. I capture the user Credential, verify it...
5
1817
by: Preets | last post by:
Is the v-table, that gets generated by the compilation of a class having virtual functions, global ? Why and how ?
8
1693
by: Jose Cintron | last post by:
Hello all. Newbie question here... I have a program that needs to do 1 of 2 things 1. declare a global System::String (which I think can't be done, because VS 2005 complains) 2. modify the...
10
3481
by: subramanian100in | last post by:
Suppose I declare a global variable int g; in two different files say a.c which has main() and b.c When I compile them to build an executable under gcc in Redhat Linux with the command ...
1
29312
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
3
2717
by: parag_paul | last post by:
hi All for the following #include <stdio.h> typedef struct{ int a ; int b; char* j; } AST;
112
5351
by: istillshine | last post by:
When I control if I print messages, I usually use a global variable "int silent". When I set "-silent" flag in my command line parameters, I set silent = 1 in my main.c. I have many functions...
0
7153
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
7373
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,...
1
7094
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
5677
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,...
1
5079
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
4743
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
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
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...

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.