#include <QtCore/QCoreApplication>
#include <QLibrary>
#include <QUuid>
#include <iostream>
using namespace std;
#include "7z910/CPP/7zip/Archive/IArchive.h"
#include "7z910/CPP/7zip/IStream.h"
#include "MyCom.h"
// {23170F69-40C1-278A-1000-000110070000}
QUuid CLSID_CFormat7z
(0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x07, 0x00, 0x00
);
typedef int (*CreateObjectFunc)(
const GUID *clsID,
const GUID *interfaceID,
void **outObject);
void readFileInArchive()
{
CreateObjectFunc myFunction = (CreateObjectFunc)myLib.resolve("CreateObject");
if (myFunction == 0) {
cout << "CreateObject resolve failed!";
return;
}
else {
cout << "CreateObject resolved";
}
CMyComPtr<IOutArchive> outArchive;
myFunction(&CLSID_CFormat7z, &IID_IOutArchive, (void **)&outArchive);
}
int main(int argc, char *argv[])
{
readFileInArchive();
return a.exec();
}
#include <QtCore/QCoreApplication>
#include <QLibrary>
#include <QUuid>
#include <iostream>
using namespace std;
#include "7z910/CPP/7zip/Archive/IArchive.h"
#include "7z910/CPP/7zip/IStream.h"
#include "MyCom.h"
// {23170F69-40C1-278A-1000-000110070000}
QUuid CLSID_CFormat7z(0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x07, 0x00, 0x00);
typedef int (*CreateObjectFunc)(
const GUID *clsID,
const GUID *interfaceID,
void **outObject);
void readFileInArchive()
{
QLibrary myLib("7z.dll");
CreateObjectFunc myFunction = (CreateObjectFunc)myLib.resolve("CreateObject");
if (myFunction == 0) {
cout << "CreateObject resolve failed!";
return;
}
else {
cout << "CreateObject resolved";
}
CMyComPtr<IOutArchive> outArchive;
myFunction(&CLSID_CFormat7z, &IID_IOutArchive, (void **)&outArchive);
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
readFileInArchive();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks