|
You can just disable the specific warnings in the compiler options.
|
|
|
|
|
But I don't want to disable all enum XML comment warnings... I only want to suppress the warnings for this specific enumeration.
Thanks for your reply and best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hi
There's no way to do what you want in .Net 1.1.
In .Net 2.0 you can use #pragma warning .
----------------------------
Be excellent to each other
EasiReports[^] My free reporting component for WinForms.
|
|
|
|
|
I'm using .NET 2.0.
Thanks for the tip! Works perfectly
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
hello all and thank you for your efforts
i am having a problem with declaring and using delegates. and what is the relation bet delegates and events in general.
what is a delegate?
what is an event in relation to delegates?
thank you very much
abdelhameed81@yahoo.com
abdelhameed81
|
|
|
|
|
|
hi
how to create and extract ISO file using c# technology
thanks
Raj
Project Leader
india
small
|
|
|
|
|
hi guys
if any one knows how to create virtual dirve using c# e.g. mount and unmount etc..
Rah
Project Leader
India
small
|
|
|
|
|
I'm testing this code and all I get is a freaking unhandled FormatException, I don't know why but it tries to parse an int from the string I send as parameter. Why is this happening?
<br />
PerformanceCounter pc = new PerformanceCounter( "Memory", "Available MBytes" );<br />
try<br />
{<br />
Console.WriteLine( "Available RAM: " + pc.NextValue().ToString() + "MB" );<br />
}<br />
catch (Exception e)<br />
{<br />
Console.WriteLine(e.ToString());<br />
finally<br />
{<br />
pc.Close();<br />
}<br />
The exception: System.FormatException was unhandled.
Message="Input string was not in a correct format."
at System.Int32.Parse(String s, IFormatProvider provider)
at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)
at System.Diagnostics.PerformanceCounterLib.get_NameTable()
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
at System.Diagnostics.PerformanceCounterLib.CounterExists(String category, String counter, Boolean& categoryExists)
Thankful for any help. Is this class supposed to be used in another fashion since 2.0?
|
|
|
|
|
hi
i tried to insert to listview for each row a new image when i try to do it i see always the same image
what do i need to do?
thanks
have a nice day
|
|
|
|
|
How do I do voice chat.
How to convert voice into bytes.
Any Idea abt this .Please send me.
|
|
|
|
|
If you have got some solution for Voice Chat. Please also let me know how to do that. How are you capturing sound from Mic? if you are ready to convert it to byts? Please also help me if you get some clue. Thanks in advance.
Best Regards,
Rizwan Ahmed
|
|
|
|
|
Do one thing. Download VaxVoIP SDK from net. I think google search will help you to do that. VoIP is the better way of communication through Voic and text
.
Cheers
|
|
|
|
|
I have to view all drives,directories,files of a remote machine in to my
local machine.How can I do that in use of Tcp socket.
Deepthi
|
|
|
|
|
In my point of view, Remoting will be the simplest way to do that.
You can find a lot of articles on coderproject on remoting.
The idea is:
1) you'll write a remotable object (dll) with some function who gets this information from the local computer and returns this information to its caller. This information must be in serailizable form. you can use XML or even a string as a return type. All you need is to re calculalte you information from that returned value back.
2) A Server will expose this object to be called by the clients on a specific URI.
3) Client will use a proxy of that remotable object and connect to the server by registering a channel and Call that method remotely just like its a local function of it, get the required information.
I have tried to give you some idea. Please read some article about remoting. You'll achieve your goal within 30 minutes for sure after understanding remoting.
Best Regards,
Rizwan
|
|
|
|
|
Hi ...
I'm having trouble setting the values of the array in my class.
I tried this ... and i can set/get "x.name" but pgm crashes with an error message that says i do not have an instance of the array item when i try to set "x.number[1]".
namespace WindowsApplication1
{
public partial class Form1 : Form
{
class myClass
{
// fields
private string _name;
private double[] _number;
// properties
public string name
{
get { return _name; }
set { _name = value; }
}
public double[] number;
public double this[int index]
{
get { return _number[index]; }
set { _number[index] = value; }
}
// Default constructor:
public myClass()
{
name = "";
double[] number = new double[5];
number[0] = 0;
number[1] = 0;
number[2] = 0;
number[3] = 0;
number[4] = 0;
}
// Clear Numbers
public void ClearNumbers()
{
double[] number = new double[5];
number[0] = 0;
number[1] = 0;
number[2] = 0;
number[3] = 0;
number[4] = 0;
}
}
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
myClass x = new myClass();
x.name = "Charlie";
x.number[1] = 123.45;
}
}
}
My program works on x.name = "Charlie";
My program fails on x.number[1] = 123.45;
Please advise on how to fix my class definition to accomodate arrays.
Thank you.
-- modified at 10:17 Saturday 25th March, 2006
|
|
|
|
|
The code in the constructor is not even possible to compile. Why don't you show the code that you really are using?
I assume that the code in the constructor looks like the code in the ClearNumbers method, as that at least compiles...
You have two array references in the class, _number and number. You never assign anything to any of them, so of course you get an error message when you try to use any of them. If you look at the task list after compiling, you will see that the compiler has given you very informative warnings about this.
---
b { font-weight: normal; }
|
|
|
|
|
Sorry ... i have corrected the original post.
i should have just copy/pasted the whole original .. i did not actually save that much space when i copied just part of the problem ... and i introduced an error.
Thank you for pointing that out.
As you can tell ... i am a newbie at class definitions. I have no idea why the underscore character precedes the field names and then (if needed at all) why it is not used in EVERY reference to the field.
But not having a knowledgeable mentor ... i am subject to the problems associated with "mimicking" what i have seen in other class definitions.
I think u get the idea of what i am trying to accomplsh. Please suggest code change to the class so the button code works.
Thanks.
|
|
|
|
|
You have two arrays, like Guffa said, number and _number and you dont assign anything to either of them. The fact that they have the same name, give or take an underscore, means nothing, they are completely different variables that are in no way related to each other.
Your code crashes on x.number[1] because you havent initialised number to anything, and so it is currently null . So trying to access the second value of it will crash because there is no second element. Try the following code, is should work...
class myClass
{
private string _name;
private double[] _number = new double[5];
public string name
{
get { return _name; }
set { _name = value; }
}
public double[] number
{
get { return _number; }
set { _number = value; }
}
public double this[int index]
{
get { return _number[index]; }
set { _number[index] = value; }
}
public myClass()
{
name = "";
_number[0] = 0;
_number[1] = 0;
_number[2] = 0;
_number[3] = 0;
_number[4] = 0;
}
public void ClearNumbers()
{
_number[0] = 0;
_number[1] = 0;
_number[2] = 0;
_number[3] = 0;
_number[4] = 0;
}
} Hope that helps
Cheers,
Will H
|
|
|
|
|
Thank you so VERY much, Will ! Your suggestions work great!
I still do not understand the use of "this" in the code block ...
public double this[int index]
{
get { return _number[index]; }
set { _number[index] = value; }
}
... but for the time being, until i get that understanding, i can mimic what u showed me for future class definitions.
Your help is much appreciated!
|
|
|
|
|
That code block is there so that you can access myClass as though it was an array itself. It means that if you create an instance of myClass like so
myClass foo = new myClass(); then you can access your _number array in two ways. Like this...
double firstElement = foo.number[0]; and also like this...
double firstElement = foo[0]; The last way is only allowed because of the 'public double this[int index] ' accessor.
Glad I could help
Cheers,
Will H
|
|
|
|
|
Hey guys, is it possible to Dial a Number Using C# and be able to speak with the other person, using C#.
I'm writting a PhoneBook application i want to be a ble to search a number an dbe able to dial it.
By the way i want to have a help for my project, I haven't done such thing before, what's the best way fo doing so ?
I'd be grateful
|
|
|
|
|
How could i select a single speaker to play a sound with DirectSound?
I've a 5.1 soundcard which is configured as sorround sound, so that i can use the 6 outputs. This card appears in the system as one device (i have another 5.1 card and, with special drivers, it appears as 3 stereo devices, so it s easier to use, but i cannot use these drivers on the first card) and ive seen an application which can play a sound to a single speaker, so i should be able to do it too.
Ive thought about playing the sound as a 3D sound and selecting its position, but i dont think it s a good idea.
Any idea? Thx
|
|
|
|
|
hello all in codeproject,
i am new to the programming field and i would like to know more about how to use constructors and why do we use them regarding the idea that we can initialize our variables in any section without using constructors.
thank you for your concern
abdelhameed81@yahoo.com
abdelhameed
|
|
|
|
|
abdelhameed81 wrote: how to use constructors
See the program class to see how to use constructors
public class A
{
private string myText;
public A(string someText)
{
this.myText = someText;
}
public void WriteMyText()
{
Console.WriteLine(someText);
}
}
public class Program
{
public static void Main()
{
A a = new A("Hello World");
a.WriteMyText();
}
}
abdelhameed81 wrote: why do we use them regarding the idea that we can initialize our variables in any section without using constructors.
Because it is good practice to initialise the fields to something sensible. The CLR will initialise the fields to default values if you don't set them. e.g. an int will be set to 0 , a string to "" and so on. But they may not be sensible for your application.
In objects that are immutable there is no opportunity to set the fields after the constructor has setup the object. The very nature of an immutable object is that it does not change. So it MUST set the class fields at construction. For example the string class is immutable, you cannot change a string object, you can only create new string objects.
Sometimes you may have a situation where a field is a lazy lookup because it isn't used often and it takes a long time to retrieve the value. In that case it would be initialised to null (if it is a reference type) and the getter property would do the lookup and cache the value in the field when it has been retrieved.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|