昨晚由于需要,把一个BCB项目转换为VC项目,95%的时间都花费在怎样使用CString上面:==============================1、建立一个“A simple Dll Project”类型的DLL。2、在Dll.Cpp中输入 CString Str,
(1)编译错误:#include "stdafx.h"Dll.cpp(7) : error C2146: syntax error : missing ';' before identifier 'Str'
Dll.cpp(7) : error C2501: 'CString' : missing storage-class or type specifiers
Dll.cpp(7) : fatal error C1004: unexpected end of file found(2)改为//#include "stdafx.h"
#include <afx.h>继续错:atal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.
(3)同时包括#include "stdafx.h"
#include <afx.h>还是错:afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
Error executing cl.exe.
靠!服了!!!最后不得不使用STL里边的string类,VC Fans说一说这种错误到底是怎么回事???
(1)编译错误:#include "stdafx.h"Dll.cpp(7) : error C2146: syntax error : missing ';' before identifier 'Str'
Dll.cpp(7) : error C2501: 'CString' : missing storage-class or type specifiers
Dll.cpp(7) : fatal error C1004: unexpected end of file found(2)改为//#include "stdafx.h"
#include <afx.h>继续错:atal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.
(3)同时包括#include "stdafx.h"
#include <afx.h>还是错:afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
Error executing cl.exe.
靠!服了!!!最后不得不使用STL里边的string类,VC Fans说一说这种错误到底是怎么回事???
(默认是not use mfc)
可以用
typedef unsigned short *String;实现BSTR
创建MFC的DLL(包括与MFC静态链接的常规DLL.与MFC动态链接的常规DLL.与MFC动态链接的扩展DLL)
return 0; new CDynLinkLibrary(Dll1DLL);能不能删掉?如果删掉的话,对程序有没有影响?