Putfileborn_dll.cpp
上传用户:jindun001
上传日期:2021-02-02
资源大小:13780k
文件大小:2k
源码类别:

射击游戏

开发平台:

Visual C++

  1. // Putfileborn_dll.cpp : Defines the initialization routines for the DLL.
  2. //
  3. #include "stdafx.h"
  4. #include "Putfileborn_dll.h"
  5. #ifdef _DEBUG
  6. #define new DEBUG_NEW
  7. #undef THIS_FILE
  8. static char THIS_FILE[] = __FILE__;
  9. #endif
  10. //
  11. // Note!
  12. //
  13. // If this DLL is dynamically linked against the MFC
  14. // DLLs, any functions exported from this DLL which
  15. // call into MFC must have the AFX_MANAGE_STATE macro
  16. // added at the very beginning of the function.
  17. //
  18. // For example:
  19. //
  20. // extern "C" BOOL PASCAL EXPORT ExportedFunction()
  21. // {
  22. // AFX_MANAGE_STATE(AfxGetStaticModuleState());
  23. // // normal function body here
  24. // }
  25. //
  26. // It is very important that this macro appear in each
  27. // function, prior to any calls into MFC.  This means that
  28. // it must appear as the first statement within the 
  29. // function, even before any object variable declarations
  30. // as their constructors may generate calls into the MFC
  31. // DLL.
  32. //
  33. // Please see MFC Technical Notes 33 and 58 for additional
  34. // details.
  35. //
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CPutfileborn_dllApp
  38. BEGIN_MESSAGE_MAP(CPutfileborn_dllApp, CWinApp)
  39. //{{AFX_MSG_MAP(CPutfileborn_dllApp)
  40. // NOTE - the ClassWizard will add and remove mapping macros here.
  41. //    DO NOT EDIT what you see in these blocks of generated code!
  42. //}}AFX_MSG_MAP
  43. END_MESSAGE_MAP()
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CPutfileborn_dllApp construction
  46. CPutfileborn_dllApp::CPutfileborn_dllApp()
  47. {
  48. // TODO: add construction code here,
  49. // Place all significant initialization in InitInstance
  50. }
  51. /////////////////////////////////////////////////////////////////////////////
  52. // The one and only CPutfileborn_dllApp object
  53. CPutfileborn_dllApp theApp;
  54. extern "C" _declspec(dllexport)void PutFileborn(int * arr ,int point)
  55. {
  56. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  57. FILE *fp;
  58. if(1==point)
  59. fp=fopen("born1.dat","rb");
  60. else 
  61. fp=fopen("born2.dat","rb");
  62.     if(!fp)
  63. return;
  64. for(int i=0;i<32;i++)
  65.     for(int j=0;j<32;j++)
  66.         fread(&arr[32*i+j],sizeof(int),1,fp);
  67.     fclose(fp);
  68. }