|
ok, can i read the data through the fstream, and then do decode/encode.
Is it a right move?
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:46am.
|
|
|
|
|
Please provide some sample code to perform it.
|
|
|
|
|
abcurl wrote: ok, can i read the data through the fstream, and then do decode/encode.
You can only do this if you know the file format; I doubt that this would be a good thing. As I said before, get the Interop assemblies and use them. There are many tutorials both here and on the internet to show you how to use these features.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hello:
I am a super novice to VS C# 2008.
I would like to find a sample program that can help me with the following:
1) Create a MDI form with children.
2) The panel on the left will hold a TreeView populated from a database.
3) When a TreeView child is clicked, I would like to open the coresponding Form.
Here is the issue. I can do a if/else...but I will have several hundred forms.
I would like to get the name of the node and use it as the name of the form and then just open/show the form.
I know, I have not explained it correctly. Hope someone can help me. Thanks in advance.
Need Sample: MDI with TreeView loaded from database... check TreeView and open coresponding Form.
|
|
|
|
|
I think you might be able to use reflection to open a form based on its class name, or you could setup a delegate system that will open the form based on the delegate method you specify (I would try it this way first I think).
With "several hundred" forms, it must take forever to load your treeview....45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Thanks for the reply, but as I said before I am a super newbi so i dont know what you are saying about: reflection, delegate methods. Wish I could find a sample code. I learn super fast when I look at code. Thanks.
|
|
|
|
|
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
|
|
|
|