Ver Mensaje Individual
  #1  
Antiguo 09-06-2010
REHome REHome is offline
Miembro
 
Registrado: jul 2003
Ubicación: España
Posts: 454
Reputación: 21
REHome Va por buen camino
Código a C++

Buenas:

Quiero pasar este pedazo de código de C# a C++ 2010. ¿Cómo es?

Código:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Runtime.InteropServices; // No olvidar aqui.

namespace Puerto_paralelo
{
    class PortInterop
    {
        [DllImport("inpout32.dll", EntryPoint = "Out32")]
        public static extern void Output(int adress, int value);
        [DllImport("inpout32.dll", EntryPoint = "Inp32")]
        public static extern int Input(int adress);
    }
}
He creado una clase como indica abajo.

http://r.i.elhacker.net/cache?url=ht...images/130.png

http://r.i.elhacker.net/cache?url=ht...images/131.png

http://r.i.elhacker.net/cache?url=ht...ges/132sys.png

A partir de aquí se me crearon el .h y el .cpp. Por aquí estoy perdido y no se como pasarlo de C# a C++ con Visual C++ 2010.

http://r.i.elhacker.net/cache?url=ht...images/133.png

http://r.i.elhacker.net/cache?url=ht...ges/134eoe.png

Saludo.
__________________
http://electronica-pic.blogspot.com....n-arduino.html Manuales de electrónica general, PIC y Arduino.
Responder Con Cita