A little of column 'A', and a little of column 'B'. I am neither hitting my breakpoints in the two methods declared for serialization/deserialization, nor am I getting anything back from my webmethod other than an empty class. The soap message I receive back is...
I am a beginner in C# and just looking for a function to create dynamic several Webbrowser in a Tabpage. I use the Microsoft Webbrowser AxSHDocVw.AxWebBrowser Control in my application.
If i invoke the void a firsttime it runs, but at the second click I get a errormessage
Exception Typ : System.Windows.Forms.AxHost+InvalidActiveXStateException
This is my Code:
TabPage myTabPg = new TabPage();
AxSHDocVw.AxWebBrowser myWB = new AxSHDocVw.AxWebBrowser();
object empty = System.Reflection.Missing.Value;
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
myTabPg.Location = new System.Drawing.Point(10, 30);
myTabPg.Name = "MyNewPage";
myTabPg.Padding = new System.Windows.Forms.Padding(3);
myTabPg.Size = new System.Drawing.Size(650, 500);
myTabPg.TabIndex = 1;
myTabPg.Text = "MyNewTab";
myTabPg.UseVisualStyleBackColor = true;
myWB.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("myWB.OcxState")));
myWB.Dock = System.Windows.Forms.DockStyle.Fill;
myWB.Navigate("c:\\test.doc", ref empty, ref empty, ref empty, ref empty);//
Does anybody know how can I solve the Problem?
Thanks in Advance
Cola 1973 :)
I know how to change and update values stored within the Properties.Settings.Default that are user based. I know these values are stored under the Windows User Name that is currently logged in. Is there a way to change this so the user 123456 that is logged in can change change the values under user 654321?
I seem to remember vaguely something about the difference between user settings and application settings. It sounds like you are attempting to use the latter. See this[^] article on application/user settings, and let me know if it is what you are looking for.
The is 1 computer that about 10 different people use. There is a default user login to get to the windows desktop. From there they run my application and sign into my application using their IDs. I would like to create or change the Properties.Settings.Default to use for who logs into my application and NOT the default windows login.
Well, given that definition, you only have two choices...
1. Use application settings, but have a different section for each application user
2. Create your own setting schema and implement that schema from scratch.
As far as I know, you cannot change the user settings file to apply to your application user... it always uses the windows user. I would recommend the first option as it is easier (IMO), and simply log a different section for each user in the app settings. Hope this helps,
Just looking for some advice as I think my current working solution is probably wrong. I've written a small video player in C# using ffmpeg as the decoder and a thread to process and display the footage. However, as I try and further the player's development the thread idea seems more difficult to control. My main window initialises the video footage but plays its output in a seperate thread to a seperate window. To pause the video I suspend and resume the thread, this works fine. To stop the video I abort the thread and kill the seperate window, I can then initialise another video and then play it fine. If, however the video plays to the end I can't restart the player as the previous thread doesn't seem to have terminated properly. Is it possible to control threads where they can be stopped and restarted.
To stop the video I abort the thread and kill the seperate window
Is it possible to control threads where they can be stopped and restarted.
I imagine so. I have never implemented an approach that aborts threads since virtually all the documentation you read warns against aborting threads. You should use thread communications techniques to control the operations of the thread internally. The result is that the code executing in the thread has an alternate path that causes the thread procedure to return which ends the thread in a proper controlled fashion.
while ( IShouldContinuePlayingRecording() )
So to cause a thread to end looks like this:
1) parent thread communicates with child thread telling it to end
2) child thread receives the message and alters it's flow of control resulting in the thread procedure returning.
If, however the video plays to the end I can't restart the player as the previous thread doesn't seem to have terminated properly.
This should provide some clue as to what's going on. First, you should allow the thread to exit if playback completes (I can infer that you're doing this, I'm just making sure). While you could probably manage to keep the thread alive and consume new playback requests, it is probably much easier to simply let the thread exit and create a new thread when you want to start a new playback.
With that in mind, if your thread is using any unmanaged resources that it doesn't release when the thread exits, the thread will hang when it attempts to exit. I've run into this on multiple occasions. If your thread doesn't seem to be terminating properly, I would look at the resources you're using in that thread and make sure any objects you use are properly Dispose()'d if their documentation says to do so.
It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein