Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to import a native (non COM ) DLL into VC++ (or VB through API)

Status
Not open for further replies.

Karl Blessing

Programmer
Feb 25, 2000
2,936
US
I have downloaded the 32bit DLL for UnACE (compression software), comes with extremely limited documentation ( only a Delphi example) and a comment &quot;I cant tell you how to link the file since there are so many programming platforms out there&quot;<br><br>the package includes<br>&nbsp;-Unace.h<br>&nbsp;-Unace.dll<br>&nbsp;-Unace.def<br><br>the header reads as:<br><br><FONT FACE=monospace><br>#define ACEERR_MEM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br>#define ACEERR_FILES&nbsp;&nbsp;&nbsp;&nbsp;2<br>#define ACEERR_FOUND&nbsp;&nbsp;&nbsp;&nbsp;3<br>#define ACEERR_FULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4<br>#define ACEERR_OPEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5<br>#define ACEERR_READ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6<br>#define ACEERR_WRITE&nbsp;&nbsp;&nbsp;&nbsp;7<br>#define ACEERR_CLINE&nbsp;&nbsp;&nbsp;&nbsp;8<br>#define ACEERR_CRC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9<br>#define ACEERR_OTHER&nbsp;&nbsp;&nbsp;10<br>#define ACEERR_EXISTS&nbsp;&nbsp;11<br>#define ACEERR_END&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;128<br>#define ACEERR_HANDLE&nbsp;&nbsp;&nbsp;129<br>#define ACEERR_CONSTANT 130<br>#define ACEERR_NOPASSW&nbsp;&nbsp;131<br>#define ACEERR_METHOD&nbsp;&nbsp;&nbsp;132<br>#define ACEERR_USER&nbsp;&nbsp;&nbsp;255<br><br>#define ACEOPEN_LIST&nbsp;&nbsp;&nbsp;&nbsp;0<br>#define ACEOPEN_EXTRACT 1<br><br>#define ACECMD_SKIP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br>#define ACECMD_TEST&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br>#define ACECMD_EXTRACT&nbsp;&nbsp;2<br><br>#define ACEVOL_REQUEST&nbsp;&nbsp;0<br>#define ACEVOL_OPENED&nbsp;&nbsp;&nbsp;1<br><br><br>#define ACESEL_YES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br>#define ACESEL_ALWAYS&nbsp;&nbsp;&nbsp;1<br>#define ACESEL_NO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2<br>#define ACESEL_CANCEL&nbsp;&nbsp;&nbsp;3<br><br>#define ACECMT_OK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br>#define ACECMT_SMALLBUF 1<br>#define ACECMT_NONE&nbsp;&nbsp;&nbsp;255<br><br>#pragma pack(1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// structures are byte-aligned!!<br><br>struct ACEHeaderData<br>{<br>&nbsp;&nbsp;char ArcName[260];<br>&nbsp;&nbsp;char FileName[260];<br>&nbsp;&nbsp;UINT Flags;<br>&nbsp;&nbsp;UINT PackSize;<br>&nbsp;&nbsp;UINT UnpSize;<br>&nbsp;&nbsp;UINT FileCRC;<br>&nbsp;&nbsp;UINT FileTime;<br>&nbsp;&nbsp;UINT Method;<br>&nbsp;&nbsp;UINT QUAL;<br>&nbsp;&nbsp;UINT FileAttr;<br>&nbsp;&nbsp;char *CmtBuf;<br>&nbsp;&nbsp;UINT CmtBufSize;<br>&nbsp;&nbsp;UINT CmtSize;<br>&nbsp;&nbsp;UINT CmtState;<br>};<br><br>struct ACEOpenArchiveData<br>{<br>&nbsp;&nbsp;char *ArcName;<br>&nbsp;&nbsp;UINT OpenMode;<br>&nbsp;&nbsp;UINT OpenResult;<br>&nbsp;&nbsp;UINT Flags;<br>&nbsp;&nbsp;UINT Host;<br>&nbsp;&nbsp;char AV[51];<br>&nbsp;&nbsp;char *CmtBuf;<br>&nbsp;&nbsp;UINT CmtBufSize;<br>&nbsp;&nbsp;UINT CmtSize;<br>&nbsp;&nbsp;UINT CmtState;<br>&nbsp;&nbsp;int PASCAL (*ChangeVolProc)(char *ArcName,int Mode);<br>&nbsp;&nbsp;int PASCAL (*ProcessDataProc)(unsigned char *Addr,int Size);<br>};<br><br>#pragma pack()<br><br>HANDLE __stdcall ACEOpenArchive(struct ACEOpenArchiveData *ArchiveData);<br>int __stdcall ACECloseArchive(HANDLE hArcData);<br>int __stdcall ACEReadHeader(HANDLE hArcData,struct ACEHeaderData *HeaderData);<br>int __stdcall ACEProcessFile(HANDLE hArcData,int Operation,char *DestPath);<br>int __stdcall ACESetPassword(HANDLE hArcData,char *Password);<br></font><br><br>I figure that if I at least know the contants, function names and parameters, this may help me figure out how to link the native dynamic link file, anyone have a Clue? (also if you know how to do so in VB would be helpful as well)<br><br><br> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(least i didnt start with COBOL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top