• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 294
  • Last Modified:

How do I know which ocx is current using?

I have this two files for calendar control, first one is Version 11.0, second one is 8.0
"C:\Program Files\Microsoft Office\OFFICE11\MSCAL.OCX"
"C:\WINDOWS\system32\MSCAL.OCX"

How do I know when the program is running, which one is currently using?
0
william007
Asked:
william007
  • 4
  • 3
  • 2
  • +2
3 Solutions
 
Mark_FreeSoftwareCommented:

try to rename one (when the program runs) and if it is not possible than is that the one used...
0
 
Éric MoreauSenior .Net ConsultantCommented:
Hi william007,

if you open your project's source code and you go to Project->Components and select the calendar component, you will see the complete path of the used component.

You can also open the registry and search for mscal.ocx in InProcServer32 key.
   

Cheers!
0
 
william007Author Commented:
Hi,

>>if you open your project's source code and you go to Project->Components and select the calendar component, you will see the complete path of the used component.
Isn't there is a process like this
"go and get the guid as retrieved by the project references for this class, check the registry for the filename it is mapped to, open the file and call the internal CoCreateInstance of this class"
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21652467.html (Accepted Answer)

Will the MSCAL.OCX Version 11 and MSCAL.OCX Version 8 contain the same GUID?
How we know their GUID?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Éric MoreauSenior .Net ConsultantCommented:
>>Will the MSCAL.OCX Version 11 and MSCAL.OCX Version 8 contain the same GUID?

I think so because I think they were set to "binary compatible".
0
 
Leo EikelmanCommented:
I know it's stored in the registry somewhere.

I'm not exactly sure where though


anyone could expand on this?

Leo
0
 
william007Author Commented:
Hi, I have asked the related question here. (I know we can use a find in registry, enter the mscal.ocx file name, and we will finally reach a folder that using the GUID as its folder name, my objective here is to get the GUID without register it, thanks:))
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21787383.html
0
 
Éric MoreauSenior .Net ConsultantCommented:
if you open your project's .vbp file, you will see is the class id.
0
 
danaseamanCommented:
To get the GUID of MsCal.Ocx without registering add a reference to "TypeLib Information" and use this code:
Option Explicit

    Private Sub Form_Load()
    Dim t As TypeLibInfo
    Set t = TLI.TypeLibInfoFromFile("mscal.ocx")
    MsgBox "GUID = " & t.Guid
End Sub

From there you can search the registry for this GUID under HKEY_CLASSES_ROOT\CLSID\ and find the default value. On my machine it is:
     (Default)     REGSZ      Calendar Control 11.0

This info ("Microsoft Office Access Calendar Control Version 11.0") is also available under Calendar AboutBox but I assume you are trying to get this info programmatically.


0
 
william007Author Commented:
Thanks, I have never noticed that About box until now. It is really the fastest way to know the version that we are using.
I have asked another relevant question here
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21787857.html
0
 
william007Author Commented:
Thanks:-)
0
 
Mark_FreeSoftwareCommented:

happy coding, and thanx for the points!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now