#include #include #include #include // DLL function declaration extern "C" __declspec(dllimport) void Execute(const wchar_t* src, const wchar_t* dst); // Set console to UTF-8 mode void SetConsoleUTF8() { _setmode(_fileno(stdout), _O_U8TEXT); _setmode(_fileno(stderr), _O_U8TEXT); SetConsoleOutputCP(CP_UTF8); } int wmain(int argc, wchar_t* argv[]) { // Initialize console encoding SetConsoleUTF8(); if (argc != 3) { std::wcerr << L"Usage: " << argv[0] << L" " << std::endl; return 1; } // Verify parameters std::wstring src(argv[1]); std::wstring dst(argv[2]); try { // Debug output std::wcout << L"Processing file:\nSource: " << src << L"\nDestination: " << dst << std::endl; // Call DLL function Execute(src.c_str(), dst.c_str()); std::wcout << L"Operation completed successfully!" << std::endl; return 0; } catch (const std::exception& e) { std::cerr << "Error: " << e.what() << std::endl; return 2; } catch (...) { std::cerr << "Unknown error occurred!" << std::endl; return 3; } }