0

.h file

public ref class Lockscreen sealed
{
public:
    Lockscreen();
    _BADGE_INFORMATION GetLockscreenNotificationData();
};

.cpp file

_BADGE_INFORMATION Lockscreen::GetLockscreenNotificationData()
{

GetNotificationsSnapshot(&snapshot);
_BADGE_INFORMATION badgeInfo;
return badgeInfo;}

The above two are my header and cpp files. I have to return the struct _BADGE_INFORMATION back to my C# code from the cpp file. But while doing so am getting an error that says, "signature of public member contains native type _BADGE_INFORMATION", this data is very crucial to my app, and I have never ever worked on C++ before.I need to serialize this data and send it back to my C# code. Can someone tell me how. Or suggested any other means to get the data of the struct. Any help will be appreciated.

Apoorva
  • 1,047
  • 13
  • 33

1 Answers1

0

What really is _BADGE_INFORMATION? There are different ways to send data from unmanaged code to managed. You may serialize for example you data to xml or json in C++ code and deserialize in C# code. If you want pass you data as return type see this question: Passing struct from unmanaged C++ to C#, may be it will be usefull.

Community
  • 1
  • 1
Andrey
  • 160
  • 1
  • 9