I'm using Curl in a project and my function is returning a error about CW2AEX..
const TCHAR* path;
const TCHAR* fileName;
TCHAR url[ MAX_PATH ] = { 0 };
_stprintf( url, _T( "%s%s" ), path, fileName );
char errorCode[ CURL_ERROR_SIZE ] = { 0 };
function( curl, CURLOPT_ERRORBUFFER, errorCode );
function( curl, CURLOPT_HEADER, 0 );
function( curl, CURLOPT_FOLLOWLOCATION, 1 );
function( curl, CURLOPT_NOPROGRESS, 0 );
function( curl, CURLOPT_WRITEDATA, isMemoryDownload ? ( void* )( &memoryFile ) : ( void* )( &diskFile ) );
function( curl, CURLOPT_WRITEFUNCTION, isMemoryDownload ? CNetwork::WriteToMemory : CNetwork::WriteToDisk );
function( curl, CURLOPT_PROGRESSDATA, 0 );
function( curl, CURLOPT_PROGRESSFUNCTION, CNetwork::Pursuit );
function( curl, CURLOPT_URL, CW2AEX< sizeof( url ) >( url ) );
My guess is that it should load the value explicitly in order to compile it. Not quiet sure?
The error message gives you a hint: for a variadic function argument you have to resolve the type ambiguity and cast the helper class to acceptable type:
function(curl, CURLOPT_URL, (LPCSTR) CW2AEX< sizeof( url ) >( url ) );
You can also make it simpler at minimal cost (using CStringA
):
function(curl, CURLOPT_URL, (LPCSTR) CStringA(url));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With