visual c ++中的字节数组参数

时间:2013-02-11 16:54:29

标签: windows-phone-8 c++-cx visual-c++-2012

我是visual c ++的新手。我在.h文件中有一个像这样的方法:

  public:
   void DoSomething();

这里我需要传递字节数组作为参数,我需要在.cpp文件中实现它。我正在为Windows Phone 8工作,我需要包含windows phone运行时组件的visual c ++项目。我需要在c#类中使用此方法并从那里传递字节数组。但我不知道如何在c ++中声明一个字节数组方法。任何人都可以帮我找到解决方案。

2 个答案:

答案 0 :(得分:3)

在C ++ / CX中,您使用的是运行时组件,签名看起来像这样(假设您有ref class):

void DoSomething(const Platform::Array<uint8>^ something);

这可以通过传入byte[]直接从C#调用。

答案 1 :(得分:0)

public:
   void DoSomething(Byte *);

或者

public:
   void DoSomething(unsigned char *);

例如。