누구든지이 코드가 작동하지 않는 이유를 알고 있습니까?CryptStringToBinary는 NULL로 끝나는 문자열로 작동하지 않습니다. 왜?
#include "stdafx.h"
#include <windows.h>
#include <WinCrypt.h>
int _tmain(int argc, _TCHAR* argv[])
{
wchar_t *bin = TEXT("ProductID:1233===>55555");
BYTE out2[1000];
DWORD olen;
olen = 1000;
if (CryptStringToBinary(bin, 0, 1, out2, &olen, 0, 0) == 0)
{
wprintf(TEXT("Failure\n"));
}
else
{
//wprintf(TEXT("rn%s\n"),out2);
wprintf(TEXT("Success\n"));
}
system("pause");
return 0;
}
대단히 감사합니다.
톰
명확하게하기 위해 코드는 작동하지만 CryptBinaryToString은 항상 0을 반환합니다. –