我正在尝试使用c ++编写motorbee
当我运行代码时,我收到以下错误:
运行时检查失败#0 - ESP的值未在函数调用中正确保存.这通常是调用使用一个调用约定声明的函数和使用不同调用约定声明的函数指针的结果.
这是我的代码.
#include "stdafx.h"
#include <iostream>
#include "windows.h"
#include "mt.h"
using namespace std;
HINSTANCE BeeHandle= LoadLibrary("mtb.dll");
Type_InitMotoBee InitMotoBee;
Type_SetMotors SetMotors;
Type_Digital_IO Digital_IO;
void main ()
{
InitMotoBee = (Type_InitMotoBee)GetProcAddress( BeeHandle,"InitMotoBee");
SetMotors =(Type_SetMotors)GetProcAddress(BeeHandle,"SetMotors");
Digital_IO =(Type_Digital_IO)GetProcAddress(BeeHandle,"Digital_IO ");
InitMotoBee();
SetMotors(0, 50, 0, 0, 0, 0, 0, 0, 0);
}
Run Code Online (Sandbox Code Playgroud)