#include <iostream>
#include <windows.h>
#include "g.h"



typedef unsigned long (*AsmFunc)(AS_INBUF *, AS_OUTBUF *, T_REG_INF *, T_MPCNT *, ICE_ID *);


int main()
{
AsmFunc _AsmFunc;


HINSTANCE hInstLibrary = LoadLibrary((LPCWSTR)L"C:\Documents and Settings\karthikdatt\Desktop");


if (hInstLibrary)
{
_AsmFunc = (AsmFunc)GetProcAddress(hInstLibrary, "Assembler");



if (_AsmFunc)
{
std::cout << "ASSEMBLER FUNCTION" << _AsmFunc(ptr1,ptr2,ptr3,ptr4,ptr5) << std::endl;
}


}



else
{
std::cout << "DLL Failed To Load!" << std::endl;
}


FreeLibrary(hInstLibrary);



}

iam not able to load that dll file... its printing DLL Failed To Load!... so plaz anyone help me in rectifying this problem.....

Edited 3 Years Ago by Nick Evan: Fixed formatting

Ya thanks now its going inside if (hInstLibrary) function but its not going inside this
if (_AsmFunc) loop... is there any problem in
_AsmFunc = (AsmFunc)GetProcAddress(hInstLibrary, "Assembler");

GetProcAddress() is returning 0 so iam not able to call the function..
what may be the possible reasons ???

The most obvious answer is, there isn't a function called "Assembler" in the DLL. Maybe there's a typo in how you built the DLL, or in what symbol-name you're expecting to find in it?

This question has already been answered. Start a new discussion instead.