Tengo un problema con una DLL, parece ser que no reconoce las funciones de la DLL, la DLL la carga sin problemas, y asigna el puntero a las funciones de la DLL correctamente(!=NULL), pero cuando llamo a la función de la DLL no la reconoce"[C++ Error] Unit1.cpp(59): E2314 Call of nonfunction."
La Libreria era originalmente de VC.
Como tenia un Punto LIB para VC++
Mediante el IMPLIB.EXE he generado el .LIB para BCB a partir de la DLL.
He añadido la libreria (Add unit)
y la linea USELIB
El código final es el siguiente:
//-------------------------------------------#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "DLLFunc.h"
#include "winbase.h"
#pragma package(smart_init)
#pragma resource "*.dfm"
//-------------------------------------------// library loading
USELIB ("IK220DLL.lib");
// global Variables
HINSTANCE pDLL;
char szDllName[12];
ULONG *pBuffer16;
USHORT Axis;
bool ok;
static ULONG *PalpadorFind = NULL;
TForm1 *Form1;
//-------------------------------------------__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
// Get a pointer to the DLL
strcpy(szDllName,"IK220DLL.dll");
if( (pDLL=LoadLibrary(szDllName))==NULL )
Application->MessageBox("Error loading DLL ","Error",MB_ICONERROR);
// Get pointers to the DLL functions
if( (PalpadorFind = (ULONG*)GetProcAddress(pDLL,"IK220Find"))==NULL )
Application->MessageBox("Error loading DLL function... ","Error",MB_ICONERROR);
/* if(!((PalpadorFind = (ULONG*)GetProcAddress(pDLL,"IK220Find"))!=NULL&&
}
//-------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
// if(!PalpadorFind(pBuffer16))
Application->MessageBox("Error reading the axis address","IK220 Error",MB_ICONERROR);
}