By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,732 Members | 824 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,732 IT Pros & Developers. It's quick & easy.

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

P: 28

I converted a VB6 application in 2008 by using VS 2008 conversion wizard I have encountered a problem in using Tab control in I used “Microsoft TabStrip Control 6.0 (SP6)” in VB 6 project. converter wizard converted it properly and add reference to “AxInterop.MSComctlLib.dll” and “Interop.MSComctlLib.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.SelectedItem.Index

Exception: NullReferenceException 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.TabClass”, 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.


Attached Files
File Type: zip (272.6 KB, 67 views)
Sep 9 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.