| | |
Strange and consistent ActiveX problem
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2005
Posts: 244
Reputation:
Solved Threads: 5
Hello, all.
After trying to wade through a great deal of undocumented and uncommented code in order to speed up a frame capture rate, I've decided that, for my sanity and that of my boss and any coders to follow me, I should start over and write it myself.
I reuse a great deal of the old code, but I can't really get much further until I get the passthrough working (Passthrough is the 'live' video feed captured by the camera and card).
Even though the old version I'm basing this project off works first time, every time, I can't get the ActiveX control to work without taking action in the debugger.
First, I have this control, axDTAOLFG1. I've made sure the references for it exist (Removed them, recompiled, re-added the refs, recompiled again), declared it, assigned it, made it load into a picture box.
But it doesn't work, and I've traced the values for the control from the old code and the new code, and found where the new code fails.
InitializeComponent().
In this function, axDTAOLFG1 gets the following treatment:
I put a breakpoint on the .EndInit() line, and found out something very strange.
In the old code, just prior to this line, many fields of the axDTAOLFG1 control (in the debugger) were filled with:
<error: an exception of type: {System.Windows.Forms.AxHost.InvalidActiveXStateException} occurred>
And after, the activeX state exceptions were gone, replaced by:
{System.Runtime.InteropServices.COMException} System.Runtime.InteropServices.COMException
Which would allow the frame capture to run.
For the new code, I could not get this to happen unless I was looking at (expanded the tree) a particular part of the axDTAOLFG1 values in the debugger.
The parts I must have open is
axDTAOLFG1
->System.Windows.Forms.AxHost
->System.Windows.Forms.Control
Anything less than the .Control, and it doesn't work.
This is clearly unacceptable behavior for an application. Would someone please help me fix this problem/explain what the debugger is doing so I can replicate it and get this part working 'magically'? (Yes, I know that handwaving and relying on inexplicable things to accomplish a goal are horrible...)
Thanks in advance!
After trying to wade through a great deal of undocumented and uncommented code in order to speed up a frame capture rate, I've decided that, for my sanity and that of my boss and any coders to follow me, I should start over and write it myself.
I reuse a great deal of the old code, but I can't really get much further until I get the passthrough working (Passthrough is the 'live' video feed captured by the camera and card).
Even though the old version I'm basing this project off works first time, every time, I can't get the ActiveX control to work without taking action in the debugger.
First, I have this control, axDTAOLFG1. I've made sure the references for it exist (Removed them, recompiled, re-added the refs, recompiled again), declared it, assigned it, made it load into a picture box.
But it doesn't work, and I've traced the values for the control from the old code and the new code, and found where the new code fails.
InitializeComponent().
In this function, axDTAOLFG1 gets the following treatment:
C# Syntax (Toggle Plain Text)
this.axDTAOLFG1 = new AxDTAOLFGLib.AxDTAOLFG(); this.tabControl1.SuspendLayout(); this.tabPage3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.axDTAOLFG1)).BeginInit(); this.SuspendLayout(); //GUI stuff here... this.axDTAOLFG1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.axDTAOLFG1.ContainingControl = this; this.axDTAOLFG1.Enabled = true; this.axDTAOLFG1.Location = new System.Drawing.Point(4238, 8); this.axDTAOLFG1.Name = "axDTAOLFG1"; this.axDTAOLFG1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axDTAOLFG1.OcxState"))); this.axDTAOLFG1.Size = new System.Drawing.Size(240, 240); //Some other GUI stuff here... this.tabControl1.ResumeLayout(false); this.tabPage3.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.axDTAOLFG1)).EndInit(); //Breakpoint on this line. this.ResumeLayout(false);
I put a breakpoint on the .EndInit() line, and found out something very strange.
In the old code, just prior to this line, many fields of the axDTAOLFG1 control (in the debugger) were filled with:
<error: an exception of type: {System.Windows.Forms.AxHost.InvalidActiveXStateException} occurred>
And after, the activeX state exceptions were gone, replaced by:
{System.Runtime.InteropServices.COMException} System.Runtime.InteropServices.COMException
Which would allow the frame capture to run.
For the new code, I could not get this to happen unless I was looking at (expanded the tree) a particular part of the axDTAOLFG1 values in the debugger.
The parts I must have open is
axDTAOLFG1
->System.Windows.Forms.AxHost
->System.Windows.Forms.Control
Anything less than the .Control, and it doesn't work.
This is clearly unacceptable behavior for an application. Would someone please help me fix this problem/explain what the debugger is doing so I can replicate it and get this part working 'magically'? (Yes, I know that handwaving and relying on inexplicable things to accomplish a goal are horrible...)
Thanks in advance!
Explainer of control logic and some basics.
"If you seek to drink from a fountain of knowledge, make sure your cup is big enough."
"If you seek to drink from a fountain of knowledge, make sure your cup is big enough."
![]() |
Similar Threads
- Very strange hard drive failure problem, stumped totally. (Troubleshooting Dead Machines)
- Strange Problem - Acer Inspire 3100 - Very Puzzling! (Troubleshooting Dead Machines)
- Is ther a other way??(SharpDevelop ActiveX) (C#)
- Strange keyboard & highliting problem. (USB Devices and other Peripherals)
Other Threads in the C# Forum
- Previous Thread: C# .Net 2005 - Question about .Row.Add(new object[]{...,...}) Please help!
- Next Thread: extending windows "file system" attributes
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





