|
i didnt realise that the listbox had its own controls collection, i added the textbox there, and it showed up ontop of the listbox.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Nnamdi Onyeyiri wrote:
didnt realise that the listbox had its own controls collection, i added the textbox there, and it showed up ontop of the listbox.
Yup, that's what you should have been doing. I didn't realize that you hadnt done that when you told me on sonork
Nish
p.s. Didn't feel sleepy, so worked on and finished that article. Had forgotten to mail the latest version home, but I recoded the extra stuff [article was mostly ready since yesterday]. Anyway after I finish the article I was delighted to find CP up again
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Is there a special function in .Net framework (or in C#) to shut down/restart the computer form C# app?
|
|
|
|
|
Import the Shell32 Reference and call Shell32.ShutdownPC
or something like that
Just Add Reference and in COM section select The Shell class
|
|
|
|
|
|
In your case NO. There is some issues between with NT4 and below as well as Win9x, but its ussually related to Unicode issues (I think) . The only suggestion is that they mite be running a pre RTM version of the framework. That would explain compiling and running on their machine and not running on yours. Your exe works fine on my machine with XP and RTM .Net SDK.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
|
Can I compile C# code in a DLL file and call the code from other code file? this will make it easier for me whenever I want to make any update update.
Jassim Rahma
|
|
|
|
|
if you mean running code from a dll, its easy, simply add it as a reference, and your away. that is - if its a c# coded dll.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Hi there.
I would like to be able to draw simple 3d objects such as cubes etc using (x,y,z) coordinates. Of course, on a form we only have 2D to work with. After some book crunching in a bookshop, I have come to realise that my maths skills are somewhat depleted with age, and also that the books attempt to give you a complete understanding of 3d coordinate geometry along with matrix maths required. Its all too academic for me at the moment.....
What they don't do is tell you with simple examples in c# is how to use matrix transforms to convert a set of 3d coordinates into a 2d plane.
That's what I am after. By my understanding, this is a reasonably complex problem involving viewing angles and perspective or parallel representation etc.
Any takers? Of course, I will settle for c# examples of using DirectX or OpenGl as I then can compare different approaches etc.
Thanks groovers
|
|
|
|
|
I'm havent looked into this yet, but the following class mite be of interest:
System.Drawing.Drawing2D.Matrix
as well the System.Drawing namespace mite answer some questions.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Thanks Leppie,
Yeah, I've looked at that stuff, unfortunately its not that helpful. I figure that the classes needed may need to be written by scratch - the matrix class is useful for 2d transforms, rotation and scaling etc, but defaults to a 3x3 matrix, so I reckon the more complex matrices may need to be written by hand.
Thanks for the advice though, and do get in touch if you make any progress on this.
Bye now.
Jase
|
|
|
|
|
Too bad
I'm quite interested in the books you are reading for this. Could you perhaps list a few helpful ones on 2D/3D?
Maybe http://csgl.sourceforge.net/[^] mite be of some interest as well as a link I saw at the bottom of the page at http://www.gotdotnet.com[^]
Personally, I cant wait for DX9 to arrive with Managed DirectX. Should be very soon as ATI has already "leaked" DX9 drivers last week.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
|
Hiya,
Have been down to the bookshop (Borders in Kingston if you are interested) and the books I have been looking at are as follows:
1. 3D Games Programming Games and Beyond, publisher Sams, author Sergei Savchenko ISBN 0-672-31929-2
2. Mathematical Elements for Computer Graphics Second Edition, publisher McGraw Hill, author David F Rogers & J Alan Adams, ISBN 0-07-053530-2
3. Physics for Game Developers, publisher O'Reilly, author David M. Bourg, ISBN 0-596-00006-5
The first two concentrate quite heavily on matrices. Neither of them particularly detail OpenGL or DirectX / Direct3D - though there are plenty of those around.
1. Lots of theory, explanations of different viewing models, raytracing etc etc - reasonably heavyweight maths
2. Lots of theory (again), detailed mathematical explanations of the various steps of projecting 3D objects onto 2D planes
3. Not quite so heavyweight, and more to do with equations of motion (such as cars sliding round bends, projectiles etc etc).
Hope this helps.
Jase
|
|
|
|
|
|
OK the code below is puzzling me. i have this nice little static member that loads pluggins based on a Type object. It does all of this fine, gets everything I want, yada yada... then i get to using the object. I'm looking at the autos in the debugger right now and they say that pluggin, by itself, is of type SourceControl.SourceSafe, which DOES implement ISourceControlPluggin (these are my classes/interfaces) though it won't let me do the cast - keeps yelling at me. Anyone have anything - i'm sure i'm just being blinded by the weekend...
object[] pluggins = System.Pluggins.Pluggins.LoadPluggins( plugginsDir, typeof(ISourceControlPluggin) );
foreach(object pluggin in pluggins)
{
MessageBox.Show( this, ((ISourceControlPluggin)pluggin).Name );
}
.... Snippet of the loadpluggins member ....
.... Almost exactly the same as leppie's function in MYrc ....
public static object[] LoadPluggins( string Directory, Type Interface )
foreach( file found in Directory, load the assembly)
{
if( asm != null )
{
Type[] types = asm.GetTypes();
foreach(Type type in types)
{
Type[] interfaces = type.GetInterfaces();
if( type.GetInterface(Interface.FullName) != null)
{
lstPluggins.Add( Activator.CreateInstance(type) );
}
}
}
}
}
|
|
|
|
|
Where is ISourceControlPluggin defined? Types have assembly identity, so for this to work, both your loader and the plugin have to be referencing the same type in the same assembly. Usually you'd do this by creating a separate assembly that just holds the interfaces plugins need.
Let me know if that's not the issue.
|
|
|
|
|
Really? That seems a bit absurd, really. How could you ever write an abstract class such as linked list. I'd have to recompile the linked list each time i create a new datatype I want to use it. Does this only apply to copy types or reference types as well?
|
|
|
|
|
Cromwell wrote:
Really? That seems a bit absurd, really
Taking your linked list example, what would stop two people from just happening to write a class with the same name? They would most likely not be compatible with each other, so allowing casting between the two is a bad idea.
Cromwell wrote:
How could you ever write an abstract class such as linked list.
I wouldn't make the linked list class abstract; instead I would use a generic node type which would hold an object as well as the prev, next references.
Now this class gets placed into its own assembly which other projects can reference to leverage the class.
James
|
|
|
|
|
Well I gave your suggestion a try and it had no effect. I am still quite disturbed by your statement though. I think you might want to run through the snippets I put in the original post again. I think you may have misinterpreted the LoadPluggins method, but I could be wrong.
Thanks for the response though.
|
|
|
|
|
Hmm I did try this though just for kicks. I changed the return type of LoadPluggins to System.Array and instead of this:
return lstPluggins.ToArray()
I did:
return lstPluggins.ToArray( Interface )
At this point the exception is:
System.InvalidCastException - At least one element in the source array could not be cast down to the destination array type.
Which I could see as being solved by your comment, but referencing the ISourceControlPluggin project and even adding a using line doesn't help.
|
|
|
|
|
CromwellRyan wrote:
though it won't let me do the cast - keeps yelling at me.
What is the exceptions you are getting? I struggled a couple of days with getting it to work just right.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Well I get two really. It just depends on where the cast is done. You can see the second of the exceptions in the post previous to yours by Eric. The first problem noticed when returning the object[] from LoadPluggins is:
System.InvalidCastException - Specified cast is not valid.
I'm starting to get a little frustrated here. Damn I just want some pointers (memory pointers - someone pointed out that could have been taken poorly ) people!!!
|
|
|
|
|
Here's a picture of the debug window. Notice the Watch window as it says the pluggin is of type SourceControl.SourceSafe. In the Class View window it shows that the class does implement the interface ISourceControlPluggin. See, its weird. Wierd even...
|
|
|
|