I had some decryption code (using wincrypt.h
) that lived within my FileReader.cpp
class. I am trying to segregate the code and push this decryption method into a MyCrypt.cpp
class. However, upon moving it I'm stuck with a bunch of errors that I wasn't facing before. For every wincrypt.h
or windows.h
specific command, I am recieving "identifier not found" or "undeclared identifier".
What gives!
More details..
Sample errors:
error C2065: 'HCRYPTPROV' : undeclared identifier
error C3861: 'CryptDecrypt': identifier not found
I am including windows.h and wincrypt.h, just as I was in FileReader.cpp.
#include "MyCrypt.h"
#include <windows.h>
#include <wincrypt.h>
MyCrypt.h is defined as:
#pragma once
class MyCrypt
{
public:
static char *DecryptMyFile(char *input, char *password, int size, int originalSize) ;
private:
static const DWORD KEY_LENGTH = 128;
}
If I rearrange my include files, I get the following errors instead:
error C2628: 'MyCrypt' followed by 'char' is illegal (did you forget a ';'?) error C2556: 'MyCrypt *MyCrypt::DecryptMyFile(char *,char *,int,int)' : overloaded function differs only by return type from 'char *MyCrypt::DecryptMyFile(char *,char *,int,int)
But nowhere in my code does it use this redefinition it speaks of..