 |
Club Builder Foro de C++Builder en español
|
| Ver tema anterior :: Ver tema siguiente |
| Autor |
Mensaje |
ikis Master


Registrado: 28 Dic 2002Mensajes: 703Ubicación: Madrid, España
|
Publicado: Mie 11 Ago, 2004 4:23 pm Asunto: Error de linkeado .dll VC++ - Resuelto |
|
|
Hola, tengo el siguiente problema:
Necesito utilizar una DLL hecha en VC++. Para esto me dan los archivos SFA.H, SFA.lib y SFA.dll
Primero añado al proyecto el .lib y el .h y luego intento usarlos estática o dinámicamente pero nada, siempre me da error de unresolved external en las funciones que intento utilizar. Previamente utilicé la utilidad coff2omf para convertir el .lib.
Ya leí todos los mensajes pero sigo sin dar en la tecla.
¿alguna ayuda?
| Código: |
// File: SFA.h
#ifndef SFA_H_INCLUDED
#define SFA_H_INCLUDED
#ifdef SFA_EXPORTS
#define SFA_API __declspec(dllexport)
#else
#define SFA_API __declspec(dllimport)
#endif
#define SF_TEMPLATESIZE 384
#ifdef __cplusplus
extern "C" {
#endif
#define SF_SUCCESS 1
#define SF_VERIFYFAIL 0
#define SF_MATCHFAIL 0
#define SF_MATCHTIMEOUT 128
#define SF_NOTGOODIMAGE 2
#define SF_CORETOCENTER 4
#define SF_CORETOLEFT 8
#define SF_CORETORIGHT 16
#define SF_CORETOTOP 32
#define SF_CORETOBOTTOM 64
SFA_API int __stdcall SF_Initialize();
SFA_API void __stdcall SF_Uninitialize();
SFA_API int __stdcall SF_IsSensorOn();
SFA_API int __stdcall SF_IsFingerOn();
SFA_API int __stdcall SF_Capture();
SFA_API int __stdcall SF_GetImageWidth();
SFA_API int __stdcall SF_GetImageHeight();
SFA_API unsigned char* __stdcall SF_GetImageBuffer();
SFA_API void __stdcall SF_Clear();
#ifdef _WINDOWS
SFA_API void __stdcall SF_Draw( HWND hWnd, int l, int t, int r, int b, int bCore );
#endif
SFA_API int __stdcall SF_Enroll( unsigned char* Template, int* TemplateSize, int bCoreDetect );
SFA_API int __stdcall SF_EnrollWithVerify( unsigned char* Template, int* TemplateSize, int bCoreDetect );
SFA_API int __stdcall SF_Verify( unsigned char* Template, int SecurityLevel, int bCoreDetect );
SFA_API int __stdcall SF_Identify( unsigned char** Templates, int Count, int* Match, int SecurityLevel, int bCoreDetect, int Timeout );
SFA_API void __stdcall SF_RotateTemplate( unsigned char* Template );
#ifdef __cplusplus
}
#endif
#endif // SFA_H_INCLUDED
|
| Código: |
//Main.cpp
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "SFA.h"
#include "main.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
SF_Initialize();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
/*
typedef SFA_API* (__stdcall* PCrear)(char*);
HINSTANCE miDll = LoadLibrary("SFA.dll");
if (miDll)
{
PCrear fnCrear = (PCrear)GetProcAddress(miDll, "Crear");
if (fnCrear)
{
SF_Initialize();
SF_Uninitialize();
}
FreeLibrary(miDll);
}
*/
}
//---------------------------------------------------------------------------
|
atte _________________ Adrián
http://adrian.org.ar
Ultima edición por ikis el Mie 11 Ago, 2004 7:33 pm, editado 2 veces |
|
| Volver arriba |
|
 |
ikis Master


Registrado: 28 Dic 2002Mensajes: 703Ubicación: Madrid, España
|
|
| Volver arriba |
|
 |
Cesar C. Salazar Gonzalez Master


Registrado: 01 Oct 2002Mensajes: 2155Ubicación: San Cristóbal de Las Casas, Chiapas
|
Publicado: Mie 11 Ago, 2004 6:29 pm Asunto: |
|
|
Muy buena informacion... gracias, Ikis, deverias ponerla en tips & trucos, algunos estan por el mismo punto.. _________________
 |
|
| Volver arriba |
|
 |
ikis Master


Registrado: 28 Dic 2002Mensajes: 703Ubicación: Madrid, España
|
Publicado: Mie 11 Ago, 2004 7:33 pm Asunto: |
|
|
hecho  |
|
| Volver arriba |
|
 |
Alberto Lavariega Arista Lt JG

Registrado: 22 Oct 2004Mensajes: 66Ubicación: Bahias de Huatulco, Oaxaca
|
Publicado: Mie 17 Ago, 2005 1:05 am Asunto: problema con DLL!! |
|
|
Hola, tambien tengo un problema respecto al pasar una DLL hecha en Visual C++ 6.0, el caso es que utilizo el IMPLIB (destination lib name) (source dll) Como lo menciona Ikis y si lo hace pero me genera un .lib de 1 k, cuando la dll es de 665kb, la verdad no se me hace logico.
Bueno en su momento llegue a pensar que si estaba bien, pero al verificar el contenido del .lib generado con TLIB, verifico el archivo donde se supone me debe dar el nombre de las funciones que hay en la dll me dice lo siguiente:
| Código: | No public symbols exist. |
esto quiere decir que no me esta pasando la dll correctamente a .lib.
Que puedo hacer en estos casos?
A menos que utilice la dll tal cual, se puede hacer esto?, es decir incorporar la dll a mi proyecto y hacer el llamado de las clases y metodos que hay en ella.
Gracias de antemano por la ayuda!  _________________ Alberto Lavariega Arista |
|
| Volver arriba |
|
 |
|
|
No puedes publicar temas nuevos en este foro No puedes responder a temas en este foro No puedes editar tus mensajes en este foro No puedes borrar tus mensajes en este foro No puedes votar en las encuestas de este foro
|
© 2002–2026 Club Builder · Funciona con phpBB.
|