잠토의 잠망경

지연로딩 본문

공부/API

지연로딩

잠수함토끼 2008. 9. 10. 16:10

DllDelayLIB.h

//사용자 정의 Define
#ifdef MYEXPORTDF
#define MYEXPORT	extern "C" __declspec(dllexport)
#else
#define MYEXPORT	extern "C" __declspec(dllimport)
#endif

#undef UNICODE
#include 
#include 





DllDelayLIB.cpp

#define MYEXPORTDF
#include "DllDelayLIB.h"

MYEXPORT void PutMessage()
{
	MessageBox(NULL,"안녕하세요.","반가워",MB_OK);
}




DelayApp.cpp
//Dll 로딩을 위한 사용자 정의 lib 추가
#pragma comment(lib,"DllDelayLoading.lib")
//지연로딩을 위한 lib 추가
#pragma comment(lib, "DelayImp.lib")


#include "DllDelayLIB.h"
//암시적인 로딩
MYEXPORT void PutMessage();

int main(void)
{	//dll 함수의 호출
	PutMessage();
	return 0;
}

Comments