Visual Basic.NET - Cómo pasar una imagen de una dll en c++ a un vb

 
Vista:

Cómo pasar una imagen de una dll en c++ a un vb

Publicado por Pablo Gomez (2 intervenciones) el 04/02/2008 17:09:24
Hola a todos

Es la 5ª vez que pongo una pregunta aquí...y todavía confío en que alguien me conteste.

Tengo una DLL hecha en c++ y hay una función a la que se le pasa n parámetro WinBitmap por referncia.

bool Cex2Dlg::UpdateCamera3(WinBitmap* &imagen)

Tengo un .def para exportar la DLL:
LIBRARY "ex2Dlg"

EXPORTS
UpdateCamera3

Luego tengo un proyecto para cargar las DLL y poder usarlas en VB:

<DllImport("ex2.dll", EntryPoint:="UpdateCamera3", SetLastError:=True, _
CharSet:=CharSet.Unicode, ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function UpdateCamera3(ByRef imagen As Winbitmap) As Boolean
End Function

Ahora, mi problema viene al llamar esta función desde un proyecto WindowsForm en VB.
Porque al llamar a la función en VB le paso una imagen de tipo Bitmap, por lo que al ejecutarse la DLL, debe esperar una imagen de tipo WinBitmap y no Bitmap (que es la que te ofrece VB).

Mi problema es ese, cómo co*o paso la imagen de la DLL al proyecto VB.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Cómo pasar una imagen de una dll en c++ a un vb

Publicado por Pablo gomezº (2 intervenciones) el 06/02/2008 13:15:22
Sorry but I was wrong with the details of my error.

The problem, specifically, is that when I make a VB project to import my function DLL, I don´t know how can I recieve a WinBitmap in the function, because is a C++ Variable and in VB I don´t have this variable.
So in c++ I have a WinBitmap variable and in VB I have a Bitmap variable, so I don´t know how can I pass this parameter through the function!!

I have also a VB project to load the functions of the DLL in order to use them in VB:
<DllImport("ex2.dll", EntryPoint:="UpdateCamera3", SetLastError:=True, _
CharSet:=CharSet.Unicode, ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function UpdateCamera3(ByRef imagen As Bitmap) As Boolean
End Function

Here, I would have to "catch" the 'imagen' as a WinBitmap but in VB only exists the variable "Bitmap".

Any Idea?????
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar