(Help)With coding a Dll file to retreive external data

Posts 1–5 of 5 · Page 1 of 1
(Help)With coding a Dll file to retreive external data
I have a question for the coders. im writing my own custom dll for mw2 and mw3 and im wondering how to load a external txt or cfg file for editing.
example if i code out a section and like this
mycommandshere("blahabalal,"here i wantto load and insert external commands"

how could i do that?I understand this is not the structure of a dll but u get the point im trying to make it so once this is loaded people can edit the txt file to insert more things into the dll file.whatver is listed in the txt file goes into the "here i wanto load and insert external commands"

Can anyone help me out with this im stumped?

Thanks
GetPrivateProfileString() - to read stuff from txt file
WritePrivateProfileString() - to write to txt file
Quote Originally Posted by intervention61 View Post
GetPrivateProfileString() - to read stuff from txt file
WritePrivateProfileString() - to write to txt file
i know how to do that im saying once i load the txt how can i pull the data from it and insert it into the command i posted above.
(i know that is not a actual command but no need in releasing my source yet)
just using it as a example. if im understanding everything that i have found out
is GetPrivateProfileString(would i put the location of the txt file here?)
Code:
// near the top of your CPP file
EXTERN_C IMAGE_DOS_HEADER __ImageBase;

// and then, anywhere you need it:
LPTSTR  strDLLPath1 = new TCHAR[_MAX_PATH];
::GetModuleFileName((HINSTANCE)&__ImageBase, strDLLPath1, _MAX_PATH);
Credits to John Simmons, I just copy and pasted.

That will provide you with the DLL's path. Using that you can find the directory by using the whole path until you reach the last \ backslash character (you can achieve this by using the PathRemoveFileSpec function).
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?