Allow void* user data in C API

This commit is contained in:
Caelan Sayler
2024-11-08 21:18:41 +00:00
committed by Caelan
parent bb3758a851
commit 65df8e1013
4 changed files with 30 additions and 24 deletions

View File

@@ -38,7 +38,7 @@ INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
std::wstring Utf8ToWString(std::string const& str);
std::string WStringToUtf8(std::wstring const& wstr);
void handle_vpkc_log(const char* pszLevel, const char* pszMessage)
void handle_vpkc_log(void* pUserData, const char* pszLevel, const char* pszMessage)
{
std::cout << pszLevel << ": " << pszMessage << std::endl;
}
@@ -57,7 +57,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
// Initialize Velopack log capture
std::cout << "Velopack C++ Sample App" << std::endl;
vpkc_set_log(handle_vpkc_log);
vpkc_set_logger(handle_vpkc_log);
// This should run as early as possible in the main method.
// Velopack may exit / restart the app at this point.