[Mono-dev] HOW WOULD BE THE CONVERSION OF THIS CODE IN MONO USING PINVOKE? I have problems in the structure.

Jose Castillo Reyes josecastilloreyes at gmail.com
Wed Apr 16 18:18:10 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 STRUCTURE 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 USING PINVOKE ? I have problems in the
structure.

THANKS!!

Jose
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080416/2c49291b/attachment.html 


More information about the Mono-devel-list mailing list