|
There is a shortcut in the VS.NET product folder. If you want to execute this without the shortcut, you need to use the path to dexplore.exe (typically in C:\Program Files\Common Files\Microsoft Shared\Help, though you should use Environment.SpecialFolder.CommonProgramFiles pased to Environment.GetFolderPath to get the C:\Program Files\Common Files since it can be redirected or on a different drive than C:). Then pass a command-line param like so:
string dexplorePath = Environment.GetFolderPath(
Environment.SpecialFolder.CommonProgramFiles);
dexplorePath = Path.Combine(dexplorePath, "Microsoft Shared\Help\dexplore.exe");
Process.Start(dexplorePath, "/helpcol ms-help://ms.vscc");
Process.Start(dexplorePath, "/helpcol ms-help://ms.vscc.2003");
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have a very odd problem with J# and threads.
I have a client with a gui and a connection class that is in another thread. At first only parts of the GUI loads, most tabs are not added at this point. Then I connect and check for password, if that is correct I want to load the other tabs. Oddly it loads the first one and that one is empty.
The connection class in an observer that the GUI is listening at.
And when I debug I get this error message:
"An unhandlet exception of type 'System.ArgumentException' occured in system.windows.forms.dll
Additional information: Controls created on one thread cannot be parented to a control on a different thread"
Any idea what might be wrong?
|
|
|
|
|
First, this forum is for C#, not J#.
*** Note to Admins: We need to create a J# Forum! ***
Is your connection class creating the controls? From a design standpoint, it really shouldn't be doing this. It's a connection class, not a GUI class...
But if you must, you would have to supply a delegate function on your form for the connection class to call using wheteverFormName.Invoke(). This function would then have to create the new controls. The controls absolutely cannot be created directly by the connection class.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm a new C# coder but is forced to work with J# on this single project, and I hate it .
Anyhow it did not create the controls, that is what was so strange. But we did use alot of Java code and not any delegates. That have been fixed now, but if you read my other post you see my new annoying error. One step forward two step backwards!
|
|
|
|
|
Ok, walking away from java threads and into delegates and threads. Anyhow would work better in theory I guess.
But even though I follow this: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vjsharp/html/vjwlkwalkthroughauthoringsimplemultithreadedcomponentwithvisualj.asp guide more or less exact, I get errors.
VS.NET refuses to use System.Delegate.Combine(eventHandler, eventHandler):
public delegate void FactorialCompleteHandler(double Factorial, double TotalCalculations);<br />
<br />
public FactorialCompleteHandler FactorialComplete;<br />
<br />
public void add_FactorialComplete(FactorialCompleteHandler e)<br />
{<br />
FactorialComplete = (FactorialCompleteHandler) System.Delegate.Combine(this.FactorialComplete, e);<br />
}<br />
<br />
That is all of the relevant code from the walkthrough but for some reason it wont work. Gets a:
Cannot find method 'Combine(objectHandler, objectHandler)' in 'System.Delegate'
|
|
|
|
|
Funny... I don't see you defining a Combine method in any of your code there...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
But that one already exists in System.Delegate right?
Atleast it shows up when I type the . after Delegate, and I follow the constructor(two of them and I use the one with two eventHandlers).
Oh well, hungover and forced to code due to deadline. Life sucks
|
|
|
|
|
Cenatar wrote:
Oh well, hungover and forced to code due to deadline. Life sucks
Whoa... Dude... A little 'Chaser' next time! Deadlines! Remember?!
I should have gone back and read the sample code with both eyes open! Hmmm...
OK. This may seem stupid, but did you put this at the top of the code?
import System.*
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, yes I'm stupid and cannot read examples clearly
You need to have a /**@delegate*/ over the delegate deklaration. Odd in my opinion, oh well.
|
|
|
|
|
I already hate J# and I've never written anything in it...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
Is it possible to get attributes of a Xml-file and place it in a datagrid. The second column then should be a boolcolumn. Then when i press a button "save" i want the attribute with the true or false value saved in another Xml-file.
Is this possible or to difficult to do?
thx in advance.
for example: the first xml-file looks like this:
<tablegroups>
<tablegroup name="programs">
<description>program dictionary</description>
</tablegroup>
<tablegroup name="parameters">
<description>parameter system</description>
</tablegroup>
</tablegroups>
Then the result should be:
<tablegroups>
<tablegroup name="programs">true</tablegroup>
<tablegroup name="parameters">false</tablegroup>
</tablegroups>
|
|
|
|
|
When you read an XML file into a DataSet (to bind to a DataGrid or any other data-bindable control), attributes on "table" elements are treated as columns as well as the child elements.
If you want to save your DataSet in a different format, then you should either use an XslTransform to transform the data before saving to disk or just use the XML DOM classes (in System.Xml ) to do so manually. The nice thing about XML is that you can do just about anything you want with it if you know how. It's really not hard. I suggest reading the System.Xml namespace member documentation, as well as the many XML topics in the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
aferter using Bitmap.Save("bmpname.gif",ImageFormat.Gif) method,
i can get a bmpname.gif file.
why the file is filled with many white dots ?
|
|
|
|
|
sorry my mistake.
the bmpname.gif image is full of noise.
while using paint.exe to convert a bmp to a gif , the image looks smooth.
Why ?
|
|
|
|
|
Were there any "holes" in your Bitmap image before you saved it, like alpha channel data? Actual holes in the image?
Alpha would be my first guess...
The GIF format doesn't support alpha channels, so these would end up becoming holes in your image. GIF supports a transparency key where one color can be picked and, when rendered, that color doesn't get painted on the screen so the background behind the GIF image shows through.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
emmm, maybe i got something from your speech.
here is my Saving progress:
Bitmap bmp = new Bitmap(@"D:\1\111.bmp"); // 111.bmp is a 24bits bmp saved by paint.exe
bmp.Save(@"d:\1\111.gif",ImageFormat.Gif);
only 2 lines codes above. maybe the 111.gif lose alpha info after convertion.
|
|
|
|
|
fu0 wrote:
maybe the 111.gif lose alpha info after convertion.
Yes it does lose the alpha, because the GIF format doesn't support it, so there are your "holes" in your GIF image.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I am consuming a webservice from my C# component(which will be used by lots of applications), basically i want the to return and specific number -200 when the webservice is down.
Can any one suggest me how can i do it?? I am planning to put multiple exception blocks, like application exception,web exception,protocol exception etc, does that work??
Any pointers to this will be helpful.
TIA,
sudheer
|
|
|
|
|
You can't put it in the WebService because if it's down, how is it going to return a value? Especially if there is a network problem...
Your consumers will have to handle the exception themselves and, if required, set the return value to -200 in their exception handlers.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In addition to what Dave said, you can either handle multiple exception types or catch them all like so:
try
{
}
catch (WebException ex)
{
}
catch (ApplicationException ex)
{
}
catch (Exception ex)
{
} You could also catch all exceptions like so:
try
{
}
catch (Exception ex)
{
} If you don't plan on using the exception info, you can either use an empty catch like:
try
{
}
catch
{
} ...or catch specific exception types like:
try
{
}
catch (WebException)
{
}
catch (ApplicationException)
{
}
catch (Exception)
{
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I'am trying 2 create a textbox dynamically in a windowsform application...
I want a textbox 2 b created while clicking a button in the form...And it has 2 b loaded thru code rather than thru design ...
I tried but was not able 2 create the control...Cud u pleez get me the code 4 this one..???
Thanx n Regards,
MMX
|
|
|
|
|
hi,
this is the way how you do it ...
private void button1_Click(object sender, System.EventArgs e)
{
TextBox tb = new TextBox();
tb.Width = 100;
tb.Location = new Point(100,100);
this.Controls.Add(tb);
}
Hope this solves your prob..
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
If you want to see all textbox which added to the form.then you can use the below mentioned code block
private void button1_Click(object sender, System.EventArgs e)
{
Txtbox= new TextBox();
this.Txtbox.Location = new System.Drawing.Point(locx, locy);
Txtbox.Width = 100;
this.Controls.Add(Txtbox);
locx=Txtbox.Location.X;
locy=Txtbox.Location.Y+30;
}
//here i have only one button on my form. On button click i am dynamically creating
//textbox control and adding to the control collection of form.
//before getting into code you have to declare one private datamember of the type textbox and two integer variables that will help you to keep the location unique.
so you can avoid overlapping.
private System.Windows.Forms.TextBox Txtbox;
private int locx=20,locy=30;
hope this will avoid from overlapping
Sreejith S S Nair
|
|
|
|
|
If I want to use special cursor image other than the default list given in .Net environment, how to add new image to the list of available images.
|
|
|
|
|
You can not in the default list.
After creating a cursor you use it through your own class.
|
|
|
|