Clark Gaebel
Clark Gaebel

Reputation: 17988

How do I get the application name from within a dll?

If I had a dll (foo.dll) that was LoadLibrary'd into an application (bar.exe), how do I get the string "bar.exe" from within foo.dll?

Upvotes: 1

Views: 729

Answers (1)

i_am_jorf
i_am_jorf

Reputation: 54640

Pass NULL as the first parameter to GetModuleFileName().

Upvotes: 3

Related Questions