W
wxf_wxf
Unregistered / Unconfirmed
GUEST, unregistred user!
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "uTestDll.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
typedefdo
uble(SQRT1)(double);
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
HINSTANCE hInstance;
SQRT1* pFunction;
hInstance=::LoadLibrary("PrjDll.dll");
pFunction=(SQRT1*)GetProcAddress(hInstance,"sqrt1");
if (pFunction==NULL) exit;
do
uble d=(*pFunction)(81.0);//调用该DLL函数
Label1:Caption=FloatToStr(d);
}
我所取的pFunction为何为NULL;我的PrjDll.dll和sqrt1都是对的
#include <vcl.h>
#pragma hdrstop
#include "uTestDll.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
typedefdo
uble(SQRT1)(double);
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
HINSTANCE hInstance;
SQRT1* pFunction;
hInstance=::LoadLibrary("PrjDll.dll");
pFunction=(SQRT1*)GetProcAddress(hInstance,"sqrt1");
if (pFunction==NULL) exit;
do
uble d=(*pFunction)(81.0);//调用该DLL函数
Label1:Caption=FloatToStr(d);
}
我所取的pFunction为何为NULL;我的PrjDll.dll和sqrt1都是对的