tincho 01-11-2020, 16:55
Hola a todos.
Me dieron un indicio en la lista internacional de gambas sobre el uso de una librería C en gambas ahora estoy intentando traducir un struct.
https://git.savannah.gnu.org/cgit/libred...wg.h#n8846
Si alguien puede decirme como se hace esto u orientarme un poco me seria de ayuda.
Saludos.
tincho 01-11-2020, 04:08
Hola a todos.

Si se tiene una función en un archivo.h de este tipo:
Código:
EXPORT int dwg_read_file (const char *restrict filename, Dwg_Data *restrict dwg);
Es correcto hacer esto en gambas?
Código:
Private Extern dwg_read_file(filename As String, Dwg_Data As Pointer) As Integer

Seria esto?
nombre_de_la_funcion(nombre_del_archivo As String, salida_de_los_datos As Pointer) As Integer

Saludos.
tincho 01-11-2020, 04:04
Hola a todos.
Hice una prueba muy rudimentaria con Extern pero no ha funcionado, dejo el código aquí por si alguien tiene ganas de resolverlo.
Código:
Library "/usr/local/lib/libredwg:0.0.11"

'EXPORT int dwg_read_file (const char *restrict filename, Dwg_Data *restrict dwg);
Private Extern dwg_read_file(filename As String, Dwg_Data As Pointer) As Integer

'EXPORT int dxf_read_file (const char *restrict filename, Dwg_Data *restrict dwg);
Private Extern dxf_read_file(filename As String, Dwg_Data As Pointer) As Integer

'EXPORT unsigned int dwg_get_layer_count (const Dwg_Data *restrict dwg);
Private Extern dwg_get_layer_count(Dwg_Data As Pointer) As Integer

Public Function info(f As String) As Pointer
  Dim info As Pointer
  Dim i As Integer
  Dim q As Integer
  i = dwg_read_file(f, info)
  q = dwg_get_layer_count(info)
  Return q
End

El archivo dwg.h se puede consultar aquí
https://git.savannah.gnu.org/cgit/libred...lude/dwg.h
Saludos.
Páginas (569):    1 516 517 518 519 520 569   
Bienvenido, Invitado
Tienes que registrarte para poder participar en nuestro foro.
Recordarme?
Miembros: 299
Último miembro: auroratomas
Temas del foro: 1,755
Mensajes del foro: 9,122
Últimos temas
El ratón no hace click do...
Foro: Instalación
Último mensaje por: guizans, 30-01-2026, 20:41
Respuestas: 2 - Vistas: 98
Parámetro de clase y pará...
Foro: General
Último mensaje por: guizans, 30-01-2026, 20:40
Respuestas: 8 - Vistas: 233
Gmao-Factory: Aplicación ...
Foro: Python
Último mensaje por: jguardon, 25-01-2026, 15:53
Respuestas: 5 - Vistas: 198
SqetchDB, un proyecto re-...
Foro: General
Último mensaje por: guizans, 21-01-2026, 19:57
Respuestas: 8 - Vistas: 380
Soporte para pasar Arrays...
Foro: Bases de Datos
Último mensaje por: Shordi, 19-01-2026, 19:14
Respuestas: 3 - Vistas: 262
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.