用CFile类如何实现想文件写入数据?
2个回答
2011-08-17
展开全部
typedef int (WINAPI ICEPUB_WRITETEXTTOFILE)(char *strText,char *strFilename,int traceFlag);
ICEPUB_WRITETEXTTOFILE *icePub_writeTextToFile = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_writeTextToFile = (ICEPUB_WRITETEXTTOFILE *)GetProcAddress(hDLLDrv, "icePub_writeTextToFile");
}
if(icePub_writeTextToFile != NULL)
{
icePub_writeTextToFile("上火了!","D:\桥樱\program files\\test\\a.txt",1);
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
typedef int (WINAPI ICEPUB_APPENDTEXTTOFILE)(char *strText,char *strFilename,int traceFlag);
ICEPUB_APPENDTEXTTOFILE *icePub_appendTextToFile = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_appendTextToFile = (ICEPUB_APPENDTEXTTOFILE *)GetProcAddress(hDLLDrv, "icePub_appendTextToFile");
}
if(icePub_appendTextToFile != NULL)
{
icePub_appendTextToFile("头晕、眼花、走路打晃晃!","D:\漏型\program files\敏搜丛\test\\c.txt",1);
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
ICEPUB_WRITETEXTTOFILE *icePub_writeTextToFile = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_writeTextToFile = (ICEPUB_WRITETEXTTOFILE *)GetProcAddress(hDLLDrv, "icePub_writeTextToFile");
}
if(icePub_writeTextToFile != NULL)
{
icePub_writeTextToFile("上火了!","D:\桥樱\program files\\test\\a.txt",1);
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
typedef int (WINAPI ICEPUB_APPENDTEXTTOFILE)(char *strText,char *strFilename,int traceFlag);
ICEPUB_APPENDTEXTTOFILE *icePub_appendTextToFile = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_appendTextToFile = (ICEPUB_APPENDTEXTTOFILE *)GetProcAddress(hDLLDrv, "icePub_appendTextToFile");
}
if(icePub_appendTextToFile != NULL)
{
icePub_appendTextToFile("头晕、眼花、走路打晃晃!","D:\漏型\program files\敏搜丛\test\\c.txt",1);
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
参考资料: icePubDll.dll百度之即可
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询