|
|
CP and Genghis[^] do I good job of filling in some of the holes in the .NET framework GUI classes. I was just wondering if there are more places for me to look for decent C# GUI classes for standard Windows apps.
I'm interested in classes that give me a nice doc/view framework (i.e the kind of things I've taken for granted in MFC/WTL). A nice wizard to generate code for a standard windows app (menu, toolbar, view) would be great.
Any links welcomed.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
Michael P Butler wrote:
I'm interested in classes that give me a nice doc/view framework
You've got a MDI sample written in C# in your .NET framework samples : SDK\Samples\Quickstart\Winforms\samples\MDI.
|
|
|
|
|
Hi all
I stumbled upon this beauty. For thos that has been here for a while you know the problem with un/loading an assembly (and overwrting it for that matter). IOW the basic idea of a plugin DLL. I'm not sure if the solution will fit all, but it does work in my case and well too!
FileStream stream = File.OpenRead(assemblydll.Text);
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, (int)stream.Length);
stream.Close();
File.Delete(assemblydll.Text);
Assembly asm = Assembly.Load(buffer);
Now the assembly is in memory.
OK the BIG FAT question is, what happens when we reload an updated assembly?
With my limited testing it seems the assembly is present multiple times when calling AppDomain.CuurentDomain.GetAssemblies(), but on invoking a method via Reflection seems to target the last assemby loaded, thus amking it perfect for plugin type assemblies. And saves you from AppDomain HELL.
Hope this helps someone in the future
DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET popularity better now, thank you
|
|
|
|
|
I've been thinking that would also be a great way to have an application update itself...load an assembly into memory and then when the app closes, the in memory assembly executes some code to update the app.
leppie wrote:
saves you from AppDomain HELL.
We escaped from DLL Hell just to move to AppDomain Hell.
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
Microsoft has reinvented the wheel, this time they made it round.
-Peterchen on VS.NET
|
|
|
|
|
David Stone wrote:
I've been thinking that would also be a great way to have an application update itself...load an assembly into memory and then when the app closes, the in memory assembly executes some code to update the app.
I'm not sure how this relates to my post! OK, maybe the "deletable" bit (and you could register that with appexit event, makes sense ).
I'm actually after the answer for the BIG FAT question of what is happening, as according to Eric Gunnerson et al this was NOT possible... ; however unloading is impossible, but .NET seems to use the last loaded assembly as the reference, this is confirmed by executing methods via Reflection.
It difficult to describe. You can have a look in my latest DBHelper tool to see this in action (under the hood of course).
DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET popularity better now, thank you
|
|
|
|
|
It didn't answer your question, I was merely sharing my two bits about in-memory assemblies.
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
Microsoft has reinvented the wheel, this time they made it round.
-Peterchen on VS.NET
|
|
|
|
|
Sounds simple!
I'm calling SHGetFileInfo to get myself a HIMAGELIST, and now I want to create a ImageList so I can access the images.
An example I saw did a SendMessage to set the handle to a control. Unfortunately, I want to use a ComboBox which doesn't have a native ImageList.
So, how can I create a ImageList from a HIMAGELIST pointer?
Thanks!!
|
|
|
|
|
HIMAGELIST is actually a handle, i would attach your HIMAGELIST's handle to your ImageList object?
|
|
|
|
|
Absolutely. Many MFC examples use m_ImageList.Attach( hImageList )
How do I do it in C#?
|
|
|
|
|
I am looking to remotely reboot a server through C#. I have a VBScript example from Microsoft, but I can't seem to figure out how to move it to .NET. I'm also unable to figure out how to use the WMI (System.Management) classes to reboot.
Can anyone help me, either with source code examples or other websites to check?
Thanks!
|
|
|
|
|
Oh know its a case of DLLimport
ExitWindows is the function your after, but you'll have to DLLimport to use it.
|
|
|
|
|
If the server is remote, then you can also use wmi to shut it down.
In your msdn:
ms-help://MS.VSCC/MS.MSDNVS/wmisdk/u_ctrl_2ndx.htm
|
|
|
|
|
I want to do it to a remote computer, so I suspect it's a WMI thing. Anyone have any idea how to do this through WMI?
|
|
|
|
|
Here is an example:
string server = @"\\" + txtServer.Text;
ManagementScope ms = new ManagementScope(server + @"\root\cimv2");
ObjectQuery oq = new ObjectQuery("select * from win32_OperatingSystem");
ManagementObjectSearcher mos = new ManagementObjectSearcher(ms, oq);
ManagementObjectCollection moc = mos.Get();
foreach(ManagementObject mo in moc)
{
string[] ss = {""};
mo.InvokeMethod("Reboot", ss);
MessageBox.Show("The reboot command has been sent.");
}
The only difference between local and remote reboots is the ManagementScope and the optional ConnectionOptions.
Matt is a network administrator for an auditing company in the midwest. He is shamelessly looking for Windows programming side jobs.
|
|
|
|
|
That last one worked like a champ. Thanks!
|
|
|
|
|
How do I connect to a remote SNMP device using the WMI SNMP provider using System.Management objects? Can someone provide an example for me?
Matt is a network administrator for an auditing company in the midwest.
|
|
|
|
|
First try the SNMP provider:
http://www.microsoft.com/downloads/release.asp?ReleaseID=19776
(included on XP?)
http://www.microsoft.com/windows2000/docs/WMIandSNMP.doc
so you can still use WMI from C#.
|
|
|
|
|
Thank you for the links, but I have been to them. I have visited a lot of sites and the best I can get are vb scripts. I think I know in general what I need to do, but I really need a couple of specific examples.
Matt is a network administrator for an auditing company in the midwest. He is shamelessly looking for Windows programming side work.
|
|
|
|
|
Check out:
http://www.c-sharpcorner.com/Code/2002/Sept/SnmpLib.asp
|
|
|
|
|
Is it possible to do ownerdraw of ListView and TreeViews without using the windows API?
I am constrained by a pure C#/.NET framework requirement. This means no COM objects or accessing DLLs unless that functionality is directly exposed by some .NET framework.
All the exmaples I have seen so far seem to use windows API in the least.
Stupidity dies.
The end of future offspring.
Evolution wins.
- A Darwin Awards Haiku
|
|
|
|
|
Absolutely without - I don't know, but to be honest: I don't believe it (at least if even SendMessage is included into the restriction list). However, did you already had a look into the UtilityLibrary from Carlos Perez?? (just search here in CP)It's not only an excellent tutorial, it even has samples for Listbox- and Treeview implementation.
May be this gives you the ultimative hint?? Or you find a way to re-implement the rare API calls into pure C#?
Wish you success! Bye
Matze
|
|
|
|
|
|
every c#'s object like a pointer in c++. But How can i get a pointer point to pointer (**) in c#?
I just work on a undo/redo engine in my c# application.
For example, there is two type of object to be edit in application
class A
{
string aa;
}
class B
{
int bb;
}
The edit operation change the many objects of type A or type B.
I hope to build a stack of object to store the string aa and int bb. Two objects to be cloned, one before the edit operation, another after it.
If the only way to change a memeber of a object is xx.yy = zz, i find it impossible to do the undo. Because i have to know the parent object (A or B) and which type of it (A or B) and judge in code whether to use aa or bb.
I doubt whether reflection ability in c# can help me.
But in c++ style, it is very easy to use object*. something like
*orgin = cloneBefore
or
*orgin = cloneAfter
Do i make some mistake? Please give me some suggestion!!
or any undo/redo engine written by c# or java in the world?
|
|
|
|
|