本帖最后由 zj0789 于 2013-08-16 17:24:07 编辑

解决方案 »

  1.   

    Windows XP VS2008下测试了你的代码MessageBox提示"设置成功"
      

  2.   


    我的是XP+VC6.0,提示“设置失败”
    难道是编译工具的问题?
      

  3.   

    shi2_path 
    Pointer to a Unicode string specifying the local path for the shared resource. For disks, shi2_path is the path being shared. For print queues, shi2_path is the name of the print queue being shared. Calls to the NetShareSetInfo function ignore this member.必须是UNICODE字符串,VC6.0默认是ANSI的。
      

  4.   


    问题确实出在这里。转换成UNICODE之后,不在报错了。谢谢!