I have this function from a DLL file that I have, and I can't seem to get it to work:
VB.NET Code:
Declare Function mpq_MpqCompactArchive Lib "MpqLib.dll" Alias "C7" (ByVal hMPQ As Integer, Optional ByVal szListFile As String = Nothing, Optional ByVal CompactCB As Long = Nothing, Optional ByRef lpCallbackData As Long = Nothing) As Boolean
And this is the explanation for the function:
These are the flags for it:Compact/Flush function
BOOL WINAPI MpqCompactArchive(HANDLE hMPQ, const char * szListFile = NULL, COMPACTCB CompactCB = NULL, void * lpCallbackData = NULL);
MpqCompactArchive - Compact/Flush an archive
return TRUE if successfully compacting the archive, otherwise return FALSE
hMPQ : MPQ Handle
szListFile : Additional listfile for compacting
CompactCB : Compact callback function
lpCallBackData: lpData parameter of callback function
VB.NET Code:
'// Values for compact callback Public Const lib_CCB_CHECKING_FILES As Integer = &H1 '// Checking archive : (dwParam1 = current, dwParam2 = total) Public Const lib_CCB_COMPACTING_FILES As Integer = &H2 '// Compacting archive (dwParam1 = current, dwParam2 = total) Public Const lib_CCB_CLOSING_ARCHIVE As Integer = &H3 '// Closing archive : No params used
I want to be able to use lib_CBB_COMPACTING_FILES, but I need to enter some parameters for that... in the 'IpCallBackData' I think... How would I do that?
P.S. I'm not getting an error: it's just returning false...


Reply With Quote