¿ìËÙÒµÎñͨµÀ

BCB±àдDLLÖÕ¼«ÊÖ²á

×÷Õß ØýÃû¼¼Êõ À´Ô´ ³ÌÐòÉè¼Æ ä¯ÀÀ ·¢²¼Ê±¼ä 2012-06-30
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

ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!

·ÖÏíµ½£º ¸ü¶à
Äã¿ÉÄܶÔÏÂÃæµÄÎÄÕ¸ÐÐËȤ
    HTTP/1.1 401 Access Denied ÐË®¾§Æ»¹û

Copyright ©1999-2011 ÏÃÃÅÁèÖڿƼ¼ÓÐÏÞ¹«Ë¾ ÏÃÃÅÓÅͨ»¥Áª¿Æ¼¼¿ª·¢ÓÐÏÞ¹«Ë¾ All rights reserved

µØÖ·(ADD)£ºÏÃÃÅÈí¼þÔ°¶þÆÚÍûº£Â·63ºÅ701E£¨¶«ÄÏÈÚͨÅÔ£© Óʱà(ZIP)£º361008

µç»°£º0592-5908028 ´«Õ棺0592-5908039 ×ÉѯÐÅÏ䣺web@lingzhong.cn ×ÉѯOICQ£º173723134

¡¶ÖлªÈËÃñ¹²ºÍ¹úÔöÖµµçÐÅÒµÎñ¾­ÓªÐí¿ÉÖ¤¡·ÃöB2-20100024  ICP±¸°¸:ÃöICP±¸05037997ºÅ