我有一个 project.dll 和头文件。它是这样定义的:
#ifdef PPSDK_EXPORTS
#define PP_SDK_API __declspec(dllexport)
#else
#define PP_SDK_API __declspec(dllimport)
#endif
#ifndef __PP_SDK__
#define __PP_SDK__
typedef enum
{
PP_FALSE= 0x0,
PP_TRUE = 0x01
} pp_bool;
PP_SDK_API pp_bool SDK_Initialize(unsigned long*p_Status );
我在谷歌和这个网站上使用了一些帮助来在 C# 中使用这个 dll,但它没有成功。这是 pp_bool 类型的错误。这是我的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
[DllImport("project.dll")]
static extern pp_bool SDK_Initialize(unsigned long*p_Status );
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
...................................您能帮我处理一下吗?谢谢!