Posted: Sat Jul 23, 2005 6:43 pm
all i need to do is mpImportFileByFile, and fix up the manager
Code: Select all
function mpSetOption(FormatIndex: LongInt; OptionType: LongInt; Name: PChar; Value: PChar): LongBool; stdcall;
function mpIndexedInfo(FormatIndex: LongInt; ArchiveHandle: LongInt; Index: LongInt; Item: PChar): PChar; stdcall;
function mpFindInfo(FormatIndex: LongInt; Handle: LongInt; Field: PChar): PChar; stdcall;
Code: Select all
function mpOpenArchive(var ArchiveHandle: LongInt; FormatIndex: LongInt; ArchiveName: PChar; Flags: Cardinal): LongBool; stdcall;
function mpOpenArchiveBindStream(var ArchiveHandle: LongInt; FormatIndex: LongInt; Stream: IStream; Flags: Cardinal): LongBool; stdcall;
function mpFindFirstFile(FormatIndex: LongInt; ArchiveHandle: LongInt; FileMask: PChar): LongInt; stdcall;
function mpFindNextFile(FormatIndex: LongInt; FindHandle: LongInt): LongBool; stdcall;
function mpFindClose(FormatIndex: LongInt; FindHandle: LongInt): LongBool; stdcall;
Code: Select all
unit Common;
interface
type
TManagerPluginInfo = packed record
// Version 1.0
Size: LongInt;
PluginName: PChar;
PluginAuthor: PChar;
PluginURL: PChar;
PluginEmail: PChar;
PluginFullPath: PChar;
VersionMajor, VersionMinor: LongInt;
InterfaceMajor, InterfaceMinor: LongInt;
Supported: LongBool;
end;
TPluginInfo = packed record
// Version 1.0
Size: LongInt;
Name: PChar;
Author: PChar;
URL: PChar;
Email: PChar;
Major: LongInt;
Minor: LongInt;
end;
TFormatInfo = packed record
// Version 1.0
Size: LongInt;
FileMask: PChar; // This is better than an Interface
GameName: PChar; // This is the name of the game it supports
Flags: Int64; // Support flags
end;
const
SUPPORTFLAG_CREATE = $0000000000000001;
SUPPORTFLAG_IMPORT = $0000000000000002;
SUPPORTFLAG_EXPORT = $0000000000000004;
SUPPORTFLAG_DELETE = $0000000000000008;
SUPPORTFLAG_REPLACE = $0000000000000010;
SUPPORTFLAG_BYINDEX = $0000000000000020;
SUPPORTFLAG_BYNAME = $0000000000000040;
SUPPORTFLAG_HANDLEISTREAM = $0000000000000080;
SUPPORTFLAG_HANDLEFILE = $0000000000000100;
SUPPORTFLAG_TESTARCHIVE = $0000000000000200;
SUPPORTFLAG_EXPORTNAMEWILD= $0000000000000400;
SUPPORTFLAG_IMPORTNAMEWILD= $0000000000000800;
OPTIONTYPE_CREATE = $00000001;
OPTIONTYPE_EXPORT = $00000002;
OPTIONTYPE_IMPORT = $00000003;
OPTIONTYPE_FILEINFO = $00000004;
OPENFLAG_CREATENEW = $00000001;
OPENFLAG_OPENALWAYS = $00000002;
OPENFLAG_FOREXPORT = $00000004;
OPENFLAG_FORIMPORT = $00000008;
pERROR_OK = $00000000;
pERROR_INVALID_PARM_1 = $00000001;
pERROR_INVALID_PARM_2 = $00000002;
pERROR_INVALID_PARM_3 = $00000003;
pERROR_INVALID_PARM_4 = $00000004;
pERROR_INVALID_PARM_5 = $00000005;
pERROR_INVALID_PARM_6 = $00000006;
pERROR_INVALID_PARM_7 = $00000007;
pERROR_INVALID_PARM_8 = $00000008;
pERROR_INVALID_PARM_9 = $00000009;
pERROR_FILE_NOT_EXISTS = $0000000A;
pERROR_FILE_CANT_OPEN = $0000000B;
pERROR_INVALID_FORMAT = $0000000C;
pERROR_STREAM_READ = $0000000D;
pERROR_INVALID_HANDLE = $0000000E;
pERROR_INVALID_INDEX = $0000000F;
pERROR_CREATE_ERROR = $00000010;
pERROR_ARCHIVE_READ_ERROR = $00000011;
pERROR_NO_MATCHES = $00000012;
pERROR_ARCHIVE_CLOSED = $00000013;
pERROR_INVALID_OPTION = $00000014;
pERROR_WILDCARDS_NOT_ALLOWED = $00000015;
pERROR_INVALID_ARCHIVE = $00000016;
pERROR_FILE_EXISTS = $00000017;
pERROR_SPECIFICPLUGIN = $80000000;
InterfaceVersionMajor = 1;
InterfaceVersionMinor = 0;
implementation
end.
sureMr.Mouse wrote:Can you email me a complete, working test app Delphi source code that uses the manager functions? Along with all new .pas files (such as "common" etc).
So I can read them and implement the same stuff in MexCom? For instance, the testplugin is not detected by the manager. But I need to see how you have it in mind, and how each function is declared.
of course, remember that i change a WHOLE LOT OF STUFF with the new manager, when you made me write a plugin that tested about 99% of the functionality. So the BF plugin does need to be updatedMr.Mouse wrote:Edit: Also, after a firstfile find, then I should do a mpFindInfo to get know what the file is about eh? But, the "working" BF plugin doesn't return the mpGetOptions FILEFIND options, just an emtpy string. So I have no way to get the fields, are do you have default fields to give in mpFindInfo?
shouldn't perhaps you forgot to take out the CreateParams value?Mr.Mouse wrote:Edit2: OpenArchive crashes the whole IDE now. Perhaps due to the Cardinal there? Or the LongBool return? Please check your PM.