I am using this code to load a DLL and call its functions
Code:
HRESULT InitMCBandFunction()
{
    HRESULT hr;
    HMODULE hmod = GetModuleHandle(L"MCBand.dll");
	
    if (hmod)
    {
        g_fctShowMCPaneBrowserBar = (FCTSHOWMCPANEBROWSERBAR)GetProcAddress(
            hmod, "ShowMCPaneBrowserBar");

        if (g_fctShowMCPaneBrowserBar)
        {
            hr = S_OK;					
        }
        else
        {
            hr = HRESULTFromGetLastError();
        }

        // Don't call FreeLibrary!
    }
    else
    {
        hr = HRESULTFromGetLastError();		
    }

    return hr;
}
The problem is hmod is returning false. I traced it by putting a messagebox in this code segment

Code:
if (hmod)
    {
        g_fctShowMCPaneBrowserBar = (FCTSHOWMCPANEBROWSERBAR)GetProcAddress(
            hmod, "ShowMCPaneBrowserBar");
MessageBoxA (NULL, "This is a Test Message", "", MB_HELP);

      -----------------------------------------------
      -----------------------------------------------
    }
Can anyone tell me what is the problem with this code segment? why is it returning false??

since I am using this entire code in a DLL not an MFC application therefore i am unable to see the status of get last error, cuz i can't debug it. Can anyone tell me the solution of this??

in this section
Code:
HMODULE hmod = GetModuleHandle(L"MCBand.dll");
if I specify the complete path of the DLL will it work??