ebdlib1.cpp
Upload User: kelijie
Upload Date: 2007-01-01
Package Size: 123k
Code Size: 1k
Category:

Graph program

Development Platform:

Visual C++

  1. // ebdlib1.cpp : Defines the initialization routines for the DLL.
  2. //
  3. #include "stdafx.h"
  4. #include "ebdlib1.h"
  5. #ifdef _DEBUG
  6. #define new DEBUG_NEW
  7. #undef THIS_FILE
  8. static char THIS_FILE[] = __FILE__;
  9. #endif
  10. static AFX_EXTENSION_MODULE EBDLID1DLL = { NULL, NULL };
  11. extern "C" int APIENTRY
  12. DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
  13. {
  14. // Remove this if you use lpReserved
  15. UNREFERENCED_PARAMETER(lpReserved);
  16. if (dwReason == DLL_PROCESS_ATTACH)
  17. {
  18. TRACE0("EBDLIB1.DLL Initializing!n");
  19. // Extension DLL one-time initialization
  20. if (!AfxInitExtensionModule(EBDLID1DLL, hInstance))
  21. return 0;
  22. }
  23. else if (dwReason == DLL_PROCESS_DETACH)
  24. {
  25. TRACE0("EBDLIB1.DLL Terminating!n");
  26. // Terminate the library before destructors are called
  27. AfxTermExtensionModule(EBDLID1DLL);
  28. }
  29. return 1;   // ok
  30. }
  31. _declspec(dllexport) int InitTemplate(CDocTemplate** pDocTemplate)
  32. {
  33.  
  34. new CDynLinkLibrary(EBDLID1DLL);
  35. *pDocTemplate =  new CSingleDocTemplate(ID_ROUND,
  36.                                RUNTIME_CLASS(CRoundDoc),
  37.                                RUNTIME_CLASS(CRoundFrame),
  38.                                RUNTIME_CLASS(CRoundView));
  39.  
  40. if(*pDocTemplate == NULL)
  41. return 0;
  42. return 1;
  43. }
  44. _declspec(dllexport) int GetModuleData(int *iID, CString* nickname)
  45. {
  46. new CDynLinkLibrary(EBDLID1DLL);
  47. *iID = ID_ROUND;
  48. *nickname = "Image";
  49. return 1;
  50. }