Jump to content

How to load a dll file from client source?


Go to solution Solved by Koray,

Recommended Posts

  • 1 year later...
  • 7 months later...
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 0

      Moving server from FreeBSD 11.2 to 13.2 - lib needed

    2. 0

      I just implemented some costumes and they are not visible

    3. 0

      Skill Tree Problem

    4. 97

      Ulthar SF V2 (TMP4 Base)

    5. 5

      Client Crashes through Offline Shop (Ikarus)

    6. 5

      VIVY-WORLD2 - FARM TO THE TOP

    7. 0

      ToolTip Bug?

    8. 0

      Skill tree build erorr

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

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.