|
Okay, looking through a book "Microsoft Visual C# 2005 Step by Step" 2005 Edition form Microsoft at the binary tree class they try to setup. I'm using Visual Studio 2003 to try to compile the code, but they said to use 2005. This code right here doesn't work
<br />
public class Tree<T> where T : Icomparable<T><br />
Is this code specific to 2005 Visual Studio? Do I even need to use "<t>"? Can anybody point me in the right direction. I will be creating a binary tree visaulizer program that draws out the different nodes and branches. What fun?
Any ideas or comments are greatly appreciated.
Thanks,
Josh
|
|
|
|
|
The code used in the book doesn't work because they are making a generic class, and it only works in C# 2.0 that comes with Visual Studio 2005. The class can be modified so it can compile with VS 2003, but you will need to change all the code that uses the class.
Hope this helps
Pablo Hernandez Valdes
|
|
|
|
|
http://s18.yousendit.com/d.aspx?id=1BV73LUSO19IV1DGQM7SI2RUVO
Here is a link to download my project. This is a school project and I've been working on it for a while. I tried a few ways to export my treeview to xml but they haven't quite been right. I need to export my server list as an XML when I close the ServerForm. Will someone please help me out here?
Eric W.
-- modified at 11:15 Wednesday 18th January, 2006
|
|
|
|
|
Why XML? Can't you export your treeview as a persisting object to disk, i.e. using an ObjectFiler, BinaryFormatter or native object database?
Regards
|
|
|
|
|
I haven't tried anything else. I will have to try those thanks zopiro.
|
|
|
|
|
I have a C# DLL that a VB6 app is making a call into. That DLL then starts a thread and returns immediately.
I need for the DLL to raise an event when the thread completes.
I can't use the BeginInvoke technique to start the thread, because I need to override the apartment mode to STA, as interactions with COM objects was failing with "QueryInterface failed".
Therefore, I am using an explicit thread creation, which doesn't seem to provide a callback mechanism.
I can raise a message from the main thread just fine.
I can't raise a message from the worker thread; I get "Object does not match target type".
Is there way that I can invoke a function on the main thread from within the worker thread so that the event originates from the main thread?
Thank you.
|
|
|
|
|
I wrote an application in which i called crystal report 10 in my Asp.net(C#)
in crystalreportviewer.Now i want to give users functionality of print that crystal reports on client side.have any body idea to do this job.
|
|
|
|
|
i search this topic. and i used codes which is posted before.(about setstyle) However my form flicker. I draw an image, and some lines and points on the same form. So when i refresh it, it flicker.
How can i solve it ?
|
|
|
|
|
Did you override OnPaint to do the drawing yourself? Did you call SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true) in the form's constructor?
That will work if you do it correctly. Worse comes to worse, just draw to a bitmap, then draw that bitmap to the screen, which will prevent flickering.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Little House on the Flickr
Judah Himango
|
|
|
|
|
thanks. I try to do it again, and i find a mistake. If you dont say this. May be i dont find. Thanksss again...
|
|
|
|
|
I have RichTextBox that i want to add an animated picture within it and i can be able to insert that picture wherever in a string as the that of yahoo messenger during private or public chatting i succeeded to insert it but non animated even if the picture is animated one but also the picture can be resized with the mouse of the user when he hold it the user can resize it but i don't want it to be resized and i want it to be animated if it is for example .Gif Picture. and to have the ability to insert it in any place within the string entered
How can i do that ?
Thanks everybody - "Human Knowledge belongs to the world"
|
|
|
|
|
That was the longest run-on sentence I've ever seen; it caused me a good deal of pain to read that. Your English could use some help; but I'll assume you're not a native English speaker so I'll try to answer your question anyways.
The RichTextBox probably won't do everything you want it to do out-of-the-box; you're going to have to dig into some Win32 interop to get it to do things differently. Have you read the CP article[^] on customizing the RTB? There's another article on it here[^] that may help you as well.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Little House on the Flickr
Judah Himango
|
|
|
|
|
How Can i make the TreeView Nodes start from the right edge of the control with C# ?
M.Gamal
|
|
|
|
|
myTreeView.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
myTreeView.RightToLeftLayout = true;
|
|
|
|
|
"TreeView dosnt contain RightToLeft RightToLeftLayout"
Iam using C# ,and I get this Error when using MyTreeView.RightToLeftLayout = true;
|
|
|
|
|
Hi
I hope someone in here can help me with this issue.
I am trying to write a little application that will give me the information of the directory which is there in the network.
I am able to get the local directory information, but when I tried to access the information of the directory which is in some other
system of the same network I am getting Exception as "Logon failure: unknown user name or bad password."
In fact the directory which I am trying to access is created by myself using another console application.
Here is my code snippet,
DirectoryInfo dir = null;
FileInfo[] xmlFiles;
//get the directory info,
//here test machine is a network machine under same domain
dir = new DirectoryInfo("\\\\TestMachine\\Indexes\\");
//get the information about the subdirectories of dir.
DirectoryInfo[] subDirectories = dir.GetDirectories();
when I try to execute this GetDirectories() method its says "Logon failure: unknown user name or bad password."
So, am doing anything wrong in this code? or is there any other solution to get the directory Info?
Expecting some solution.
Thanks in advance.
Hans.
|
|
|
|
|
The Genghis Framework[^], which is free and built on top of the .NET framework, includes functionality for accessing shares and password protected shares.
Also, you can use WNetUseConnection[^] from the PlatformSDK via P/Invoke.
|
|
|
|
|
Basically, the remote machine doesn't trust you. You're trying to get the directory of a share on a machine that is not part of the same domain as the machine your code is running on. The SID that you logged in under on your machine isn't known to the remote machine and there is no way for it to know that it can be trusted, so it denies your "implied" login attempt.
You have to establish an authenticated connection to the remote machine before you attempt any file operations on one of its shares. You can use the library Judah suggested to establish the authenticated connection, but you still have to supply it with a username and password that the remote machine will accept as valid.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hai friends,
i have to export a table from any of the database types(Text,Access or Excel) to excel...provided that the datatypes of the Columns should retain...
To be clear....
I have to craete a new Excel Sheet whose datas will be imported from other database tables..along with their corresponding datatypes...
I tried to create a new excel importing datas from a textfile..but all datas are in general datatype format....How can i get the solution...
Kindly help me...
Thanx in advance...
|
|
|
|
|
Hi,
i've tried 'google'ing to find any article on how i might be able to read the metadata of a file or .net 2.0 rc1 assembly that i've built (e.g. the date the file was last modified, or the author of the assembly, it's version etc), but i seem to have hit a bit of a brick wall, i'm sure there must be a simple (or not) way to read this kind of information about a file programmtically.
any help or nudges in the right direction will be greatly appreciated
Thanks in advance.
Afzal "AV-E" Hassen
|
|
|
|
|
I'm not sure if it will give you all the info you need, but you can do:
Assembly asm = Assembly.Load(filename);
then use properties/methods of asm:
asm.GetName().Version
You can also get attributes of an assembly by using GetCustomAttributes(typeof(AssemblyTitleAttribute), true)
|
|
|
|
|
Try this...
using System;
using System.IO;
using System.Reflection;
public class Meta
{
public static int Main( )
{
// First load the assembly.
Assembly a = Assembly.LoadFrom("hello.exe");
// Get all the modules that the assembly supports.
Module[] m = a.GetModules( );
// Get all the types in the first module.
Type[] types = m[0].GetTypes( );
// Inspect the first type.
Type type = types[0];
Console.WriteLine("Type [{0}] has these methods:", type.Name);
// Inspect the methods supported by this type.
MethodInfo[] mInfo = type.GetMethods( );
foreach ( MethodInfo mi in mInfo )
{
Console.WriteLine(" {0}", mi);
}
return 0;
}
}
|
|
|
|
|
Thanks guys. i'll give it a shot
Afzal "AV-E" Hassen
|
|
|
|
|
Hi gurus,
I'd like to know how to do the two following operations on TextBox controls:
- Moving the cursor to the end of the text, so the new added lines are always visible without moving the scroll bar.
- Setting the focus on a TextBox. the Focus() method does not work
Thanks for the help.
fred.
There is no spoon.
|
|
|
|
|
answers:
1. <textboxname>.Select();
SendKeys.Send("{END}");
2. <textboxname>.Select();
Sheel Gohe
|
|
|
|