Get the file path function GetModuleFileName ()

Source: Internet
Author: User

In the project, often need to get the relative path and absolute path problem, here to get the current get executable EXE file functions, but also related to string splicing and other issues; there is no time to write down;

Here GetModuleFileName this function is the key, it can get the current application exe file path, but also know the path of the DLL file, which depends mainly on the first parameter, if the first parameter is NULL, it means that the current application EXE file path is obtained. If the first parameter is GetModuleHandle ("DLL file name"), then the path to the DLL file is obtained, so that you can know where it was loaded in LoadLibrary. It should be noted that DLL files and EXE files can not be placed on the same path.



Get the file path function GetModuleFileName ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.