user1670518
user1670518

Reputation: 15

How to Get the Dll path from the hard Disk?

I have created a subkey under HKEY_LOCAL_MACHINE using RegCreateKeyEx where in i m saving the NAME,TYPE DATA(Path of the dll on hardd disk). 1.I have set value as the name of the Dll i m registering using Regsvr32. 2. I have set the type to REG_SZ using RegSetValueEx. Now,i need to set the Data as the path of the Dll(Hard disk path). Can anyone help me out?

Thanks In Advance

Upvotes: 1

Views: 164

Answers (1)

WhozCraig
WhozCraig

Reputation: 66194

Are you executing code in the DLL when you want to do this? Assuming that is the case, DllMain is passed a module handle when your DLL is first loaded. Pass this module handle to GetModuleFileName for the full path to your DLL.

Upvotes: 1

Related Questions