|
Say you have a structure like this:
Root
\__ Bin
\__ Controls
\__ Commentbox.cs
\__ CommentBox.bmp
You could use the attribute as is above.
If however it exists in a another folder, you would have to refer to a type in that folder that has the same namespace of the folder.
Example if the BMP was in the Resources folder:
[ToolboxBitmap(typeof(Resources.ResourceManager), "CommentBox.bmp")]
|
|
|
|
|
|
|
Hi,
I am trying to access a webservice over the internet and getting the following exception.
'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ' .
I am trying to access the web service with the help of following code and getting the above exception.
protected void Page_Load(object sender, EventArgs e)
{
GlobalWeather gw = new GlobalWeather();
string cities =gw.GetCitiesByCountry("India");
}
Please help.
|
|
|
|
|
I think you will get help better if you posted this question to the ASP.NET forum
M. Gouda
foreach(Minute m in MyLife)
{
myExperience++;
}
|
|
|
|
|
You are getting a general communication error, so it could be any number of things. Go through the basic diagnostics first: can you ping the web service server from where your code is running? Try also to load the web service URL in your browser, if it's http based.
|
|
|
|
|
Are you certain that the web service is running? Do you have the proper URL and permissions to access the WS? Try updating your web reference... does it work? If not, you either have an incorrect URL or the WS is down. If it does, then make sure the new Web Reference exports such a call. Let me know if you figure it out (or if both the WS responds to the update AND that method is exported).
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
My web service is down too, can you ask them to bring it up while you are at it?
|
|
|
|
|
Hello,
I am having problems with a tree control in a windows form application. Sometime yesterday a typecast that I was using wuit functioning and I can't figure out where the problem started. I have a class that is an extents the System.Windows.Forms.TreeNode class. It adds fine to the TreeControl, but when I go back and try to read the object and cast it as the new class it throws the following exception. What could have happened to make this start failing? I am including the adding and the locating a node. The adding program sometimes throws a duplicate value, which is tested by the FindChildNode before adding it. The FindChildNode is the biggest problem right now and is throwing the following Exception (Bolded line is throwing the error).
Message="Unable to cast object of type 'System.Windows.Forms.TreeNode' to type 'InternalApp.ECDTreeNode'."
<br />
public class ECDTreeNode : System.Windows.Forms.TreeNode<br />
{<br />
.<br />
.<br />
.<br />
public ECDTreeNode FindChildNode(string cText)<br />
{<br />
ECDTreeNode ret = null;<br />
for (int i = 0; i < Nodes.Count; i++)<br />
{<br />
ECDTreeNode tn = (ECDTreeNode)Nodes[i];<br />
if (cText.Trim().ToLower().CompareTo(tn.Text.Trim().ToLower()) == 0)<br />
{<br />
ret = tn;<br />
break;<br />
}<br />
}<br />
return ret;<br />
}<br />
}<br />
public void AddSorted(ECDTreeNode tn)<br />
{<br />
bool bFound = false;<br />
try<br />
{<br />
for (int i = 0; i < Nodes.Count; i++)<br />
{<br />
if (tn.Text.CompareTo(Nodes[i].Text) < 0)<br />
{<br />
Nodes.Insert(i, tn.Text.Trim());<br />
bFound = true;<br />
break;<br />
}<br />
}<br />
if (!bFound)<br />
Nodes.Add(tn);<br />
}<br />
catch (Exception e) <br />
{<br />
MessageBox.Show(e.Message, "Exception Error", <br />
MessageBoxButtons.Ok, MessageBoxIcon.Error);<br />
}<br />
}<br />
<br />
}<br />
<br />
Thanks for any help,
Leo T. Smith
Program/Analyst Supervisor
|
|
|
|
|
Leo Smith,
What is the collection "Nodes" ?, Is it a collection of System.Windows.Forms.TreeNode or ECDTreeNode?
Regards,
Gareth.
|
|
|
|
|
Nodes is a collection ECDTreeNodes.
Leo T. Smith
Program/Analyst Supervisor
|
|
|
|
|
My bet is that you are unintentionally adding a node somewhere using a string to the collection, instead of sending your pre-created node. Put a breakpoint in on the problem line to see what type the node is, and I bet it is just a TreeNode. Once you see which node is causing the problem, try to trace back to when it was created, and I bet you have a line like "tree.Nodes.Add("Some string")" instead of creating your own ECDTreeNode object, then adding that object. Good luck,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Leo Smith,
If this was true, why do you need to cast it?, since Nodes[i] would return a ECDTreeNode. Think it might be a good idea to:
Trace.WriteLine("node == " + Nodes[i].ToString());
Regards,
Gareth.
|
|
|
|
|
I think that Leo was saying that the objects are EXPECTED by him to be of his type... I don't think that the collection is actually strongly typed to his objects, though, which is what is leading to the error (I think). I also don't think that type casting an object to it's own type throws an exception, but I can't say that I have ever tried it to find out. Any comments on this, Leo? Is the collection strongly typed to your object, as understood by Gareth, or is it just a TreeNode collection, as interpreted by me?
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Thanks both of you. The trace assisted in finding out that the was no error, since as Jeff suspected, I had added a string (although technically I inserted a string value and not a ECDTreeNode). I was unable to find this error only because I almost never insert a value. I had looked at all my Nodes.Add() calls before I posted. The trace let me know the type was wrong and Jeff's "you are probably adding a string" instead of a ECDTreeNode made me stop and look for something out of the ordinary.
Thanks,
Leo T. Smith
Program/Analyst Supervisor
|
|
|
|
|
Glad to be of some help.
Regards,
Gareth.
|
|
|
|
|
I'M A FINAL YEAR STUDENT OF BTECH AND IM QUITE STRUGGLING WITH MY PROJECT THAT IS ON
"""REMOTE DESKTOP SHARING"""
AND IM DREADING CLOSE TO END DATE SO SOMEBODY HELP ME IF COULD ARRANGE A PROJECT OR JUST TELL ME WHERE I COULD GET IT ,PLEASE
|
|
|
|
|
First: Don't shout. It is rude.
ashutosh911 wrote: MY PROJECT THAT IS ON """REMOTE DESKTOP SHARING"""
What does that mean? A project title tells us very little.
If you want help then you are going to have to tell us more about your project and prove that you have at least made an attempt. We will not help you get a qualification if you are not entitled to it. In other words YOU MUST DO THE WORK!!!
|
|
|
|
|
Sounds to me like he doesn't really want help, just someone to give him a .sln with everything he wants, not going to happen. Have a feeling a few more of these are going to pop up on these forums (dissertation/final year project deadline time) this time of year.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
ashutosh911,
Start -> All Programs - Accessories -> Remote Desktop Connection. Seems Microsoft did your project for you!
Regards,
Gareth.
|
|
|
|
|
Three things you might want to consider:
1. Stop shouting - ALL CAP is considered SHOUTING and is RUDE!
2. Use a more meaningful subject line next time.
ashutosh911 wrote: """REMOTE DESKTOP SHARING"""
AND IM DREADING CLOSE TO END DATE SO SOMEBODY HELP ME IF COULD ARRANGE A PROJECT OR JUST TELL ME WHERE I COULD GET IT
3. I'll make sure I never hire you for help since you are asking people to help you cheat on your project. Do it yourself and you might learn some valuable skills that cannot be taught by cheating.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
|
Hi all, I am trying to find a way to count lines in an rtf file, so I could later create a kind of paging. I am using c#, also is there a way to show a string that includes format characters (such as "/par" in rtf) in a richTextBox?
Thanks!!!
Panos
modified on Thursday, March 13, 2008 1:59 PM
|
|
|
|
|
panoskatws wrote: Hi all, I am trying to find a way to count lines in an rtf file
There may be a library that will do that for you, I don't know. Otherwise to write your own code to do anything with a specific file format you start by learning the file format. So if that is what you intend to do then go find some documentation for the RTF file format and learn it.
led mike
|
|
|
|
|
Well about libraries I haven't found anything that I can use. So I must create my own piece of code that counts lines and takes specific parts of formated text and display it in a RichTextBox, formated... That is an other problem I have, don't know how to display a part of formated text without loosing the styling(fonts, colors etc.). All special characters are displayed with the text (/n ...). So I understand that I must learn about the rtf file format. Does anyone know the basics that are needed, or any suggestions???
Thanks!!!
|
|
|
|