api GetUserName无法正常工作 - 错误:错误的DLL调用约定 [英] api GetUserName not working properly - error: Bad DLL calling convention

查看:96
本文介绍了api GetUserName无法正常工作 - 错误:错误的DLL调用约定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用api来获取当前登录的Windows用户的用户名。我基本上复制并粘贴了返回用户名的功能


以下是我正在使用的代码:

展开 | 选择 | Wrap | 行号

解决方案

这是因为玛丽的 令人震惊 草率:-D


添加&到 cnt 引用实际变量 cnt&


相同的错误。这是我的第14行现在

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


我不确定Seth究竟出了什么问题,但是这里''尝试一些我认识的代码:

展开 | 选择 | Wrap | 行号

I''m attempting to use an api to get the username of the currently logged in Windows user. I''ve basically copied and pasted the function from Function to return Username

Here is the code that I''m using:

Expand|Select|Wrap|Line Numbers

解决方案

It''s because Mary''s shockingly sloppy :-D

Add the & to cnt to refer to the actual variable cnt&.


Same error. Here is my line 14 now

Expand|Select|Wrap|Line Numbers


I''m not sure exactly what the problems are Seth, but here''s some code to try that I know works for me :

Expand|Select|Wrap|Line Numbers


这篇关于api GetUserName无法正常工作 - 错误:错误的DLL调用约定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆