?
Solved

Directory Path for ActiveX

Posted on 2006-04-28
6
Medium Priority
?
999 Views
Last Modified: 2013-11-20
Hi,

I'm interested in know the path that the ActiveX is running.  How would I find this out?

Thanks,
0
Comment
Question by:cophi
6 Comments
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 16562414
That will be the path of the application it is run in.  

Or do you mean the path to the dll/ocx that is the code for the ActiveX control?
0
 

Author Comment

by:cophi
ID: 16562512
I would like to have the path of where the dll/ocx is located
0
 
LVL 86

Accepted Solution

by:
jkr earned 1600 total points
ID: 16562533
That you can obtain using

char acControlPath[MAX_PATH];

GetModuleFileName(GetModuleHandle("MyControl.dll"),MAX_PATH);
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 22

Expert Comment

by:mahesh1402
ID: 16562535
Most registerd Activex (ocx) / DLL files are located at windir\system or windir\system32 foler or applications current path but not every.

You may query registry to retrieve path of your activex / dll control If you know CLSID of your control.

HKEY_CLASSES_ROOT\CLSID\{CLSID or the component}\InprocServer32   <=== look at this registry path to locate path of your control....where CLSID is CLSID of your ocx control .

You may use GetClassID() or CLSIDFromProgID() to get CLSID of your control. You may use RegOpenKeyEx / RegQueryValueEx functions to open and retrieve registry values.


MAHESH


0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 16562599
small syntax error in jkr's suggestion :

GetModuleFileName(GetModuleHandle("MyControl.dll"),acControlPath); <== and not MAX_PATH

:)

MAHESH
0
 
LVL 22

Assisted Solution

by:mahesh1402
mahesh1402 earned 400 total points
ID: 16562619
oops.

GetModuleFileName(GetModuleHandle("MyControl.dll"),acControlPath,MAX_PATH);  <== correct

MAHESH
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question