VCDelphi֮䶯̬ӿ⻥2008-01-05 21:22תءVCDelphi֮䶯̬ӿ⻥ 

Delphi VCDLL


VCDLLʽ 

Extern C void __declspec(dllexport) __stdcall ShowMess(HWND hwnd, char* mess);

ʽΪ_ShowMess@88Ϊֽ

Ϊ˱Ʒѣɲ·

1.в__stdcallVCĬϸʽ__cdeclDelphiҪעøʽΪcdecl

2.VCdefļ磺

LIBRARY

EXPORTS

ShowMess @1

DLLƲѡ


Delphiеøʽ 

Procedure ShowMess (h:HWND; mess:PChar); Stdcall;{Cdecl;} external LibName;

StdcallCdeclDelphiĬRegister(FastCall)øʽ


עDelphiVCĶʽͬVCжṹʱҪ¸ʽ 

#pragma pack(4)

//ṹ

#pragma pack()


ùߣ 

TDump.exeDelphi 4  C Builder 3 ṩ

Impdef.exe  Implib.exe  C Builder 3ṩ

DumpBin.exeVC5.0ṩ

Lib.exeVC5.0ṩ


VCDelphiDLL



Delphiеʽ 

Function ShowDialog( hMainWnd:THandle; Msg:PChar ):integer; stdcall;

DllļʱƲѡ


VCеĵøʽ 

extern "C" __declspec(dllimport) int __stdcall ShowDialog( HWND hwnd,char* Msg );

__stdcallҪLibļжӦƷѣ²Libļ

Impdef.exedefļʽΪImpdef defļ dllļ

ֹdefļShowDialogΪShowDialog@8

Lib.exelibļʽΪLib /def:defļ

__stdcallĬϵøʽΪstdcallҪƷѣļMkLib.batLibļ

@echo off

if %1.==. goto error

impdef %1.def %1.dll

lib /def:%1.def

goto end

:error

echo Usage: MkLib DllName

echo Note: Don't add extension ".dll" to parameter "DllName"

:end
 

