|
private DockForm CreateDockMDIForm(Type type)
{
ConstructorInfo ci = type.GetConstructor(System.Type.EmptyTypes);
DockForm form = (DockForm)ci.Invoke(null);
return form;
}
I am tagging the treenode's Tag with the actual Type of the form, you can easily change it to using a string and get the type of the form before getting the Construction and Invoke for an instance of the form object.
|
|
|
|
|
|
Hello... I will look at the sample 'Application Suite Template'. I might take me a bit to see if it will do what I need. Thanks.
|
|
|
|
|
Hello:
I just tried to load the source in VS 2008 and it wanted to convert it to 2008, so I let it do it, but when I run it I get an error:
Warning 1 'OutlookBar.IconPanel.Margin' hides inherited member 'System.Windows.Forms.Control.Margin'. Use the new keyword if hiding was intended. C:\Temp\SuiteApp\SuiteApp\SuiteAppContainer\OutlookBar.cs 174 14 SuiteAppContainer
Any suggestion on what I can do to resolve this, so I can run and look at the sample?
|
|
|
|
|
This is a warning, not an error, and it tells you what to do, "Use the new keyword..." I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hey I have problem here, more math related than directly code related. I have a bunch of planes that define a shape, but I need to get the actual faces of the shape (ie. have points where they connect and end rather then extending on forever). I haven't found any math libraries that have functions to do this so I was wondering if I could get some help here.
I think I need to find, for each face, where it intersects with other faces, and somehow position a point there, but I'm not really sure, not very good with 3d math.
|
|
|
|
|
Hello,
I received a few answers on this last week, but they were not exactly what I was looking for. Thank you to those that responded. As an example, I have a SpyWare program running on my computer. When a newer version of the program is available (and upon acceptance), it downloads the new application, installs it, and then restarts the application. Currently, my app identifies the situation and downloads the new app from an online location and stores it in the Bin Release folder (this much works perfectly). The question then becomes how do I install it (with the app running) and then restart the app.
Your help much appreciated....Pat
|
|
|
|
|
You launch another app that waits for your primary app to quit, performs the install, then relaunches your primary app.
|
|
|
|
|
Kick off a different installer program and have that install the update. That update can either kill the main program, or the main program can kill itself after it starts the installer. The installer can then restart the main program. If you are updating the installer, perhaps have the main program do updates for that.
|
|
|
|
|
Wow...two great answers, and they make sense. A program inside the program so to speak. I can see the logic clearly. Can either of you perhaps supply me with or point me to a code sample? And does this mean that it actually has to be a 'different' program or is it more like calling a thread that runs a method inside the application? Again, thank you for your answers and patience while I learn this new technique...Sincerely, Pat
|
|
|
|
|
PDTUM wrote: two great answers, and they make sense
These are the same answers you were given in your previous posting. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark,
Well, perhaps it is the way that the reply from aspdotnet was explained. I hope you do not feel slighted. I appreciated your reply last time and I thanked you for it. Everything is easy when you already know how. Celestial Mechanics in AstoPhysics is a piece of cake for me. I recall a reference to another page that seemed very complicated. I was pursuing it when I had to stop to work on something else. In fact, if you care to supply one, a snippet of real code as an example would be greatly appreciated. I cannot mark any answer as correct until I can get one of them to actually work. Seems reasonable. Again, thanks to all...Pat
|
|
|
|
|
PDTUM wrote: I cannot mark any answer as correct until I can get one of them to actually work.
No one asked you to mark any answers correct or otherwise. It's just very rude to continue to ask the same question when you have already been given answers, more so when you get the same responses. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
PDTUM wrote: I received a few answers on this last week, but they were not exactly what I was looking for.
You have been given essential the same answers now as then. What is it you are looking for? I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark,
Thank you again for your follow up. I am not trying to be difficult. I seem to be caught in a 'mental loop' trying to make this thing work. I am not sure if the "installer" can be launched from inside the application, or during shutdown after the download, or ??? I am just a bit turned around on this one (I am sure that this has happened to you at some time or another). However, I expect that I will figure it out eventually...I usually do. Perhaps I should use a Google search to locate a piece of sample code. In the past, before some of the forums became a race for points, developers seemed to spend a little extra time to write out some possible scenario's. Things change, but all help is both appreciated and accepted. Thanks again...Regards, Pat
|
|
|
|
|
It would probably help if you read the documentation, ClickOnce Deployment[^].
If you're looking for someone to give you the code to create a splash screen or starter app, then keep posting, eventually someone write it for you.
If you are truely stuck, post what you have and we can possibly give you a hint.
I know the language. I've read a book. - _Madmatt
modified on Monday, February 15, 2010 8:26 PM
|
|
|
|
|
Hi everyone,
I have a small problem. I am trying to multi-thread my program, so the GUI will not freeze when the engine does certain calculations.
Class1:
private delegate void DelegateToCrossThread_None();
MethodA:
this.thread_MainEngine = new Thread(new ThreadStart(this.Initiate_Engine));
this.textBoxReport.Clear();
this.thread_MainEngine.Start();
this.textBoxReport.Text += "[" + DateTime.Now.TimeOfDay.ToString() + "]: INITIALIZATION\r\n";
MethodB:
private void Options()
{
if (this.InvokeRequired)
{
DelegateToCrossThread_None crossThreader = new DelegateToCrossThread_None(Options);
this.Invoke(crossThreader);
}
else
{
if (this.cboxLog.Checked != true)
{
logOption = false;
}
else
logOption = true;
MethodC:
if (this.InvokeRequired)
{
DelegateToCrossThread_None crossThreader = new DelegateToCrossThread_None(SettingsInfoDisplay);
this.Invoke(crossThreader);
}
else
{
}
Major method:
private void Initiate_Engine()
{
if (this.InvokeRequired)
{
DelegateToCrossThread_None crossThreader = new DelegateToCrossThread_None(Initiate_Engine);
this.Invoke(crossThreader);
}
else
{
SettingsInfoDisplay();
Options();
this.textBoxReport.Text += "[" + DateTime.Now.TimeOfDay.ToString() + "]: INPUT [" + inN + "]\r\n";
mainEngine_instance = new Main_Engine_Class();
mainEngine_instance.LogReportSynch += new StringSynch(mainEngine_instance_LogReportSynch);
mainEngine_instance.Training(inN, hN, oN, erT, tt, progressFilter, logOption);
Thread.Abort();
Class2:
public event StringSynch LogReportSynch;
if (dynamicLogOption == false)
{LogReportSynch = null;}
stepByStep_reportString = "[" + DateTime.Now.TimeOfDay.ToString() + "]: text" + "\r\n";
if (LogReportSynch != null)
{
LogReportSynch(stepByStep_reportString);
}
The problem is:
if logOption is set to false, the event does not occur and the program runs as if there is no multi-threading. If it is set to true and there is
Application.DoEvents() in mainEngine_instance_LogReportSynch, the textbox adds new lines of text I want. Why is that? Is there a better solution? The thing is I have lots of methods and variables I need to cross-thread, so I have a lot of
if(InvokeRequired) .
Also, I have other events that dynamically update certain controls, and if Application.DoEvents() is not included, the program runs as if it is on 1 thread (no constant "updates" in text boxes). Any help pls?
modified 1-Aug-19 21:02pm.
|
|
|
|
|
1) Don't use Thread.Abort() because it makes you AppDomain unstable.
2) Don't use Application.DoEvents() because it causes reentrancy.
3) You're running your Initiate_Engine() method on a separate thread, but the first thing you do is use Invoke to marshal it back to the UI thread.
I suggest you read http://www.albahari.com/threading/[^].
Nick----------------------------------
Be excellent to each other
|
|
|
|
|
Hmmm...
Thanks, Nick. I will try read more about threading. As soon as i manage to solve it, i will post the results here.
-- modified 1-Aug-19 21:02pm.
|
|
|
|
|
Sorry if I was a bit terse. There's a lot to learn about concurrent software and some people never "get" it.
Joe Albahari's ebook is a good start: http://www.albahari.com/threading/[^]
Jon Skeet's version is also quite good: http://www.yoda.arachsys.com/csharp/threads/[^]
If you are really interested, I recommend Joe Duffy's book: "Concurrent Programming on Windows". It's 1000 pages long, but every page is filled with knowledge. It's on Safari, if you're a member.
Nick----------------------------------
Be excellent to each other
|
|
|
|
|
Nicholas Butler wrote: It's on Safari
When will it be off Safari or will I have to go to Africa to read it?Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
Geesh some people with no sense of humor...Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
I agree with Nick's remarks, and I suggest you read my little article[^]; you already got a lot of it right, but I don't understand your snippet collection sufficiently to confirm it is all right overall.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Luc Pattyn wrote:
my little article[^]
Didn't manage to solve a problem using your article Kinda already did that
-- modified 1-Aug-19 21:02pm.
|
|
|
|
|
yes, I noticed some InvokeRequired, however I could not ascertain you did it everywhere.
And you mentioned performance problems, without much detail, and I discussed that somewhat too.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|