ll[256] = "BCB Load VC_Win32 Dll by __stdcall mode is OK!";
return strRetStdcall;
}
extern "C" __declspec(dllexport) LPSTR __cdecl BCBLoadVCWin32Cdecl()
{
static char strRetCdecl[256] = "BCB Load VC_Win32 Dll by __cdecl mode is OK!";
return strRetCdecl;
}
extern "C" __declspec(dllexport) LPSTR __fastcall BCBLoadVCWin32Fastcall()
{
static char strRetFastcall[256] = "BCB Load VC_Win32 Dll by __fastcall mode is OK!";
return strRetFastcall;
}
??êμ?ˉì?μ÷ó?ó?μ÷ó? BCB ±àD′μ? DLL ??óD??±e£?1??üê?2é?′ DLL μ?μ?3?oˉêy??×??éò?ê1ó? tdump.exe(BCB1¤??) ?ò?? dumpbin.exe(VC1¤??) 2é?′
tdump -ee MyDll.dll >1.txt (2é?′ 1.txt ???t?′?é)
óéóú VC6 2??§3? __pascall ·?ê?£???????3?ò???èy??·?ê?μ?ày×ó
void __fastcall TForm1::btnBLVCWin32DynClick(TObject *Sender)
{
/*cmd: tdbump VCWin32.dll >1.txt
Turbo Dump??Version 5.0.16.4 Copyright (c) 1988, 1998 Borland International
Display of File VCWIN32.DLL
EXPORT ord:0000=''BCBLoadVCWin32Fastcall::''
EXPORT ord:0001=''BCBLoadVCWin32Cdecl''
EXPORT ord:0002=''_BCBLoadVCWin32Stdcall@0''
*/
if ( !DllInst )
DllInst = LoadLibrary ( "VCWin32.dll" );
if ( DllInst )
{
BCBLoadVCWin32Stdcall = (LPSTR (__stdcall *) () )
GetProcAddress ( DllInst, "_BCBLoadVCWin32Stdcall@0" ); //VC Dll
// GetProcAddress ( DllInst, "BCBLoadVCWin32Stdcall" ); //BCB Dll
if ( BCBLoadVCWin32Stdcall )
{
ShowMessage( BCBLoadVCWin32Stdcall() );
}
else ShowMessage ( "Can''t find the __stdcall Function!" );
BCBLoadVCWin32Cdecl = (LPSTR (__cdecl *) () )
GetProcAddress ( DllInst, "BCBLoadVCWin32Cdecl" );
if ( BCBLoadVCWin32Cdecl )
{
ShowMessage( BCBLoadVCWin32Cdecl() );
}
else ShowMessage ( "Can''t find the __cdecl Function!" );
//Why?2?ê? ''BCBLoadVCWin32Fastcall::'',??ê? ''@BCBLoadVCWin32Fastcall@0''£?
BCBLoadVCWin32Fastcall = (LPSTR (__fastcall *) () )
//GetProcAddress ( DllInst, "BCBLoadVCWin32Fastcall::" );
GetProcAddress ( DllInst, "@BCBLoadVCWin32Fastcall@0" );
if ( BCBLoadVCWin32Fastcall )
{
ShowMessage( BCBLoadVCWin32Fastcall() );
}
else ShowMessage ( "Can''t find the __fastcall Function!" );
}
else ShowMessage ( "Can''t find the Dll!" );
}
6. ?2ì?μ÷ó?ày×ó
?2ì?μ÷ó?óDμ??é·3£?′ó?ˉì?μ÷ó??D?éò??aμàμ?3?oˉêyμ???×?£?μ?ê??±?óê±(?óè? lib ???tμ?1¤3ì???t)
Linker ìáê?2??ü?òμ?oˉêyμ?êμ??
′ó 4 ?′3?£??éò??óè? def ???tá??ó
(?éò?í¨1y impdef MyDll.def MyDll.dll ??μ?μ?3?±í)
?¨á¢ó? DLL ???t??ò??ùμ? def ???tó? lib ???tò??e?óè?μ?1¤3ì???t
é???μ? DLL(VCWIN32.dll) μ? def ???t?a(VCWIN32.def)£o
LIBRARY???? VCWIN32.DLL
IMPORTS
@BCBLoadVCWin32Fastcall???? = VCWIN32.@BCBLoadVCWin32Fastcall@0
_BCBLoadVCWin32Cdecl????????= VCWIN32.BCBLoadVCWin32Cdecl
BCBLoadVCWin32Stdcall?????? = VCWIN32._BCBLoadVCWin32Stdcall@0
??ó|μ?oˉêyéù?÷oíêμ??è???£o
extern "C" __declspec(dllimport) LPSTR
|