2014년 7월 18일 금요일

[MFC] Plug-In 만들기1

MFC에 Add-In(Plug-In)기능을 만들어 보자.
MFC로 개발하면서 이클립스 같은 Plug-In기능을 구현해 보려고 한다.

http://www.codeproject.com/Articles/2489/Plug-In-framework-using-DLLs
에 올라온 예제 코드를 참조하여 구현해 볼것이다. 설명도 제법 잘 써놨다. 10년도 더된 코드지만 아무것도 모르는 나에게는 매우 유용한 소스코드다.
위에 따르면 프로그램은 다음과 같은 과정을 거친다.
  1. The main app is initialized (i.e. started)
  2. The DLLs/Plug-Ins are searched in the directory (may be pre-determined)
  3. Once "valid" DLLs are found, all or selected DLLs are loaded
  4. "Init" function is invoked on all loaded DLLs
  5. The instance and the DLL name/path are cached for future use (method invocation)
  6. User uses the functionality of the DLLs (using GUI interfaces provided by the DLLs)
  7. Once done, the main application invokes "Destroy" function of the DLLs one by one to free resources
  8. The main application exits
마지막에 하는 말이 간단하다고 한다..ㅡㅡ 난 왜이리 낯설고 어렵운지 MFC의 경험이 많지 않아서 (C++ 포함) 그런지 매우어렵다. 프로그램이 대충 어찌 돌아야 하는지 알았으니 예제 따라 구현해봐야지~~

댓글 없음:

댓글 쓰기