|
The specified domain either does not exist or could not be contacted.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The specified domain either does not exist or could not be contacted.
Abhishek Pandey
New Delhi, India
9811035088
|
|
|
|
|
And the problem you are having?
xacc.ide
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
I have a Label contained in another Label
class MyLabel<br />
{<br />
public MyLabel()<br />
{<br />
Label innerLabel = new Label();<br />
this.Controls.Add(innerLabel);<br />
}<br />
}<br />
MyLabel outerLabel = new MyLabel();
Now If I Do outerLabel.MouseUp += MyHandler
Now MyHandler would not be invoked because everytime I Click over outerLabel Mouse Events would be generated on the innerLabel and not on the OuterLabel. So what modifications do I need to make to innerLabel(or OuterLabel) so that the InnerLabel passes MouseEvents to its Container OuterLabel.
Thanks...
|
|
|
|
|
hi,
i am trying to check how exactly the return statement woorks,for that i wrote a code......
my logic is like this....
result will be having a value which will be assigned to sum via return....
and in function(method) it should add the value of sum with one....
for example
x=5
y=5
so sum = 10
in method a it should give me 11.....
am a beginner....
the result rite now i am getting is 10 and 0
is my logic correct if not wer am i going wrong?????
using System;
using System.Collections.Generic;
using System.Text;
namespace Returnmine
{
class Program
{ static int x,y,result,sum;
public static int Add()
{
result = x + y;
return result;
}
public static void read()
{
Console.WriteLine("the value of x is ");
x = Int32.Parse(Console.ReadLine());
Console.WriteLine("the value of y is ");
y = Int32.Parse(Console.ReadLine());
}
public static void a()
{
int a;
a = sum + 1;
Console.WriteLine("the value of {0} ",a);
}
static void Main(string[] args)
{
read();
int sum = Add();
Console.WriteLine("the value of result is {0}",result);
a();
Console.ReadLine();
}
}
}
thanks in advance
j
|
|
|
|
|
The read method assigns values to x and y
The add method returns the sum of the two numbers, and prints it.
I think I see your problem
Trustapple wrote: int sum = Add();
This creates a new variable called sum. The global variable of the same name is not assigned, as it is hidden by the new local one you created.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I really don't know where to begin. There are so many things wrong with this code.
using System;
using System.Collections.Generic;
using System.Text;
namespace Returnmine
{
class Program
{
private int x,y;
public int Add()
{
int result = x + y;
return result;
}
public void read()
{
Console.WriteLine("the value of x is ");
x = Int32.Parse(Console.ReadLine());
Console.WriteLine("the value of y is ");
y = Int32.Parse(Console.ReadLine());
}
public void a(int sum)
{
int outputValue;
outputValue = sum + 1;
Console.WriteLine("the value of {0} ",outputValue);
}
static void Main(string[] args)
{
Program p = new Program();
p.read();
int sum = p.Add();
Console.WriteLine("the value of result is {0}",result);
p.a(sum);
Console.ReadLine();
}
}
} While this code isn't perfect, it is better than the original. Compare the changes to see what I've done differently.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks a million Pete.... am sorry for asking such stupid qstns but i am trying my best
thanks again
|
|
|
|
|
Looks to me like Main() has a local variable 'sum' that is set to 10 but your call to a() doesn't reference that one - since it is local to Main and wasn't passed in - it references the 'sum' that is part of your class.
Good Luck!
“You can't teach people to be lazy - either they have it, or they don't.”
-Dagwood Bumstead
|
|
|
|
|
Another one who really needs to buy a "beginning programming" book.
Seriously, it will help you much much more than we can.
|
|
|
|
|
Hi,
You are confusing two variables both called sum. One is a static class member, the
other is a variable local to Main().
your code is messy.
1. It is inconsistent: the add() method takes two members as input, modifies another member
(result) AND returns a value; to be consistent it would either not return anything (so
it operates on class members only), or it would not touch any members and work with
input parameters and a return value only, which I certainly prefer:
static int add(int v1, int v2) {return v1+v2;}
In this way, there are no "side effects", the method simply does what its name indicates.
2. In general you should use class members only for things that have a permanent significance,
whatever is local to a method should be handled by local variables.
3. rather than making everything (methods, variables) static, it would be much better
to create a class, instantiate it, and forget about the static keyword (except for void Main),
until you really need something that gets shared across all class instances.
Something like this:
class Test {
public static void Main() {
Test test=new Test();
test.Run();
}
public void Run() {
int v1;
int v2;
int.TryParse(Console.ReadLine(), out v1);
int.TryParse(Console.ReadLine(), out v2);
Console.WriteLine("The sum of "+v1+" and "+v2+" is "+add(v1,v2));
Console.ReadLine();
}
public static void add(int v1, int v2) {
return v1+v2;
}
}
Notes:
- there are no class data members at all;
- the static keyword for add() is optional; I use it here to indicatethe method does not
need any class members (and not because it would not compile without the static keyword).
May I suggest you buy a book an C# and work your way through it, it will offer the fastest
and most thorough way to get all the basic knowledge and skills.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Can u recomend any books that are very simple so taht a person who is new to oops can learn C# himself Luc .....
j
|
|
|
|
|
Hi, this is my standard answer on book questions:
Sorry, I can't recommend any books on programming languages. I learned C# many years ago, I bought two books that both are no longer up-to-date (due to C# 2.0). In general I feel book appreciation is very subjective, it depends a lot on your prior knowledge and experience, and your preference for verbose vs. strict description.
I tend to go to the book shop, look at say ten books on the subject and then buy the 1 or 2 that I like most (often one tutorial, one reference manual).
One more comment, I tend to reread the tutorial a couple of times, say with 1 year intervals. A second/third pass through the book always reveals a few useful things that got lost on the first pass.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Microsoft Press Step-by-step series is excellent.
|
|
|
|
|
Thank you guys....
j
|
|
|
|
|
hi all,
I am using a listview to display thumbnail of images with some text. i have used largeicon view to display them.
i have created the thumbnail images and its displayed. as in explorer, i need to have the thumbnail image displayed as a folder. (like a border to the thumbnail and text).
How can i do it? i saw a article here in Codeproject but the code is in VC++.and i am not aware of this.
Is there any way to accomplish the same?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
Yes there is. First of all you need to set OwnerDraw property of ListView class to true. By doing this you are responsible for providing code for drawing the control. After that handle the ItemDraw event of the listview class to make necessary drawings.
|
|
|
|
|
hi,
Thanks for your help. i have started to use the drawitem event of the listview control and i am making improvement in that.
Thanks for your suggestions.
But could you please provide me with a link
where i might be able to draw a perfect rectangle for the items
using drawitem event?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
Examine properties of the DrawListViewItemEventArgs parameter that the DrawItem event receives.
|
|
|
|
|
hi,
Thanks for your suggestions.
i have drawn the image and the text using the properties of drawlistitemeventargs(thanks). but still i am not able to figure out how to draw the border for that item.
Could you please help me by suggesting some links?
Thanks once again.
Regards
Anuradha
|
|
|
|
|
The drawlistitemeventargs parameter called e has a graphics property which you use for drawing. So you need to call e.Graphics.DrawRectangle method to draw rectangle around the item. In order to pass the desired rectangle to this method explore e.Bounds property and e.Item.Bounds property. Hope this helps
|
|
|
|
|
hi,
Thanks a lot for your help.
I am able to draw the border now for each item.
Thanks once again.
Regards
Anuradha
|
|
|
|
|
You are welcome
|
|
|
|
|
Hi everybody,
I'm new bie to SCORM and I have to create a project like xmlScormstudio. I have downloaded the project from CVS on http://sourceforge.net/projects/xmlscormstudio. But i can't build it. It seems to be omitted many files. Are there any one know how to build it? Please help me!!!
Thank you!
xyz
|
|
|
|
|
I would suggest that this should be addressed on the project Forum on Sourceforge. I will say, though, that you will probably need CVS to get all of the files.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have posted the question on the project Forum on Sourceforge, but there seem no one visit it and I downloaded source from CVS
xyz
|
|
|
|