Programming - cpueblo.com

DLL 호출 예. CodeShuffle (클래스로 된 DLL 을 읽어온다)


글쓴이 : 유광희 날짜 : 2002-06-26 (수) 15:05 조회 : 15139
//#include <afx.h> #include <windows.h> #include "TCodeShuffle.h" void main() { // DLL 로드 HINSTANCE hInst = LoadLibrary ("CodeShuffle.dll"); typedef TCodeShuffle* (*PFNCreateA1)(); // 클래스 적재 함수 받음 PFNCreateA1 pfnCreateA1 = (PFNCreateA1)GetProcAddress(hInst, TEXT("CreateCodeShuffle")); // 클래스 생성 TCodeShuffle* a = (pfnCreateA1)(); int OutputLength; a->SetOptHideComment(true); a->SetOptShuffle(true); a->SetOptVarAddString(true); //a->SetVarAddString("BProject_"); a->SetChangeFile("D:\\\\Mobile Top\\\\서버팀\\\\Project\\\\Code Shuffle\\\\Output\\\\change.txt"); a->SetUnchangeFile("D:\\\\Mobile Top\\\\서버팀\\\\Project\\\\Code Shuffle\\\\Output\\\\unchange.txt"); char *Output = a->Run("D:\\\\Mobile Top\\\\서버팀\\\\Project\\\\Code Shuffle\\\\Output\\\\main.cpp", "", "", &OutputLength); char *Output = a->Run("D:\\\\Mobile Top\\\\서버팀\\\\Project\\\\Code Shuffle\\\\Output\\\\main.cpp", "", "", &OutputLength); char *Output = a->Run("D:\\\\Mobile Top\\\\서버팀\\\\Project\\\\Code Shuffle\\\\Output\\\\main.cpp", "", "", &OutputLength); FILE *fp = fopen("c:\\\\a.out.h", "w"); fwrite(Output, OutputLength, 1, fp); fclose(fp); }