Click here to Skip to main content
15,029,736 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MDI multiple view types - Window List Pin
bob169727-Sep-07 14:21
Memberbob169727-Sep-07 14:21 
AnswerRe: MDI multiple view types - Window List Pin
Nelek12-Sep-07 0:08
protectorNelek12-Sep-07 0:08 
QuestionHow to prevent library/software cracking Pin
Hirakawa7-Sep-07 9:53
MemberHirakawa7-Sep-07 9:53 
AnswerRe: How to prevent library/software cracking Pin
David Crow7-Sep-07 10:16
MemberDavid Crow7-Sep-07 10:16 
GeneralRe: How to prevent library/software cracking Pin
Hirakawa7-Sep-07 21:08
MemberHirakawa7-Sep-07 21:08 
QuestionUsing a resource from an ATL COM MFC Component Pin
cmacgowan7-Sep-07 9:45
Membercmacgowan7-Sep-07 9:45 
AnswerRe: Using a resource from an ATL COM MFC Component Pin
cmacgowan7-Sep-07 11:45
Membercmacgowan7-Sep-07 11:45 
QuestionHow to find Certificate Trust List by "Identifier" Pin
Joseph.Lightfoot7-Sep-07 6:18
MemberJoseph.Lightfoot7-Sep-07 6:18 
I've been beating my head against the wall trying figure this one out. I am trying to find a CTL when all that I have is it's "identifier". If I create the CTL using makeCTL, I can specify an identifier by entering text in the "prefix that identifies this CTL" edit box.

I have tried using CertFindCTLInStore with a find type of CERT_FIND_SUBJECT_STR and CERT_FIND_KEY_IDENTIFIER. Neither attempt has worked. Can someone point me at an appropriate example? I've posted a snippet below to short circuit some of the "back and forth" Q&A.

	HANDLE          storeHandle = NULL;
	PCCTL_CONTEXT	pCTLContext = NULL;

	wstring textToFind;
	wstring storeName;

	if (argc != 3 )
	{
		//displayUsage();
		wcout << TEXT("argc = ")<< argc << endl;
		exit(-1);
	}

	storeName = argv[1];
	textToFind = argv[2];

	DWORD buffSize = 0;

	// Open a system certificate store.
	if (storeHandle = CertOpenSystemStore( NULL, storeName.c_str()))
	{
		 wcout << TEXT("The ") << storeName.c_str() << TEXT(" store has been opened. \n");
	} else {
		 wcout << TEXT("The store was not opened.\n");
		 exit(1);
	}

	//
	//
	//
	PCCTL_CONTEXT prevCTLContext = NULL;

	pCTLContext = CertFindCTLInStore( storeHandle, 
				X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 
				0, 
				CERT_FIND_SUBJECT_STR,
				//CERT_FIND_KEY_IDENTIFIER,
				textToFind.c_str(),
				prevCTLContext);
	// show some info

	if (pCTLContext != NULL)
	{
// I never get here.
	} else {
		wcout << TEXT("Unable to find cert with subject of '")<< textToFind.c_str() << TEXT("'") << endl;
	}
	//
	// finish up
	//
	if (!CertCloseStore(storeHandle, 0))
	{
		wcerr <<TEXT("Failed CertCloseStore\n");
		exit(1);
	}



Joseph Lightfoot
AnswerRe: How to find Certificate Trust List by "Identifier" Pin
led mike7-Sep-07 7:34
Memberled mike7-Sep-07 7:34 
GeneralRe: How to find Certificate Trust List by "Identifier" Pin
Joseph.Lightfoot7-Sep-07 9:18
MemberJoseph.Lightfoot7-Sep-07 9:18 
GeneralRe: How to find Certificate Trust List by "Identifier" Pin
led mike7-Sep-07 11:42
Memberled mike7-Sep-07 11:42 
QuestionType conversion! from BYTE[] to Point[] [modified] Pin
Md. Ali Naser Khan7-Sep-07 4:34
MemberMd. Ali Naser Khan7-Sep-07 4:34 
AnswerRe: Type conversion! from BYTE[] to Point[] Pin
led mike7-Sep-07 5:07
Memberled mike7-Sep-07 5:07 
JokeRe: Type conversion! from BYTE[] to Point[] Pin
David Crow7-Sep-07 5:14
MemberDavid Crow7-Sep-07 5:14 
GeneralRe: Type conversion! from BYTE[] to Point[] Pin
jhwurmbach7-Sep-07 6:27
Memberjhwurmbach7-Sep-07 6:27 
GeneralRe: Type conversion! from BYTE[] to Point[] Pin
Md. Ali Naser Khan7-Sep-07 5:14
MemberMd. Ali Naser Khan7-Sep-07 5:14 
GeneralRe: Type conversion! from BYTE[] to Point[] Pin
Mark Salsbery7-Sep-07 5:30
MemberMark Salsbery7-Sep-07 5:30 
GeneralRe: Type conversion! from BYTE[] to Point[] Pin
led mike7-Sep-07 5:41
Memberled mike7-Sep-07 5:41 
AnswerRe: Type conversion! from BYTE[] to Point[] Pin
John R. Shaw7-Sep-07 23:11
MemberJohn R. Shaw7-Sep-07 23:11 
AnswerRe: Type conversion! from BYTE[] to Point[] Pin
Mark Salsbery8-Sep-07 7:12
MemberMark Salsbery8-Sep-07 7:12 
QuestionIHTMLDocument2Ptr not found Pin
Bhavesh Bagadiya7-Sep-07 4:23
MemberBhavesh Bagadiya7-Sep-07 4:23 
QuestionRe: IHTMLDocument2Ptr not found Pin
David Crow7-Sep-07 4:30
MemberDavid Crow7-Sep-07 4:30 
AnswerRe: IHTMLDocument2Ptr not found Pin
Bhavesh Bagadiya7-Sep-07 4:56
MemberBhavesh Bagadiya7-Sep-07 4:56 
QuestionSending a CFormView app in the status bar with the X button (Close Button of the window) Pin
HiEverybody7-Sep-07 3:44
MemberHiEverybody7-Sep-07 3:44 
AnswerRe: Sending a CFormView app in the status bar with the X button (Close Button of the window) Pin
David Crow7-Sep-07 3:59
MemberDavid Crow7-Sep-07 3:59 

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.