Get a way to run an executable file in the Windows API for FREE

Hey, I'm trying to get the path to the dll located in the same folder as my exe file. It seems to use one of QueryFullProcessImageName()or GetModuleFileName()to get the path to the executable executable, and then use string manipulation to instead make the path to the desired library.

Unfortunately, none of these two functions allows you to know the size buffer in advance. I tried to skip zero for the nSize parameter, but this does not have the desired effect.

What is the best practice way to do this?

+3
source share
2 answers

Windows API MAX_PATH , , 1 .

Windows . , MAX_PATH 270 , NTFS () 32767 . Unicode, , , Windows Explorer , .

, - , , -, , Unicode ( ) / ( DOS 8.3 ) / , , / .

hth.,

+3

GetModuleFilename , . , , . , .

0

Source: https://habr.com/ru/post/1788770/


All Articles