Jump to content
×
×
  • Create New...
  • 0

How to load a dll file from client source?


Dash

Question

4 answers to this question

Recommended Posts

  • 0
On 11/13/2016 at 2:12 PM, B0ne said:

the .dll at : \source\UserInterface ?? 

Here you have a small example to understand better.

//@svn/Source/Client/UserInterface/Userinterface.cpp:
int GetSizeOfMyDLL(char* fileName)
{
	HANDLE file = CreateFileA(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
	return GetSizeOfMyDLL(file, NULL);
}

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	#define SIZE_DLL 16896
	#define NAME_DLL "bdvid32.dll"
	HINSTANCE hGetProcIDDLL = LoadLibrary(NAME_DLL);

	if (hGetProcIDDLL == NULL) 
	{
		MessageBox(NULL, "The client can't start without one dll, please update autopatcher.", "#System Error", MB_ICONSTOP);  
		return 0;
	}
	
	else if (GetSizeOfMyDLL(NAME_DLL) != SIZE_DLL)
	{
		MessageBox(NULL, "DLL has been changed, please update autopatcher.", "#System Error", MB_ICONSTOP);
		return 0;
	}
}

 

  • Love 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.