TAGS :Viewed: 4 - Published at: a few seconds ago

[ C++ Builder [bcc32 Error] Unit1.cpp(18): E2040 Declaration terminated incorrectly ]

Trying to import the Crypt32.dll but its not working isn't this c++?

Am using RadStudio C++ Builder how can i import DLL like Crypt32.dll etc?

Someone show me the right way thank you.

[DllImport("Crypt32.dll", SetLastError=true, CharSet=System::Runtime::InteropServices::CharSet::Auto)]
static bool CryptData(DATA_BLOB %pDataIn, System::String ^szDataDescr, DATA_BLOB %pOptionalEntropy, IntPtr pvReserved, CRYPTPROTECT_PROMPTSTRUCT %pPromptStruct, int dwFlags, DATA_BLOB %pDataOut);

Answer 1


... isn't this c++?

System::String ^szDataDescr is using Microsofts c++-cli extension syntax for managed objects. So no, it's not standard c++ syntax.

Same for DATA_BLOB %pDataIn.

To cite from their documentation:

enter image description here