Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: mErrorCode=CLASS_E_CLASSNOTAVAILABLE ClassFactory cannot supply requested class #89

Closed
1 task done
jf3096 opened this issue Jun 15, 2022 · 5 comments
Closed
1 task done
Assignees

Comments

@jf3096
Copy link

jf3096 commented Jun 15, 2022

bit7z version

3.1.x

7-zip version

v21.07

7-zip DLL used

7za.dll

MSVC version

2017

Architecture

x86_64

Which version of Windows are you using?

Windows 10

Bug description

unable extract. error: {mErrorCode=CLASS_E_CLASSNOTAVAILABLE ClassFactory cannot supply requested class }

void extractVolumeExample()
{
	try
	{
		Bit7zLibrary lib{ L"C:/Users/admin/source/repos/bit7z-demo/libs/bit7z/lib/7za.dll" };
		BitExtractor extractor{ lib, BitFormat::Split };
		extractor.extract(L"D:/test/volumes/out/.001", L"D:/test/volumes/out/_");
		std::cout << "Done";
	}
	catch (const BitException& ex) {
		std::cout << "error";
		//do something with ex.what()...
	}
}

Steps to reproduce

No response

Expected behavior

No response

Relevant compilation output

No response

Code of Conduct

@jf3096 jf3096 changed the title [Bug]: [Bug]: mErrorCode=CLASS_E_CLASSNOTAVAILABLE ClassFactory cannot supply requested class Jun 15, 2022
@rikyoz
Copy link
Owner

rikyoz commented Jun 15, 2022

Hi!

7-zip DLL used

7za.dll

unable extract. error: {mErrorCode=CLASS_E_CLASSNOTAVAILABLE ClassFactory cannot supply requested class }

BitExtractor extractor{ lib, BitFormat::Split };

I think the problem is in the DLL you are using: the 7za.dll doesn't support the BitFormat::Split format; it supports only the 7z format (e.g., BitFormat::SevenZip).
For extracting split archives, you should use the 7z.dll, which supports all formats. You can find a table with the supported features of each 7-zip DLL here: https://github.com/rikyoz/bit7z/wiki/7z-DLLs.

@jf3096
Copy link
Author

jf3096 commented Jun 15, 2022

Thank you very much for quick reply. But I cannot find 7z.dll in https://www.7-zip.org/. Could you please guide me to a site where I can download 7z.dll?

@rikyoz
Copy link
Owner

rikyoz commented Jun 15, 2022

Thank you very much for quick reply. But I cannot find 7z.dll in https://www.7-zip.org/. Could you please guide me to a site where I can download 7z.dll?

One way I know to obtain the already compiled 7z.dll file is to download the usual 7-zip installer, and extract it:
image
Alternatively, if you already installed 7-zip, you might find the DLL in its installation folder under C:\Program Files\7-zip.

@jf3096
Copy link
Author

jf3096 commented Jun 15, 2022

thank you! it works

@jf3096 jf3096 closed this as completed Jun 15, 2022
@rikyoz
Copy link
Owner

rikyoz commented Jun 15, 2022

thank you! it works

You're welcome! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants