|
Thanks anyways
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
My project involves receiving input from a keyboard device. I use "Raw Input" to collect data only from that device. But I also wish other applications NOT to receive data from that device. Anybody can help me?
Thanks in advance
|
|
|
|
|
I am getting an Illegal Indirection Error on this code, and I am not quite sure what I am doing wrong.
http://msdn.microsoft.com/en-us/libr...65(VS.85).aspx
That link shows the function and what it should do. Am I on the right track? What do I have to do to fix the error.
#include <iostream>
#include "windows.h"
#include "Wincrypt.h"
int main()
{
PCCERT_CHAIN_CONTEXT chainContext;
HCERTSTORE certStore = "MY";
DWORD dwCertEncodingType = X509_ASN_ENCODING;
DWORD dwFindFlags = CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG;
DWORD dwFindType = CERT_CHAIN_FIND_BY_ISSUER;
const void *pvFindPara = "MyIssuer";
PCCERT_CHAIN_CONTEXT pPrevChainContext = NULL;
while (chainContext = CertFindChainInStore(certStore,
dwCertEncodingType,
dwFindFlags,
dwFindType,
*pvFindPara,
pPrevChainContext))
{
printf((const char*)chainContext);
}
system("PAUSE");
return 0;
}
|
|
|
|
|
mypicturefaded wrote: *pvFindPara, //This line contains the error.
It should be pvFindPara and not *pvFindPara . Additionally, you should link to Crypt32.lib . Just add this code after including all the header files: #pragma comment(lib, "Crypt32")
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Well, it complies now! But it is not return any results. I am entering the Issuer correctly...
Is there something in my syntax that isn't correct?
|
|
|
|
|
I have no idea what are you trying to achieve. There is no link in your previous post (the URL is incomplete). To add to it, system("PAUSE"); is a horrible thing to do.
mypicturefaded wrote: Is there something in my syntax that isn't correct?
If there's a syntax error, your code won't compile.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: There is no link in your previous post (the URL is incomplete).
Probably this one.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I am aware that it is a horrible thing to do.
But for this example I highly doubt it is messing with anything I am doing.
I need to be able to get the Certificate Chain so I can plug it into an Adobe app.
I don't know why you feel the need to pick apart my wording.
The code complies, and runs, but I am not getting the expected results.
The while loop is failing and going to the end of the program. So it isn't picking up the certificates.
#include <iostream>
#include "windows.h"
#include "Wincrypt.h"
#pragma comment(lib, "Crypt32")
int main()
{
PCCERT_CHAIN_CONTEXT chainContext;
HCERTSTORE certStore = "MY";
DWORD dwCertEncodingType = X509_ASN_ENCODING;
DWORD dwFindFlags = CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG;
DWORD dwFindType = CERT_CHAIN_FIND_BY_ISSUER;
const void *pvFindPara = "MyIssuer";
PCCERT_CHAIN_CONTEXT pPrevChainContext = NULL;
while (chainContext = CertFindChainInStore(certStore,
dwCertEncodingType,
dwFindFlags,
dwFindType,
pvFindPara,
pPrevChainContext))
{
printf((const char*)chainContext);
}
system("PAUSE");
return 0;
}
Yes David you are right, that is the correct link.
|
|
|
|
|
mypicturefaded wrote: I need to be able to get the Certificate Chain so I can plug it into an Adobe app.
Have you seen this?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
That IS the first time I have seen that. It still doesn't iterate through any on my certificates though.
I really am a little confused...Every example I have tried to implement fails at the while loop.
|
|
|
|
|
mypicturefaded,
The code you have shown is looking for certificates in the certificate store named "MY" signed by "MyIssuer". Are you sure that you have certificates that match this criteria?
You can check by following the instrustions below.
How to: View Certificates with the MMC Snap-in[^]
You should also note that the default certificate chain is HCCE_CURRENT_USER. If you need to enumerate certificates in the local system account you will need to use the CertGetCertificateChain Function[^] with the hChainEngine argument set as HCCE_LOCAL_MACHINE.
Best Wishes,
-David Delaune
|
|
|
|
|
In a function OnSysCommand() check a parameter for equality SC_MAXIMIZE. Then wrote a code which works perfectly in OnSizing(), but GetWindowRect() and ScreenToClient() return the rectangle of that window which was to maximization. What is a problem in?
|
|
|
|
|
What are you trying to do here?
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
zhenek91 wrote: but GetWindowRect() and ScreenToClient() return the rectangle of that window which was to maximization
do you want ScreenToClient Information in maximize mode or before maximize
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi all,
I have many compilation errors in my solutions and the type of errors are very different.
I am developing an MFC dialog application with visual studio 2005 and the follwoing is one of my work and with eash file I am adding the errors generated with each file.
// ( RulesMatching.h )
#ifndef RULESMATCHING_HEADER_ID
#define RULESMATCHING_HEADER_ID
#include "PatternMatching.h"
class CRulesMatching
{
public:
CRulesMatching();
int MatchRule(CString,int);
CPatternMatching OPM2; // create object OPM2 from the class
}
#endif
// ( RulesMatching.cpp )
#include "stdafx.h"
#include "RulesMatching.h"
#include "afxdb.h"
#include "odbcinst.h"
CRulesMatching::CRulesMatching()
{
}
int CRulesMatching::MatchRule(CString Str, int Cnum)
{
CDatabase database4;
CString SqlRulePattern;
CString sDriver("MICROSOFT ACCESS DRIVER (*.mdb)");
CString sDsn;
CString ssDSN("ODBC;DRIVER={%s};DSN='';DBQ=%s");
CString sFile("d:\\works\\ReadDB\\ASU.mdb");
sDsn.Format(ssDSN, sDriver, sFile);
database4.Open(NULL,false,false,sDsn);
CRecordset recset2( &database4 );
SqlRulePattern= "SELECT * from Patterns where CNum="+Cnum ;
recset2.Open(CRecordset::forwardOnly,SqlRulePattern,CRecordset::readOnly);
int Result2;
CString RContextNum,RRuleNum,RPatternNum,RPatternValue,RPatternContent;
CString BestRContextNum,BestRRuleNum,BestRPatternNum;
while(!recset2.IsEOF())
{
recset2.GetFieldValue(_T("CNum"),RContextNum);
recset2.GetFieldValue(_T("RNum"),RRuleNum);
recset2.GetFieldValue(_T("PNum"),RPatternNum);
recset2.GetFieldValue(_T("PValue"),RPatternValue);
recset2.GetFieldValue(_T("PContent"),RPatternContent);
Result2 = OPM2.MatchPattern(Str,RPatternContent);
if (Result2==1)
{
BestRContextNum = RContextNum;
BestRRuleNum = RRuleNum;
BestRPatternNum = RPatternNum;
recset2.MoveNext();
}
else
{
recset2.MoveNext();
}
}// while() closing
int i = _ttoi(BestRRuleNum);
return i ;
}
WHEN I COMPILE THE PREVIOUS ( .cpp file ) I HAD THESE ERRORS:
sqltypes.h(21) : error C2143: syntax error : missing ';' before 'string'
sqltypes.h(21) : error C2059: syntax error : 'string'
sqltypes.h(21) : error C2143: syntax error : missing ';' before '{'
sqltypes.h(21) : error C2447: '{' : missing function header (old-style formal list?)
afxdb_.h(70) : error C2146: syntax error : missing ';' before identifier 'm_dwDataLength'
afxdb_.h(70) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
afxdb_.h(70) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
sql.h(578) : error C2143: syntax error : missing ';' before '__stdcall'
sql.h(578) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
sql.h(578) : error C2065: 'SQLHENV' : undeclared identifier
sql.h(578) : error C2146: syntax error : missing ')' before identifier 'EnvironmentHandle'
sql.h(578) : warning C4229: anachronism used : modifiers on data are ignored
sql.h(578) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
sql.h(579) : error C2059: syntax error : ')'
sql.h(581) : error C2143: syntax error : missing ';' before '__stdcall'
sql.h(581) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
sql.h(581) : error C2086: 'int SQLRETURN' : redefinition
sql.h(578) : see declaration of 'SQLRETURN'
sql.h(581) : error C2065: 'EnvironmentHandle' : undeclared identifier
warning C4229: anachronism used : modifiers on data are ignored
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
sql.h(581) : fatal error C1903: unable to recover from previous error(s); stopping compilation
ACA - 19 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
AND WHEN I COMPILE THE WHOLE SOLUTION I HAVE THESE ERRORS:
error C2236: unexpected 'class' 'CUtteranceCleaning'. Did you forget a ';'?
c:\documents and settings\mohammad\desktop\aca\aca\utterancecleaning.h(5) : error C2143: syntax error : missing ';' before '{'
c:\documents and settings\mohammad\desktop\aca\aca\utterancecleaning.h(5) : error C2447: '{' : missing function header (old-style formal list?)
c:\documents and settings\mohammad\desktop\aca\aca\acadlg.h(31) : error C2146: syntax error : missing ';' before identifier 'OUC'
acadlg.h(31) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\acadlg.h(31) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
acadlg.cpp(169) : error C2065: 'OUC' : undeclared identifier
acadlg.cpp(169) : error C2228: left of '.CleanUtterance' must have class/struct/union
type is ''unknown-type''
Build log was saved at "file://c:\Documents and Settings\mohammad\Desktop\ACA\ACA\Debug\BuildLog.htm"
ACA - 8 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I am sorry for this long thread but I worked for two days to make the solution working and I can't and I checked every missing semicolon or bracket and there is no somthing missing..
Please anyone can help me let me know and I appreciate any type of helping.
|
|
|
|
|
You forgot the ; after the declaration of CRulesMatching in your RulesMatching.h .
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
yeah ur alright.
thank you so much
|
|
|
|
|
always concentrate on the first error message first, solving it may reduce the list dramatically.
|
|
|
|
|
|
hello all, i have a problem need your help...
I show amount data in virtual listctrl fast,but i click a item ,the item text will be recovered ,,i want to fix the text in each item when them showed like in real mode.
I search much,,but i didn't get the solution,,i need your help,thanks.
|
|
|
|
|
yiyinkuang wrote: I show amount data in virtual listctrl fast...
I'm with you so far.
yiyinkuang wrote: ...but i click a item ,the item text will be recovered...
Are you talking about using GetItemText() or GetItem() in response to a LVN_ITEMCHANGED message?
yiyinkuang wrote: ...i want to fix the text in each item when them showed like in real mode.
This is unclear in so many ways.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
yes,,i try to use GetItemText store item text ,,but GetItemText will trigger the item text change
|
|
|
|
|
yiyinkuang wrote: try to use GetItemText store item text...
Store it where, in the list control or some data structure?
yiyinkuang wrote: but GetItemText will trigger the item text change
Nonsense (assuming you are referring to the LVN_ITEMCHANGED message). That would only happen if you used SetItemText() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
thank you,,use GetItemText will send LVN_GETDISPINFO,,and function OnGetdispinfoList will change the item text
|
|
|
|
|
yiyinkuang wrote: ...function OnGetdispinfoList will change the item text
In a manner of speaking, yes.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|