elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


  Mostrar Temas
Páginas: [1]
1  Programación / Programación C/C++ / char* char** y VB6 en: 29 Mayo 2018, 10:08 am
Hola, estoy con problema, hice una DLL (en Golang), que se compila en C, con los tipos de C, en la cual utilizo char* para enviar strings y char** para devolver strings, el problema es que no importa como lo declare en VB6 no logro poder usar estos métodos.

Las funciones se exportan con:
Código:
extern GoInt32 PrintHello(char* p0, char** p1);
extern GoInt32 PrintBye(char** p0);
extern GoInt32 LenString(char* p0);
Obviamente el tipo GoInt32 es propio de Golang, en VB6 lo puedo leer perfectamente como Long.

En teoría debería poder usar estos metodos en VB6 con la siguiente declaración:
Código:
Declare Function PrintHello Lib "testDLL.dll" (ByVal Nombre As String, ByRef Output As String) As Long
Declare Function PrintBye Lib "testDLL.dll" (ByRef Output As String) As Long
Declare Function LenString Lib "testDLL.dll" (ByVal Nombre As String) As Long

Pero no, no consigue otro mensaje que "Bad DLL calling convention". Hice otros métodos, que devuelven char* en lugar de GoInt32 (extern char* OutString();) y FUNCIONAN con VB6 como Strings (Declare Function OutString Lib "testDLL.dll" () As String), pero no como parámetro.

Gracias!!
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines