943,947 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 6345
  • C# RSS
Feb 24th, 2006
0

Strange and consistent ActiveX problem

Expand Post »
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:
C# Syntax (Toggle Plain Text)
  1. this.axDTAOLFG1 = new AxDTAOLFGLib.AxDTAOLFG();
  2. this.tabControl1.SuspendLayout();
  3. this.tabPage3.SuspendLayout();
  4. ((System.ComponentModel.ISupportInitialize)(this.axDTAOLFG1)).BeginInit();
  5. this.SuspendLayout();
  6. //GUI stuff here...
  7.  
  8. this.axDTAOLFG1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  9. this.axDTAOLFG1.ContainingControl = this;
  10. this.axDTAOLFG1.Enabled = true;
  11. this.axDTAOLFG1.Location = new System.Drawing.Point(4238, 8);
  12. this.axDTAOLFG1.Name = "axDTAOLFG1";
  13. this.axDTAOLFG1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axDTAOLFG1.OcxState")));
  14. this.axDTAOLFG1.Size = new System.Drawing.Size(240, 240);
  15.  
  16. //Some other GUI stuff here...
  17.  
  18. this.tabControl1.ResumeLayout(false);
  19. this.tabPage3.ResumeLayout(false);
  20.  
  21. ((System.ComponentModel.ISupportInitialize)(this.axDTAOLFG1)).EndInit(); //Breakpoint on this line.
  22. 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!
Similar Threads
Reputation Points: 22
Solved Threads: 5
Posting Whiz in Training
Drowzee is offline Offline
244 posts
since Jul 2005
Apr 2nd, 2010
0
Re: Strange and consistent ActiveX problem
I've come across the same problem with the same ax component...

did you ever find a solution?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xorcrud is offline Offline
1 posts
since Apr 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: C# fastest coding algorithm
Next Thread in C# Forum Timeline: Need help finishing C#assignment





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC