Redian新闻
>
Re: a question about C++.net class libra
avatar
Re: a question about C++.net class libra# DotNet - 窗口里的风景
L*r
1
Google就是好用。呵呵,以后见面就说:同学,今天你google没有? :)
注:我自己没有这么做过,我的系统只要集成原来的COM系统.
http://www.aspx.cn/comm/dotnetbbs/Showtopic.aspx?Forum_ID=6&Id=5284
指针类型参数传递:
在Windows API函数调用时,大部分函数采用指针传递参数,对一个结构变量指针,我
们除了使用上面的类和结构方法传递参数之外,我们有时还可以采用数组传递参数。
下面这个函数通过调用GetUserName获得用户名
BOOL GetUserName(
LPTSTR lpBuffer, // 用户名缓冲区
LPDWORD nSize // 存放缓冲区大小的地址指针
);

[DllImport("Advapi32.dll",
EntryPoint="GetComputerName",
ExactSpelling=false,
SetLastError=true)]
static extern bool GetComputerName (
[MarshalAs(Unmana
avatar
w*w
2
i appriciate your suggestion, but they look differently. my problem is how to
use pointer when namespace already exists, the link you provided is talking
about to import a DLL and wrap the pointer. But it could be helpful, i will
try more tomorrow.

【在 L*******r 的大作中提到】
: Google就是好用。呵呵,以后见面就说:同学,今天你google没有? :)
: 注:我自己没有这么做过,我的系统只要集成原来的COM系统.
: http://www.aspx.cn/comm/dotnetbbs/Showtopic.aspx?Forum_ID=6&Id=5284
: 指针类型参数传递:
: 在Windows API函数调用时,大部分函数采用指针传递参数,对一个结构变量指针,我
: 们除了使用上面的类和结构方法传递参数之外,我们有时还可以采用数组传递参数。
: 下面这个函数通过调用GetUserName获得用户名
: BOOL GetUserName(
: LPTSTR lpBuffer, // 用户名缓冲区
: LPDWORD nSize // 存放缓冲区大小的地址指针

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。