将包含数组的非托管结构转换为托管数据! [英] Conversion of unmanaged structure containing array to the managed one!

查看:111
本文介绍了将包含数组的非托管结构转换为托管数据!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各位大家好,


一直在想如何将以下

非托管代码转换为托管C ++:

struct JustAnExample

{

char value1 [100];

int value2 [120];

//等....

}


有很多例子说明如何应对未经处理的C ++到C#

转换,但我没有找到那些有吸引力和必要的编组因为管理的C ++类型可用于C#而导致
。所以,任何想法?


很多,

彼得

解决方案

一直在考虑如何将以下


非托管代码转换为托管C ++:


struct JustAnExample

{

char value1 [100];

int value2 [120];

//等....

}


有很多例子可以说明如何应对未经处理的C ++到C#

转换,但是由于C#的托管C ++类型可用,因此我找不到那些有吸引力且必要的编组资源。那么,任何想法?






无需转换结构。您可以在托管C ++(以及C ++ / CLI)中使用非托管结构

和类似的东西,并且它将会工作。

只是工作。
< br $> b $ b -

亲切的问候,

布鲁诺。
BR ********************** @ hotmail.com

仅删除_nos_pam




< pk ***** *@gmail.com在留言中写道

新闻:11 ********************** @ n76g2000hsh.googlegr oups.com ...


大家好,


一直想着如何实际转换以下内容

unmanaged托管C ++的代码:


struct JustAnExample

{

char value1 [100];

int value2 [120];

//等....

}


有很多例子如何应对未经过处理的C ++到C#

转换,但我找不到mar shaling有吸引力和必要

,因为托管C ++类型可用于C#。那么,任何想法?



inline_array此处提供:
http://blogs.msdn.com/branbray/archi...20/441099.aspx


>

很多,

彼得




有很多例子说明如何应对未经处理的C ++到C#

转换,但我不知道找到有吸引力和必要的编组工作由于C#的托管C ++类型可用,因此需要b $ b。那么,任何想法?


这里提供的
inline_array: http://blogs.msdn.com/branbray/archi...20/441099.aspx



嗨。


我收到错误C2988:无法识别模板声明/

定义在编译static_array模板时。什么是

重要?这似乎是由于部分专业化。怎么

你在MSVC 2005上编译了吗?


干杯,

彼得。


Hello everybody,

Been just thinking how actually one could convert the following
unmanaged code to the managed C++:

struct JustAnExample
{
char value1[100];
int value2[120];
// etc ....
}

There''re numerous examples how to cope with unamnaged C++ to C#
conversions, but I don''t find marshaling that attractive and necessary
since managed C++ types are available for C#. So, any idea?

Thx a lot,
Peter

解决方案

Been just thinking how actually one could convert the following

unmanaged code to the managed C++:

struct JustAnExample
{
char value1[100];
int value2[120];
// etc ....
}

There''re numerous examples how to cope with unamnaged C++ to C#
conversions, but I don''t find marshaling that attractive and necessary
since managed C++ types are available for C#. So, any idea?

Hi,

There is no need to convert the structure. You can use unmanaged structures
and classes like that in managed C++ (and C++/CLI for that matter) and it''ll
just work.

--
Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"



<pk******@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...

Hello everybody,

Been just thinking how actually one could convert the following
unmanaged code to the managed C++:

struct JustAnExample
{
char value1[100];
int value2[120];
// etc ....
}

There''re numerous examples how to cope with unamnaged C++ to C#
conversions, but I don''t find marshaling that attractive and necessary
since managed C++ types are available for C#. So, any idea?

inline_array presented here:
http://blogs.msdn.com/branbray/archi...20/441099.aspx

>
Thx a lot,
Peter



There''re numerous examples how to cope with unamnaged C++ to C#
conversions, but I don''t find marshaling that attractive and necessary
since managed C++ types are available for C#. So, any idea?


inline_array presented here:http://blogs.msdn.com/branbray/archi...20/441099.aspx

Hi.

I''m getting error "C2988: unrecognizable template declaration/
definition" while compiling that static_array template. What''s the
matter? It seems that this is due to the partial specializator. How
did u get it compiled then on MSVC 2005?

Cheers,
Peter.


这篇关于将包含数组的非托管结构转换为托管数据!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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