|
thanx I still have to try the second part, but I think loading the whole Xml document in a string in uneccary.. (I think). You can use the xmlTeaxtReader.Read(); method in the while loop right?
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
XPath!
eg XmlDocument.SelectNodes("nodename");
XPath syntax is beyond the scope of a forum post, I suggest you get the docs from the w3c. Its suprisingly not difficult and just looking at few examples will get you on the way.
Note: if you gonna using xmlns, then u need to specify an explicit prefix for the Xpath to work, and pass an XmlNamespaceManager instance to the function.
top secret xacc-ide 0.0.1
|
|
|
|
|
ok thanx.. I know a little bit of XPath, but I hav'nt used it in C#
Any tutorials on using it in C# please.
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
The problem I'm facing is as follows:
I have two classes: cBiquad and cFilter.
The cBiquad class has five properties that have get/set capabilities.
In the cFilter constructor, I have defined an array of cBiquad objects as follows:
cBiquad[] arrBiquads = null;
for ( i = 0; i < mnBiquads; i++ )
{
arrBiquads[i] = new cBiquad();
}
Now in one of the methods in the cFilter class - SetParameters(), no arguments - I need to set the five properties of the cBiquad objects.
However, when I attempt to do the following:
for ( i = 0; i < mnBiquads; i++ )
{
arrBiquads[i].Property1 = Prop1Value; //etc
}
I receive the following error message:
The name 'arrBiquads' does not exist in the class or namespace 'DSP.cFilter'
What should I do to get around this?
|
|
|
|
|
put this statement
<br />
cBiquad[] arrBiquads = null;<br />
outside of the constructor, instead of inside it. If it's inside the constructor it will only
be visible to code also in constructor.
<br />
public cFilter()<br />
{<br />
arrBiQuads = new cBiQuad[mnBiquads];<br />
for ( i = 0; i < mnBiquads; i++ )<br />
arrBiquads[i] = new cBiquad();<br />
}<br />
Hope it works better now..
|
|
|
|
|
If you define the array of cBiquad objects in the constructor it's only a local variable and no longer accessible as soon as the constructor scope is left.
You have to define a class variable for the array.
You will also have to initialize your array before you create it's members.
cBiquad[] arrBiquads = new cBiquad[mnBiquads];
for ( i = 0; i < mnBiquads; i++ )
{
arrBiquads[i] = new cBiquad();
}
www.troschuetz.de
|
|
|
|
|
Is there a designer like "the MMC Snap-in Designer for VB6" for any .NET environment?
|
|
|
|
|
hello
i am looking for a math algorithm or a code in c# to find a specific floating number in floating number limit and this in minimum tries(somthing short smart and simple)
thanks tzahi
|
|
|
|
|
hi ,
Ur question is incomplete. u have given the Range of ur output. ( within the limits of floating point values ). What are ur domains ? ( input ).
What u want exactly .
Praseed Pai
www.praseedpai.com
|
|
|
|
|
I'm trying to port some old C++ code to C#.
I have a few classes that were defined in a ".h" file. Their constructors and member variables were defined in the corresponding .cpp file.
What is the best way to port this file to C#. More specifically:
1. I assume that the class, its constructor and methods are all defined together as follows:
class DSP
{
// constructor
// methods
}
Is this correct?
2. The original C++ listing in the .h file is as follows:
class DSP
{
public:
// public variables
protected:
//constructor
// destructor
// private variables
void SomeMethod()
};
These public variables need to be properties that can be assigned to. Therefore in the C# implementation, do I need to define these fields with "get" and "set" properties?
I know these are very elementary questions, but I haven't ported any C++ code over to C# before, and I appreciate your help!
|
|
|
|
|
C# classes do not have header files, pretty much anything in the header can be discarded. The declaration of functions in C# is the same as the definition, and everything can automatically see the namespaces in the project, without having to include anything.
Yes, the best way to set properties is with get/set methods, then you can make variables that can be got and not set, and vice versa, if needed.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I have made a table using access , one of its coulumns is of the type
Hyperlink. I can't access it using Data grid on C#.
where I want to make it a link to a certain file or to read the file contentes of a certain row
|
|
|
|
|
Hello:
I recently changed my code around... being inexperienced and stupid, I had put code that replaced the connectionstring of an OleDbAdapter in the region that the designer obliterates when you make changes. But it worked.
Now I have moved the code to the form load event function, and the program cannot fill the dataset. I do not understand why at all. I have put in MessageBox.Show calls to show that the connectionstring is alright, so I am confused now as to what the problem is. Any ideas?
|
|
|
|
|
Try putting the code block in the constructor just after InitializeComponent()
public class Form1 : System.Windows.Forms.Form
{
public Form1()
{
InitializeComponent();
}
private void InitializeComponent()
{
}
}
Hope this works.
|
|
|
|
|
hi ,
Please try to execute your code block in try....catch block. And send the error message.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
1.Your suggestion is correct though What I wanted to stress that one should not write any code other than that of GUI design in the InitializeComponent(). Other code [non GUI related] gets deleted.
2.Whether you put the code chunk in try catch block or not if there is any error it will pop up. If it is not handled it will get crashed.
3.Also he has said, he is not getting any error pop-up msg.
Lets see what is Chris's problem? He has not reverted back till now.....
|
|
|
|
|
Hi,
My main app need to call a static method on several different classes, so each class (A and B) inherited a base class (BASE) that defined and implemented (empty) a static method so that the main app could do this
doSomething()<br />
{<br />
((BASE)child).TheStaticMethod(...)<br />
}
Other methods were also defined as abstract, and had to be implemented by A and B.
Now I wanted things a bit "cleaner" so I created an interface that classes A and B inherited from and thus had to implement, which works just fine for all other methods than the static one. You cant say
Interface IBase<br />
{<br />
static void ThePreviouslyStaticMethod();<br />
}
- as you get a "error CS0106: The modifier 'static' is not valid for this item" from the compiler.
Now what do I do ? Isn't it possible to force classes to implement a certain static method ?
Thanks in advance
/Jan
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|
|
I'm using DX9, which has lots of lovely C# support, but only C++ docs, it seems. The C++ docs talk about being able to read ID3 tags, I can't find that support in C#. Can anyone help ?
Thanks.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
|
You are my hero
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Have you succeeded in downloading this ? I've had it time out at about 180 MB 7 or 8 times.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
I've had it time out at about 180 MB 7 or 8 times.
You mean you dont use a download manager? Yes, the link I posted came straight from my download log! Maybe they shifted location....
top secret xacc-ide 0.0.1
|
|
|
|
|
leppie wrote:
You mean you dont use a download manager?
Good point - downloading one now
leppie wrote:
Maybe they shifted location....
No, it's there, it just keeps dropping out. I have enough disc space, and then some, the problem is that the net connection in our new office is flaky.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
|
I have an program with a listview, which is in report mode. I have several columns, and one of them shows a file path, so I want it to be right aligned, so I always see the end. I've set this property both in the code that sets up the columns, and later, but it makes NO difference. My columns are always left aligned. Does anyone have an example of doing this (presumably trivial) task ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|