一个头文件问题(100分)

  • 主题发起人 主题发起人 wjxiaoshen
  • 开始时间 开始时间
W

wjxiaoshen

Unregistered / Unconfirmed
GUEST, unregistred user!
#ifndef MyDllH<br>#define MyDllH<br><br>#ifdef __BUILDING_THE_DLL<br>#define __EXPORT_TYPE __export<br>#else<br>#define __EXPORT_TYPE __import<br>#endif<br>//---------------------------------------------- &nbsp; &nbsp;<br>extern "C" __EXPORT_TYPE void &nbsp; WINAPI GetFileName(char *FileName);<br>extern "C" __EXPORT_TYPE void &nbsp; &nbsp;WINAPI ShowTimeForm(TDate* DateTime,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool ShowWeekNumbers);<br>&nbsp;//----------------------------------------<br>&nbsp;#endif<br>编译时报错#ifndef MyDllH<br>#define MyDllH<br><br>#ifdef __BUILDING_THE_DLL<br>#define __EXPORT_TYPE __export<br>#else<br>#define __EXPORT_TYPE __import<br>#endif<br>//---------------------------------------------- &nbsp; &nbsp;<br>extern "C" __EXPORT_TYPE void &nbsp; WINAPI GetFileName(char *FileName);<br>extern "C" __EXPORT_TYPE void &nbsp; &nbsp;WINAPI ShowTimeForm(TDate* DateTime,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool ShowWeekNumbers);<br>&nbsp;//----------------------------------------<br>&nbsp;#endif<br>#ifndef MyDllH<br>#define MyDllH<br><br>#ifdef __BUILDING_THE_DLL<br>#define __EXPORT_TYPE __export<br>#else<br>#define __EXPORT_TYPE __import<br>#endif<br>//---------------------------------------------- &nbsp; &nbsp;<br>extern "C" __EXPORT_TYPE void &nbsp; WINAPI GetFileName(char *FileName);<br>extern "C" __EXPORT_TYPE void &nbsp; &nbsp;WINAPI ShowTimeForm(TDate* DateTime,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool ShowWeekNumbers);<br>&nbsp;//----------------------------------------<br>&nbsp;#endif<br>#ifndef MyDllH<br>#define MyDllH<br><br>#ifdef __BUILDING_THE_DLL<br>#define __EXPORT_TYPE __export<br>#else<br>#define __EXPORT_TYPE __import<br>#endif<br>//---------------------------------------------- &nbsp; &nbsp;<br>extern "C" __EXPORT_TYPE void &nbsp; WINAPI GetFileName(char *FileName);<br>extern "C" __EXPORT_TYPE void &nbsp; &nbsp;WINAPI ShowTimeForm(TDate* DateTime,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bool ShowWeekNumbers);<br>&nbsp;//----------------------------------------<br>&nbsp;#endif<br><br>编译时报错<br>&nbsp;MYDLL.H(10): E2449 Size of 'WINAPI' is unknown or zero<br>另外,说TDate不知道<br>
 
WINAPI 在windows.h里面定义的吧<br><br>把windows.h include进去吧
 
感谢wrench的帮助,我已解决WINAPI问题,<br>不过还有一个TDate问题,它应该是一个类吧,但有报错:<br>[C++ Error] MYDLL.H(13): E2451 Undefined symbol 'TDate'<br>
 
是什么 C++ ?<br>BCB: #include &lt;vcl.h&gt;<br>VC : 使用 MFC
 
#include &lt;controls.h&gt;
 
#include &lt;controls.h&gt;
 
#include "controls.h"<br><br>气死了 被尖括号搞两次 只好用引号
 
真不好意思,还有一个问题:<br>有一处#include "CCALENDAR.h"<br>&nbsp;出错:<br>[C++ Error] TIMEFORM.H(10): E2209 Unable to open include file 'CCALENDAR.h'<br>
 
查找这个文件 <br>拷贝到工程的目录下来
 
接受答案了.
 
后退
顶部