我用的VC 6.0
不是说修改什么设置就行么?求教如何处理和修改。谢谢。
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1459) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1463) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1504) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1512) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1520) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1528) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1536) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1614) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1671) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1694) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1732) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1759) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1783) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1806) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1829) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1967) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(1972) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3277) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3285) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3293) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast

解决方案 »

  1.   

    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3301) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
            This conversion requires a reinterpret_cast, a C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3309) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
            This conversion requires a reinterpret_cast, a C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3399) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3456) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3479) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3517) : error C2664: 'int __thiscall CString::Find(char) const' : cannot convert parameter 1 from 'unsigned short [2]' to 'char'
            This conversion requires a reinterpret_cast, a C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3547) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3571) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3594) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3617) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3768) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3773) : error C2664: 'void __cdecl CString::Format(const char *,...)' : cannot convert parameter 1 from 'unsigned short [3]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3970) : error C2664: 'wcstombs' : cannot convert parameter 2 from 'class CString' to 'const unsigned short *'
            No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(4022) : warning C4244: '=' : conversion from 'double' to 'unsigned char', possible loss of data
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(4095) : error C2664: 'wcstod' : cannot convert parameter 1 from 'const char *' to 'const unsigned short *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(4096) : error C2664: 'wcstod' : cannot convert parameter 1 from 'const char *' to 'const unsigned short *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    MyProjectDlg.cpp
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(139) : error C2664: 'int __thiscall CListCtrl::InsertColumn(int,const char *,int,int,int)' : cannot convert parameter 2 from 'unsigned short [6]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(140) : error C2664: 'int __thiscall CListCtrl::InsertColumn(int,const char *,int,int,int)' : cannot convert parameter 2 from 'unsigned short [9]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(186) : error C2665: 'AfxMessageBox' : none of the 2 overloads can convert parameter 1 from type 'unsigned short [7]'
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(331) : error C2664: 'SHGetPathFromIDListA' : cannot convert parameter 2 from 'unsigned short [260]' to 'char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(363) : error C2664: 'int __thiscall CListCtrl::InsertItem(int,const char *)' : cannot convert parameter 2 from 'unsigned short *' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(372) : error C2664: 'int __thiscall CListCtrl::InsertItem(int,const char *)' : cannot convert parameter 2 from 'unsigned short *' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(393) : error C2665: 'AfxMessageBox' : none of the 2 overloads can convert parameter 1 from type 'unsigned short [13]'
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(454) : error C2665: 'AfxMessageBox' : none of the 2 overloads can convert parameter 1 from type 'unsigned short [45]'
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(481) : error C2665: 'AfxMessageBox' : none of the 2 overloads can convert parameter 1 from type 'unsigned short [27]'
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(529) : error C2665: 'AfxMessageBox' : none of the 2 overloads can convert parameter 1 from type 'unsigned short [34]'
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(629) : error C2665: 'AfxMessageBox' : none of the 2 overloads can convert parameter 1 from type 'unsigned short [18]'
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(664) : error C2664: 'MessageBoxExA' : cannot convert parameter 3 from 'unsigned short [15]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(674) : error C2065: 'HIMETRIC_INCH' : undeclared identifier
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(708) : error C2664: 'MessageBoxExA' : cannot convert parameter 2 from 'unsigned short [32]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(724) : error C2664: 'MessageBoxExA' : cannot convert parameter 2 from 'unsigned short [37]' to 'const char *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    Generating Code...
    Error executing cl.exe.MyProject.exe - 50 error(s), 1 warning(s)
      

  2.   

    类型转换有问题。你看看编译的警告等级。PROJECT->Settings->c/c++下  warning level 
      

  3.   

    这个应该是 Unicode 与 ANSI 字符集的问题, 应该是你的代码里面用了 wchar_t 或类似的 Unicode 下面的字符,但是 Release 又没有设置为 Unicode 导致。看看 Debug 下面的编译选项和Release的区别,
      

  4.   

    修改了下,如楼上所说,现在都是类型转换问题了,但是最后一个错误我十分不明白看了2遍,所有大括号都对应,也包含头文件#include "stdafx.h"到底为什么还真不知道,在debug编译下一个错误没有,换为relese就出错敢问楼上仁兄,能否把设置说的详细些?在那里修改或者对应他们的设置?C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(3970) : error C2664: 'wcstombs' : cannot convert parameter 2 from 'class CString' to 'const unsigned short *'
            No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(4022) : warning C4244: '=' : conversion from 'double' to 'unsigned char', possible loss of data
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(4095) : error C2664: 'wcstod' : cannot convert parameter 1 from 'const char *' to 'const unsigned short *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\LyhDicom.cpp(4096) : error C2664: 'wcstod' : cannot convert parameter 1 from 'const char *' to 'const unsigned short *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    MyProjectDlg.cpp
    C:\Documents and Settings\Administrator\桌面\培训\MFCTaskTwo\MyProjectDlg.cpp(951) : fatal error C1004: unexpected end of file found
    Generating Code...
    Error executing cl.exe.MyProject.exe - 4 error(s), 1 warning(s)
      

  5.   

    这个去网上搜索, VC6 Unicode 就可以找到怎么设置的VC6 编译 Unicode的
    C1004: unexpected end of file found  这个错误一般都会是这个文件没有 #include "stdafx.h", 先检查这个有没有,再清理一下,再编译
      

  6.   

    仁兄。我项问的是怎么设置Debug 下面的编译选项和Release的。我加了_unicode也是一样的错误。
      

  7.   

    你调用CString类的Find函数的代码贴出来看看!
      

  8.   

    double CLyhDicom::CStringtoDouble(CString csValue)
    {
    CString csNew = "";
    int nIndex = csValue.Find( '.' );
    if( nIndex != -1 )
    {
    csNew = csValue.Left( nIndex + 3);
    }
    else
    {
    csNew = csValue;
    }
     
    char szValue[100];
    wcstombs(szValue, csNew, 100 );
    return  atof(szValue);
    }error C2664: 'wcstombs' : cannot convert parameter 2 from 'class CString' to 'const unsigned short *'void CLyhDicom::GetPixelDims(float* vx,float* vy)
    {
    wchar_t* stop_stirng;
    *vx = (float)wcstod((LPCTSTR)m_stImgnData.csVoxelDimsx,&stop_stirng);
    *vy = (float)wcstod((LPCTSTR)m_stImgnData.csVoxelDimsy,&stop_stirng);
    }error C2664: 'wcstod' : cannot convert parameter 1 from 'const char *' to 'const unsigned short *'
    error C2664: 'wcstod' : cannot convert parameter 1 from 'const char *' to 'const unsigned short *'
      

  9.   

    这些都是在Relese编译才错误,在Debug编译时候一个错误没有 - -~!谁能给我讲讲啊。我晕,听说有Debug换成Relese版就改下设置就行了?敢问要改什么啊?能详细讲讲么?
      

  10.   

    你的release配置肯定使用了unicode配置,应该把字符集设置为 多字节,multi-byte
      

  11.   

    先参考下这篇文章怎么设置,网上随便搜的。
    http://read.newbooks.com.cn/info/177124.html
    再根据这个文件的设置提示,注意观察下你的工程的 Debug 与 Release 配置的区别。
      

  12.   

    看了下这个函数 CStringtoDouble(CString csValue),你的工程大部分都是用 Unicode 的方式编码, 现在完全可以确定,编这些代码的人只是把 debug 版本的编译设置改过了,没有改过Release下的。最好的方式还是参考下编译设置,自己改改,代码肯定没有问题。只会是编译/链接选项的问题。
      

  13.   

    - - 在寒碜我啊,修改好了。我写的程序,里面有3个文件,一个cpp,2个h是加上的,因为用的到。就把Debug和Relese设置一一对应后,就可以成功编译运行了,我晕,找半天就找这个设置的下拉框呢感谢大家了,辛苦了