Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DLL's folder to look for ini file #580

Open
sytelus opened this issue Mar 16, 2017 · 0 comments
Open

Use DLL's folder to look for ini file #580

sytelus opened this issue Mar 16, 2017 · 0 comments

Comments

@sytelus
Copy link

sytelus commented Mar 16, 2017

The xinput DLL's folder should be included for ini search. This is very important for plugins (for example, Unreal plugins) where DLL path is not same as exe path and DLL is loaded dynamically. In these cases, plugins have no knowledge or control over exe path and its not desirable to modify its folder anyway.

I've this change done but looks like instructions to build and test are outdated or non-existent so I'm unable to test below change. Hopefully, the change is trivial to add, however.

Proposed change in x360ce\x360ce\dllmain.cpp

VOID InitInstance(HMODULE hModule)
{
	IniFile ini;
	std::string inipath("x360ce.ini");
    if (!ini.Load(inipath)) //<--------- look for ini module's directory
        ModuleDirectory(&inipath, hModule);
    if (!ini.Load(inipath))
		CheckCommonDirectory(&inipath, "x360ce");
    if (!ini.Load(inipath)) return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant