c# - 如何修复“无法在 DLL 'y' 中找到名为 'x' 的入口点”
问题描述
我花了至少 3 个小时试图弄清楚为什么这不起作用。一些背景是,我正在尝试通过为名为 Assault Cube 的游戏编写一些技巧来提高我在 c# 和 c++ 中的编码技能。我正在尝试从我的 c++ dll 调用 c# 中的函数。
我的 C# 代码:
[DllImport("CortexAPI.dll")]
static extern void gameCheck();
我的 C++ 代码:
class cortexFunctions{
__declspec(dllexport) static void gameCheck()
{
/*finds ac window*/
string AC = "ac_client.exe";
std::wstring convertac = std::wstring(AC.begin(), AC.end());/*plz find out how to do this without converting :)*/
LPCWSTR assaultcube = convertac.c_str();
HWND assaultclient = FindWindow(0, assaultcube);
/*end of finding ac client*/
/*If assault cube is open, then outputs that the exploit is working fine*/
if (assaultclient == 0) {
MessageBox(NULL, TEXT("Assault Cube is not open."), TEXT("Open Assault Cube"), 0);
}
else {
MessageBox(NULL, TEXT("Cortex is working fine!"), TEXT("Good!"), 0);
}
}
};
请我尝试了很多不同的解决方案,但它们总是不起作用或导致另一个问题。
解决方案
推荐阅读
- python-3.x - AWS CDK - 访问新功能
- pdflib - PDFlib - 在左上角而不是左下角使用“textflow”放置换行文本
- sql - 打开 262 列的 DBF 文件,从 256 列增加,返回“...file.dbf is not a table”
- javascript - 如何在平板设备上获取经度和纬度?JS 地图框
- xml - 将带有嵌套节点的 xml 导入 Access(并且需要使用 xsl 将 xml 转换为“平面”结构)
- c# - 基于sqlite本地数据库的单个属性绑定
- key - 如何排除 Parse-Server REST API 上的默认键
- angular - 角度路线:子路线已加载但未渲染
- r - 将 dplyr group_by/summarize/spread 变成一个函数
- python - 克罗内克乘法仅适用于特定轴