|
I'm trying to put the child windows into a panel on the parent window. That probably matters. I hope this is possible.
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
After looking at my planned workload for Christmas and the New Year, it looks like it is time to make the jump to C# for writing the front end for my apps.
I'll be working on MIS systems with database back-end. Whilst I'm happy enough with how ADO.NET works, I'm finding my reference shelf is a little light on books for Windows Forms and Controls.
I currently only have Inside C# (Second Edition) and the Petzold Programming Windows with C#. What books are good for learning about the ins and outs of Windows Forms and Creating user controls? An Amazon search reveals a lot of books, but usually when a new tech is released a lot of the authors are just jumping on the bandwagon. I'd like to seperate the wheat from the chaff.
What books have helped you?
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
I have those two books. The ADO.NET book fills the gaps because Petzold does not cover the DataGrid. What else do you need ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
|
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
|
|
|
|