Skip to content

Instantly share code, notes, and snippets.

@cztchoice
Created March 12, 2018 06:25
Show Gist options
  • Save cztchoice/02bb07ece234b2d0ddddb12433bfee22 to your computer and use it in GitHub Desktop.
Save cztchoice/02bb07ece234b2d0ddddb12433bfee22 to your computer and use it in GitHub Desktop.
windows load function of dll
void CChromeViewSupport::__LoadLib()
{
typedef bool (*createChromeSupport_t)(IChromeSupportLib** ppChrome);
static createChromeSupport_t pFunc = NULL;
if (m_hLib == NULL)
{
HMODULE h = ::LoadLibrary(L"BrowserLib.dll");
if (h)
{
pFunc = (createChromeSupport_t)::GetProcAddress(h, "CreateChromeSupport");
}
m_hLib = h;
}
if (m_hLib)
{
if (m_pChromeLib.IsNull() && pFunc)
{
pFunc(&m_pChromeLib);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment