B
B
Billy Milligan2014-07-23 10:55:12
C++ / C#
Billy Milligan, 2014-07-23 10:55:12

How to initialize an object of class ICEnroll4?

Good day, I don't really understand cpp. VS2010 Gives an error
Нарушение прав доступа при чтении "0x00000000"
As I understand it, this is due to the fact that pEnroll is not initialized, I don’t know how to initialize it, in the MSDN examples it is written exactly the same as mine. In general, I'm trying to create a certificate request using the Crypto Pro crypto provider, if someone knows a solution in Java, poke me.

#include <Windows.h>
#include <iostream>
#include <tchar.h>
#include <string>
#include <Xenroll.h>
#include <OleAuto.h>
#include <objbase.h>
using namespace std;

LPWSTR ProviderName = L"Crypto-Pro GOST R 34.10-2001 Cryptographic Service Provider";
HRESULT hr;

int main() {
  ICEnroll4 * pEnroll = NULL;

  hr = pEnroll->put_ProviderName(ProviderName);
  hr = pEnroll->put_ProviderType(75);
  hr = pEnroll->createFilePKCS10(L"CN=Name,L=City,C=RU", L"", L"test.der");

  return 0;
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
EXL, 2014-07-23
@EXL

ICEnroll4 *pEnroll = new ICEnroll4;

A
Andrew, 2014-07-23
@OLS

Isn't this option right for you?
www.cryptopro.ru/forum2/default.aspx?g=posts&t=1721

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question