Click here to Skip to main content
15,925,309 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDefault CSP and GetLastError() (Encryption Problems) Pin
esapp42022-Aug-02 6:11
esapp42022-Aug-02 6:11 
Hello,
I posted on this yesterday, but I am still having trouble.
I am using this code:
<br />
// Get handle to the default provider. <br />
if(!CryptAcquireContext(&hCryptProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, 0))<br />
{<br />
     HandleError("Error during CryptAcquireContext.");<br />
     return -4;<br />
}

to aquire a handle to the Default CSP. Handle error goes like this:
<br />
void CFPCommonFunctions::HandleError(CString strFunction) <br />
{ <br />
     CString strMsg;<br />
     strMsg.Format("CFPCommonFunctions::EncryptTransFile() - %s: %u.", strFunction, GetLastError());<br />
     AfxMessageBox(strMsg, MB_OK | MB_ICONEXCLAMATION);<br />
}

which returns the error 80090019 (I dont think this is formatted correctly by my function because I cant find this error in the Windows list)

I have no problems on my Win2000 machine, nor do I have a problem on my Win98 machine that has VS6 installed.

My beta users are getting this error every time, and when I try it on a fresh Win95 OSR2 install I get the error as well.

MSDN says this is compatible with Win95 OSR2 and later.

Can anybody see where I am going wrong???

Thanks
GeneralRe: Default CSP and GetLastError() (Encryption Problems) Pin
Martin Ziacek22-Aug-02 6:35
Martin Ziacek22-Aug-02 6:35 
GeneralRe: Default CSP and GetLastError() (Encryption Problems) Pin
Martin Ziacek22-Aug-02 7:05
Martin Ziacek22-Aug-02 7:05 
GeneralRe: Default CSP and GetLastError() (Encryption Problems) Pin
esapp42022-Aug-02 7:34
esapp42022-Aug-02 7:34 
GeneralRe: Default CSP and GetLastError() (Encryption Problems) Pin
esapp42022-Aug-02 9:02
esapp42022-Aug-02 9:02 
GeneralRe: Default CSP and GetLastError() (Encryption Problems) Pin
esapp42022-Aug-02 9:28
esapp42022-Aug-02 9:28 
GeneralRe: Default CSP and GetLastError() (Encryption Problems) Pin
Martin Ziacek22-Aug-02 19:07
Martin Ziacek22-Aug-02 19:07 
Generalswapping bytes Pin
Anonymous22-Aug-02 6:04
Anonymous22-Aug-02 6:04 
GeneralRe: swapping bytes Pin
Chris Losinger22-Aug-02 6:16
professionalChris Losinger22-Aug-02 6:16 
GeneralRe: swapping bytes Pin
Anonymous22-Aug-02 7:29
Anonymous22-Aug-02 7:29 
GeneralMessages Between CFormViews Pin
John Gilbert22-Aug-02 5:57
John Gilbert22-Aug-02 5:57 
GeneralRe: Messages Between CFormViews Pin
Tomasz Sowinski22-Aug-02 7:32
Tomasz Sowinski22-Aug-02 7:32 
GeneralRe: Messages Between CFormViews Pin
John Gilbert22-Aug-02 7:52
John Gilbert22-Aug-02 7:52 
Generalmkdir Pin
pnpfriend22-Aug-02 5:52
pnpfriend22-Aug-02 5:52 
GeneralRe: mkdir Pin
Mustafa Demirhan22-Aug-02 10:52
Mustafa Demirhan22-Aug-02 10:52 
GeneralRe: mkdir Pin
Todd Smith22-Aug-02 17:30
Todd Smith22-Aug-02 17:30 
Generalsecond CStatusBar Pin
22-Aug-02 5:35
suss22-Aug-02 5:35 
GeneralRe: second CStatusBar Pin
Enis22-Aug-02 6:30
Enis22-Aug-02 6:30 
GeneralMAPI Delivery receipt Pin
Enis22-Aug-02 4:36
Enis22-Aug-02 4:36 
QuestionON_COMMAND macro in imported files?!!? Pin
Jawache22-Aug-02 4:15
Jawache22-Aug-02 4:15 
AnswerRe: ON_COMMAND macro in imported files?!!? Pin
Jon Hulatt22-Aug-02 4:20
Jon Hulatt22-Aug-02 4:20 
GeneralRe: ON_COMMAND macro in imported files?!!? Pin
Jawache22-Aug-02 5:48
Jawache22-Aug-02 5:48 
Generalsystem title bar menu X, add code to Pin
jimNLX22-Aug-02 3:58
jimNLX22-Aug-02 3:58 
GeneralRe: system title bar menu X, add code to Pin
Jon Hulatt22-Aug-02 4:06
Jon Hulatt22-Aug-02 4:06 
GeneralRe: system title bar menu X, add code to Pin
jimNLX22-Aug-02 4:09
jimNLX22-Aug-02 4:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.