[Mono-dev] PROBLEMS CALLING STRUCTURES UNMANAGED TO MANAGED AS PARAMETER USING MONO.

Jose Castillo Reyes josecastilloreyes at gmail.com
Fri Apr 11 20:01:57 EDT 2008


 I have the following code c++:

#include <stdlib.h>
#include <stdio.h>
extern "C" {
#include "lib.h"
}

int iHandle;

struct Request
{
    char *CategoryID;
    char *Product_Code;
    char *Build_Code;
    char *Manufacturer_id;
    unsigned int Serial_Number;
    char *Software_Version;
};

int main(void)
{
    Request ID_Device;
    int Resultado;

    Resultado = Manufacture(piHandle_coin, &ID_Device);
 //*****************problems in &ID_DEVICE STRUCTURES UNMANAGED TO MANAGED
AS PARAMETER

    printf("Id Categoria : %s\n",ID_Device.CategoryID);
    printf("Id Product: %s\n",ID_Device.Product_Code);
    printf("Id Build: %s\n",ID_Device.Build_Code);
    printf("Manufacturer: %s\n",ID_Device.Manufacturer_id);
    printf("Serial Number: %u\n",ID_Device.Serial_Number);
    printf("Software Revision: %s\n\n",ID_Device.Software_Version);

return 0;

}

 Note:
====
ID_Device is a structure as parameter at  Manufacture.

 HOW WOULD BE THE CONVERSION IN MONO USANDO PINVOKE? I have problems in the
structure.

THANKS!!

Jopse
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080411/fba2e091/attachment.html 


More information about the Mono-devel-list mailing list