Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't make reference to MSCOMCT2.OCX

Status
Not open for further replies.

lennyh

Programmer
Sep 22, 2001
33
0
0
US
In VB6, I'm trying to add a reference to mscomct2.ocx (to use dtpicker control) But whenever I try to add the reference (via Projects|References), I get a "Name conflicts with existing module..." msg. Note that initially the Microsoft Windows Common Controls item does not appear in my References list and I use the browse function to locate mscomct2.ocx in system32. But after I add it to the references list and try to use it, I get the "Conflict message".

Can anyone tell me how to fix this.

Thanks.
 
You would normally add components via the Project | Components menu, rather than the references menu

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
johnwm,

I've tried adding it via Projects|Components also with identical results.

Another curious thing: This appears to be some sort of global problem since I now have the same problem when trying to add any ocx -- not just mscomct2.ocx.
 
Only met this one once before - I had to uninstall & re-install VB. I hope someone else has a better suggestion!

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
More Info: It now appears that this same problem occurs regardless of which ocx I try to add. Here is the sequence:

I go to Projects|References and click the checkbox associated with the new ocx. After I hit OK, the associated tool does not appear in the toolbox. If I go to References again, the checkbox for the ocx I just previously checked is unchecked. If I now click the checkbox again, I get the "Conflict" message. And the tool associated with the ocx still does not appear in the toolbox??
 
Thanks to all who have responded.

Johnwm, your were absolutely correct. Using Components versus References was the solution.

I initially had a problem in that the component dialog box had the checkbox,
"Selected items only", checked thereby causing the list of controls to be blank. When I
couldn't find the control in the components list, I tried to add the same control via
references and encountered the problem.

Also, after I had things kind of screwed up, I had a problem even when I used the Components. I discarded the form and rebuilt it, then used Components and all worked fine.

Thanks for the help.

Lenny Harris

 
Useful post and discussion guys, thank you.

I came across the same name conflict message and it looked like a reinstall, but...

The solution was to:
* check the project in (if using SafeSource)
* Close VB and Reboot the machine (VB now wakes up)
* reload the project
* reference will be gone and you can add the component

NB: Use Project/Components not References.
Ensure the 'Selected Items Only' tick is not checked. :)

Rob Hasard
Data Manager -Genetic Services
(VB6 /SQL 7.0)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top