Problem in using COM Component "MSCOMCTL.OCX" in Vb.net 2008

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Developer111
    New Member
    • Apr 2010
    • 28

    Problem in using COM Component "MSCOMCTL.OCX" in Vb.net 2008

    Hi,

    I converted a VB6 application in VB.net 2008 by using VS 2008 conversion wizard I have encountered a problem in using Tab control in VB.net. I used “Microsoft TabStrip Control 6.0 (SP6)” in VB 6 project. VB.net converter wizard converted it properly and add reference to “AxInterop.MSCo mctlLib.dll” and “Interop.MSComc tlLib.dll”. I am using TabStrip on a Form that is use “Hide” instead of “Close”. So problem is when this form shown again following instruction raises exception:

    a = tbsMain.Selecte dItem.Index

    Exception: NullReferenceEx ception was unhandled “Object reference not set to an instance of an object.”

    But when I browse the selected item’s index value using “Quick Watch” option (while debugging) it returns the correct index instead of nothing value. I am unable to understand what is the problem and is restricted to use only this control. While debugging when I browse SelectedItem property in “tbsMain”, it contains an object of “MSComctlLib.Ta bClass”, I think when “Hide” the Form reference of this object’s memory location is lost but this is just an assumption. I have also attached a demo project to demonstrate the problem.

    Regards,

    Hassan
    Attached Files
Working...