我在http://support.microsoft.com/kb/889763下载了一个例子程序.
在我的电脑上编译运行.会出现如下错误:
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Error!Program: ...ents and Settings\J\Desktop\Installer\SetupDr\Debug\setup.exe
Module: 
File: i386\chkesp.c
Line: 42The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. (Press Retry to debug the application)
---------------------------
Abort   Retry   Ignore   
---------------------------
请问这是为什么?我跟踪过程序,这个错误是出现在pInstallSelectedDriver()调用之后(即他的工作完成,要反回时)环境:
Win XP
VC 6.0
DDK 2000 编译的程序在别的电脑上也会出错这个错,(只装了XP的系统)

解决方案 »

  1.   

    你使用的2000ddk为xp编程序,当然会出错,原因是2000和xp系统的函数名相同,但声明不同.
    换xp ddk
      

  2.   

    不会吧……
    MS上有写明
    这篇文章中的信息适用于:
    • Microsoft Win32 Device Driver Kit for Windows 2000 
    • Microsoft Windows XP Driver Development Kit 
    • Microsoft Windows Server 2003 Driver Development Kit 
      

  3.   

    指的是你的开发包,不是源代码.
    使用XPDDK重新编译你的源代码.
      

  4.   

    对呀,我已经重新下载了XP DDK,并把2K DDK踢掉了.....