第一个参数为LPWSTR servername,  我已经定义了 CString szIP("\\\\192.168.0.1");
USES_CONVERSION;
LPWSTR x =A2W(szIP);
但编译错误为cannot convert parameter 1 from 'unsigned short *' to 'char *'
为什么阿?

解决方案 »

  1.   

    try A2W((char*)szIP) or T2COLE((char*)szIP)。
      

  2.   

    NetShareEnum的第一个参数到底是什么类型阿?
      

  3.   

    the msdn help about the funciotn is queer。
    i think,the first parameter should be type of (const char *) or LPTSTR, 
    so you try to direct pass (char *)szIP to it。
      

  4.   

    我使用szIP.GetBuffer (0),能编译成功,但是测试的时候老是得到53错误 不成功阿
      

  5.   

    错了 是CString szIP("192.168.0.1");  但是也不成功
      

  6.   

    you can use wchar_t  type,see this example:
    http://www.mvps.org/win32/network/nshe.cpp
      

  7.   

    the 53 error code is "找不到网络路径。 "