我正在创建一个c#dll库来扫描进程内存。 我有静态方法:托管C++中的c#方法
int searchASCII(int pid, SByte[] text, int pos)
{
ReadProcessApi RApi = new ReadProcessApi(pid, pos);
return RApi.ASCIIScan(text);
}
,并希望把它在Visual C++托管使用。 如果我想在C++中调用像这样的方法,应该使用哪种类型的文本参数: searchASCII((int)pid, (char[])text, (int)position)
?
在当前情况下,我得到错误:
"cannot convert parameter from 'char [6]' to 'cli::array<Type,dimension> ^' "
退房[此帖](http://stackoverflow.com/questions/2179270/pass-c -string-to-c-and-pass -c-result-string-char-whatever-to-c) – 2011-03-03 21:03:20
那篇文章是错误的。 – 2011-03-03 21:17:18