如题!!
typedef struct _NETRESOURCE {
DWORD dwScope;
DWORD dwType;
DWORD dwDisplayType;
DWORD dwUsage;
LPTSTR lpLocalName;
LPTSTR lpRemoteName;
LPTSTR lpComment;
LPTSTR lpProvider;
} NETRESOURCE;
NETRESOURCE ns;
CStringList grouplist;
我想把
grouplist.RemoveHead()的值赋给
ns.lpRemoteName
怎么办??
typedef struct _NETRESOURCE {
DWORD dwScope;
DWORD dwType;
DWORD dwDisplayType;
DWORD dwUsage;
LPTSTR lpLocalName;
LPTSTR lpRemoteName;
LPTSTR lpComment;
LPTSTR lpProvider;
} NETRESOURCE;
NETRESOURCE ns;
CStringList grouplist;
我想把
grouplist.RemoveHead()的值赋给
ns.lpRemoteName
怎么办??
(LPTSTR)CString1
LPTSTR lpstr=(LPTSTR)(LPCTSTR)str;
出错!!
(LPTSTR)CString1也不行!!
或
(LPTSTR)&str
多试一下,具体的不知道
用完后ReleaseBuffer(),参照July 2000 MSDN 的CString::GetBuffer 。
顺便Copy给你看ExampleThe following example demonstrates the use of CString::GetBuffer.// example for CString::GetBuffer
CString s( "abcd" );
LPTSTR p = s.GetBuffer( 10 );
strcpy( p, "Hello" ); // directly access CString buffer
s.ReleaseBuffer( );
CString str("demo");
LPTSTR lpstr=(LPTSTR)(LPCTSTR)str;
方法可行
谢谢zhuojohn
我还不知道为什么?能解释一下吗??