积极答复者
cstring替代函数的问题

问题
答案
-
Hi Honny_yeyh,
>>因为我写的是没有带mfc的dll
可是您贴出来的代码,像heroboy说的“CInternetSession CHttpFile都是mfc都要用到mfc的dll”是怎么回事?
>>ReadString(myData) 要用到CString, 问下有没有替代函数,不要用CString
virtual LPTSTR ReadString(
LPTSTR lpsz,
UINT nMax
);
Lpsz:是用户提供的一个执行字符串的指针,它用来接受从文件读出的文本,以“\0”结束。
nMax:是本次所允许读入的文本字符个数,不计”\0”字符,也就是说最多能读入nMax-1个文本字符。
另一种格式是:
virtual BOOL ReadString(
CString& rString
);
rString:用来容纳从文件读出的文本。
您可以选择用第一个格式,就不必用到CString。
具体关于ReadString及如何使用的信息,请看:http://msdn.microsoft.com/en-us/library/x5t0zfyf(VS.80).aspx
谢谢,
Lucy
Lucy Liu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 Honny_yeyh 2011年3月16日 4:11
全部回复
-
用ATL::CString看看
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP -
Hi Honny_yeyh,
>>因为我写的是没有带mfc的dll
可是您贴出来的代码,像heroboy说的“CInternetSession CHttpFile都是mfc都要用到mfc的dll”是怎么回事?
>>ReadString(myData) 要用到CString, 问下有没有替代函数,不要用CString
virtual LPTSTR ReadString(
LPTSTR lpsz,
UINT nMax
);
Lpsz:是用户提供的一个执行字符串的指针,它用来接受从文件读出的文本,以“\0”结束。
nMax:是本次所允许读入的文本字符个数,不计”\0”字符,也就是说最多能读入nMax-1个文本字符。
另一种格式是:
virtual BOOL ReadString(
CString& rString
);
rString:用来容纳从文件读出的文本。
您可以选择用第一个格式,就不必用到CString。
具体关于ReadString及如何使用的信息,请看:http://msdn.microsoft.com/en-us/library/x5t0zfyf(VS.80).aspx
谢谢,
Lucy
Lucy Liu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 Honny_yeyh 2011年3月16日 4:11