Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CryptoAPI problem. Help!

Status
Not open for further replies.

dex1123

Programmer
May 9, 2000
35
BG
Hello there!<br><br>I am using VC++6 and I am beginning to work on a project which uses Cryptography. The problem is that all the time I get 'undeclared identifier' for any type or function which I try to use (CryptoAPI). Isn't it enough that I have put the #include &quot;wincrypt.h&quot; in my program's header file. What could be the possible cause of this problem? Any kind of help would be greatly appreciated, I am pressed right now. Thanks a lot in advance.<br><br>Regards...Ivan
 
Dear Ivan,<br><br>Could you provide a sample 'undefined identifier'?<br><br>-pete
 
Let's say: I declare a variable of type HCRYPTPROV hProv; and I get an undeclared identifier 'HCRYPTPROV'. Any CryptoAPI function returns that result (CryptGenKey(), CryptAcquireContext())...
 
Dear Ivan,<br><br>The wincrypt.h file is guarded with the following statement:<br>#if(_WIN32_WINNT &gt;= 0x0400)<br><br>Here is the explanation of the use of that pre-processor logic from MSDN:<br><br>There are functions in Windows 95 OEM Service Release 2 that are guarded by (_WIN32_WINNT &gt;= 0x0400), such as the Crypto API. If you are writing an application specifically for Windows 95 OEM Service Release 2, and you want the header files to provide compile time access to these functions, it is necessary to define _WIN32_WINNT as 0x0400. Note that an application that uses these functions will not run correctly on the retail release of Windows 95. In general, applications expected to run on Windows 95 should be built without defining _WIN32_WINNT.<br><br>Hope this helps<br>-pete
 
I'm having a problem with wincrypt.h as well.
I know that one is supposed to install the Platform SDK.
I've done this and maybe that is the guys problem above. Unfortunately I've had it work where it solves the errors C2146 and error C2501 problems. I ghosted my Windows 2000 machine with the Platform SDK on it. Unfortunately the system is now having the problems again and I can't figure out what is causing the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top