Reputation: 1 Apprentice
- Active Members
- Active Posts:
- 116 (0.12 per day)
- 11-March 11
- Profile Views:
- Last Active:
- Dec 05 2013 02:00 PM
- Dream Kudos:
Posts I've Made
Posted 14 Oct 2013@Modi - Perhaps I'm not understanding exactly what I thought a backgroundworker is for.
Currently, I have functions that take some time to run through(.5s+) in the background worker as to not have the UI wait for those functions to complete before allowing the window to be responsive. My question is really geared only towards one of my functions I am calling(the biggest one taking up to a possible 2s). My thought logic was to move that to the BGW to begin running the functions prior to updating the labels on the form(around 50+). In my mind, if it takes the form an avg of 6+ with normally just to load the labels and comboboxes putting these time consuming functions in the background worker would actually cut down the response time by many seconds. But currently it's looking that everything I placed in the BGW such as combobox populate functions and the big functions actually are updated last on the GUI. I'm assuming because the UI thread hasn't completed from the original thread, it then updates the BGW functions to update the UI. Perhaps I am misunderstanding the use of a BGW.
Note: The big functions are actually only updating some text boxes so it's just a few actual controls
@Martyr2 - Perhaps I didn't give enough information. The BGW actually does make my form more responsive and shows information at a much more rapid pace(to me anyway) but I am more curious as to why my functions that update controls in the BGW are last to update the UI if I call the BGW well before the _load code actually begins to run.
Regarding your note on delegates, I'm not too keen on these but I do believe you can use thread delegates to notify another thread. Like a BGW thread notifying the UI thread to update said control. I thought that since there's only one UI thread per application, that anything you would want to update control-wise would have to wait until the UI thread was free before you would be able to update any control on a form, regardless of delegates or not.
Thanks for your time!!
Posted 8 Oct 2013So I see it's a privacy thing. So what would you do if your child was taken? All you would be able to do is wait while the authorities find the person and who even knows if your child would still be alive by then. The world is a scary place and you can only do so much to keep your children safe. I'm not saying the chip is a good thing I'm just saying it gives you a fighting chance if this has is ever to happen to anyone.
Posted 9 Jul 2013Sorry for the late reply.
Here's the trace of the error to help better understand my issue /> The error is occuring on the line
HTMLElementMain.Click(). There may be a better way to go about this, but it's worked for me in the past so I'm not entirely sure if this way even works with any textbox out there.
System.UnauthorizedAccessException was unhandled Message="Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" Source="mscorlib" StackTrace: at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object args, Boolean byrefModifiers, Int32 culture, String namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object providedArgs, ParameterModifier modifiers, CultureInfo culture, String namedParams) at Microsoft.VisualBasic.CompilerServices.VBBinder.InvokeMember(String name, BindingFlags invokeAttr, Type objType, IReflect objIReflect, Object target, Object args, String namedParameters) at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object args, String paramnames, Boolean CopyBack, Boolean IgnoreReturn) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object Arguments, String ArgumentNames, Type TypeArguments, Boolean CopyBack, Boolean IgnoreReturn) at YTAA.YTAA.btnBegin_Click(Object sender, EventArgs e) in xxxxxxxxxxxxxx at System.Windows.Forms.Control.onclick(EventArgs e) at System.Windows.Forms.Button.onclick(EventArgs e) at System.Windows.Forms.Button.onmouseup(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m) at System.Windows.Forms.Nativewindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String commandLine) at YTAA.My.MyApplication.Main(String Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain._nExecuteAssembly(Assembly assembly, String args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:
Posted 27 Jun 2013Thanks DDay9 No real reason, was just very curious why i wasn't able to find that ONE element. Thanks for everyone's input
Posted 27 Jun 2013I suppose that makes sense. Here's the code i'm using to try and search for a textarea. Is it a script or something that prevents vb from grabbing that tag? Just trying to understand how they would even block such a thing. Blows my mind what some people can create
If loadPage(URL, WebBrowser1) Then For i = 0 To WebBrowser1.document.Domdocument.All.Length() - 1 HTMLElementMain = WebBrowser1.document.Domdocument.All.Item(i) If HTMLElementMain.TagName <> Nothing Then If StrComp(HTMLElementMain.tagName, "textarea", CompareMethod.Text) = 0 Then MessageBox.Show("found the text box", "Found", MessageBoxButtons.OK, MessageBoxIcon.Hand) End If End If Next
- Member Title:
- D.I.C Head
- Age Unknown
- Birthday Unknown