我用VC++6。0向导编了一个ATL COM DLL 但是我编 译时出了错误。内容如下:
--------------------Configuration: comdemo - Win32 Debug--------------------
Creating Type Library...
Processing E:\vcstudy\comdemo\comdemo.idl
comdemo.idl
Command line error D2027 : cannot execute 'c1'
midl : command line error MIDL1003 : error returned by the C preprocessor (2)
Error executing midl.exe.comdemo.dll - 2 error(s), 0 warning(s)请大侠帮帮我?高分。

解决方案 »

  1.   

    是不是你的vc没有了c1.dll文件一般是在
    .......Program Files\Microsoft Visual Studio\VC98\Bin\   下!
      

  2.   

    import "oaidl.idl";
    import "ocidl.idl";[
    uuid(581445A1-10EF-432F-867C-8A06034ADF9D),
    version(1.0),
    helpstring("comdemo 1.0 Type Library")
    ]
    library COMDEMOLib
    {
    importlib("stdole32.tlb");
    importlib("stdole2.tlb");};--------------------Configuration: comdemo - Win32 Debug--------------------Command Lines
    Creating command line "midl.exe /nologo /D "_DEBUG" /tlb ".\comdemo.tlb" /h "comdemo.h" /iid "comdemo_i.c" /mktyplib203 /Oicf /win32 "E:\vcstudy\comdemo\comdemo.idl""
    Creating command line "rc.exe /l 0x804 /fo"Debug/comdemo.res" /d "_DEBUG" /d "_AFXDLL" "E:\vcstudy\comdemo\comdemo.rc"" 
    Creating temporary file "C:\DOCUME~1\malerong\LOCALS~1\Temp\RSP2D.tmp" with contents
    [
    /nologo /MDd /W3 /Gm /vmg /GR /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /Fp"Debug/comdemo.pch" /Yu"stdafx.h" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c 
    "E:\vcstudy\comdemo\comdemo.cpp"
    ]
    Creating command line "cl.exe @C:\DOCUME~1\malerong\LOCALS~1\Temp\RSP2D.tmp" 
    Creating temporary file "C:\DOCUME~1\malerong\LOCALS~1\Temp\RSP2E.tmp" with contents
    [
    /nologo /MDd /W3 /Gm /vmg /GR /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /Fp"Debug/comdemo.pch" /Yc"stdafx.h" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c 
    "E:\vcstudy\comdemo\StdAfx.cpp"
    ]
    Creating command line "cl.exe @C:\DOCUME~1\malerong\LOCALS~1\Temp\RSP2E.tmp" 
    Creating command line "link.exe /nologo /subsystem:windows /dll /incremental:yes /pdb:"Debug/comdemo.pdb" /debug /machine:I386 /def:".\comdemo.def" /out:"Debug/comdemo.dll" /implib:"Debug/comdemo.lib" /pdbtype:sept  .\Debug\comdemo.obj .\Debug\StdAfx.obj .\Debug\comdemo.res "
    Creating temporary file "C:\DOCUME~1\malerong\LOCALS~1\Temp\RSP2F.bat" with contents
    [
    @echo off
    regsvr32 /s /c ".\Debug\comdemo.dll"
    echo regsvr32 exec. time > ".\Debug\regsvr32.trg"
    ]
    Creating command line "C:\DOCUME~1\malerong\LOCALS~1\Temp\RSP2F.bat"
    Creating Type Library...
    Processing E:\vcstudy\comdemo\comdemo.idl
    comdemo.idl
    Command line error D2027 : cannot execute 'c1'
    midl : command line error MIDL1003 : error returned by the C preprocessor (2)
    Error executing midl.exe.
    Output WindowResults
    comdemo.dll - 2 error(s), 0 warning(s)
    上面是我的project configuation file and idl file.
    I only use the Appwizard generate the DLL frame and I add no code.
    In fact cl.exe have been good because I can finish the MFC application .Thank you for enjoying this problem.I will give you higer score.
      

  3.   

    idl 没有任何问题MIDL1003: error returned by the C preprocessor 
    The preprocessor returned an error. The error message is directed to the output stream. 某些设置