Link to home
Start Free TrialLog in
Avatar of cophi
cophi

asked on

Directory Path for ActiveX

Hi,

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

Thanks,
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

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?
Avatar of cophi
cophi

ASKER

I would like to have the path of where the dll/ocx is located
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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


small syntax error in jkr's suggestion :

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

:)

MAHESH
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial