|
Regards to Cthulhu.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Nyarlatotep wrote: Where is the error ?
You tell us!
From CryptAcquireContext(), CPAcquireContext():
NTE_PROVIDER_DLL_FAIL( 0x8009001DL )
The provider DLL file could not be loaded or failed to initialize.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It could be but ... CryptAcquireContext() does not raise this error, it succeeded. It's CryptDecrypt() which fails.
Naturally this function tries (would?) to decrypt data using the AT_KEYEXCHANGE key obtained with CryptGetUserKey() from the context acquired from the smart card.
According to MSDN:
"The CryptGetUserKey function retrieves a handle of one of a user's two public/private key pairs..."
If I'm not wrong CryptoAPI CryptEncrypt()/CryptDecrypt() should use the public key to encrypt and the private key to decrypt, but decrypting with the private key from the smart card fails.
Changhing the key type to AT_SIGNING when retrieving the key pair with CryptGetUserKey() has no effects (and it has not sense for me. I don't want to sign a piece of data with the private key. I want decrypt a piece of data with it ).
|
|
|
|
|
I am looking for a compression algorithm library (zlib or similar) which uses the Intel MMX extensions in order to get the best performance. Any suggestions?
|
|
|
|
|
|
I'd take a pretty big guess that the limiting factor on compression performance is how fast the data can be pulled in from and written to the disk, and on the performance of the memory buses, not on the core processing performance of the CPU. ZIP deflate isn't a particularly CPU-intensive algorithm.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Hallo Ladies and Gentlemen,
i have a big Problem whith an EditBox which i have put in a ToolBar of a small SDI Project.
First I will describe what i have done and what is working :
1. I created a new ToolBar with an EditBox and i coud show this control in the project's ToolBar -works-
2. I created a new Button in the -works-
What I want is to fill the EditBox whith values calculated in the Doc.h by clicking the fill button (Btn with the green point).
Every click on the Fill button another value in the EditBix !
The On Fill function is in the Doc.cpp !
But this isn't working !
Pleeese help me, this prob. is really drivin' me crazy ;(
Many, Many Thanx for your help.
Best regards
ShadowEater
In The Doc.cpp:
<br />
void CEditCtrlDoc::OnFill() <br />
{<br />
((CMainFrame*)GetParent())->SetMyToolBarEditText("blabla");<br />
}<br />
<br />
In the Doc.h:
<br />
<br />
#if !defined(AFX_EDITCTRLDOC_H__1C707C4F_EC49_423A_B8EC_3CFE75EDB1AC__INCLUDED_)<br />
#define AFX_EDITCTRLDOC_H__1C707C4F_EC49_423A_B8EC_3CFE75EDB1AC__INCLUDED_<br />
<br />
#if _MSC_VER > 1000<br />
#pragma once<br />
#endif // _MSC_VER > 1000<br />
<br />
<br />
class CEditCtrlDoc : public CDocument<br />
{<br />
protected:
CEditCtrlDoc();<br />
DECLARE_DYNCREATE(CEditCtrlDoc)<br />
<br />
public:<br />
BOOL m_bFill;<br />
<br />
public:<br />
<br />
CString m_TestFlag;<br />
<br />
<br />
public:<br />
virtual BOOL OnNewDocument();<br />
virtual void Serialize(CArchive& ar);<br />
<br />
public:<br />
virtual ~CEditCtrlDoc();<br />
#ifdef _DEBUG<br />
virtual void AssertValid() const;<br />
virtual void Dump(CDumpContext& dc) const;<br />
#endif<br />
<br />
protected:<br />
<br />
protected:<br />
afx_msg void OnUpdateFill(CCmdUI* pCmdUI);<br />
afx_msg void OnFill();<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
<br />
<br />
<br />
#endif // !defined(AFX_EDITCTRLDOC_H__1C707C4F_EC49_423A_B8EC_3CFE75EDB1AC__INCLUDED_)<br />
<br />
Inthe TlBar (the new toolbarclass):
<br />
<br />
#include "stdafx.h"<br />
#include "EditCtrl.h"<br />
#include "TlBar.h"<br />
<br />
<br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;<br />
#endif<br />
<br />
<br />
#define EDITLEN 80 <br />
#define EDITPOS 3 <br />
<br />
<br />
<br />
<br />
CTlBar::CTlBar()<br />
{<br />
m_TestString = "default !!!";<br />
}<br />
<br />
CTlBar::~CTlBar()<br />
{<br />
}<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CTlBar, CToolBar)<br />
ON_CBN_EDITUPDATE (ID_nEDIT, OnUpdateEdit)<br />
ON_CBN_EDITCHANGE (ID_nEDIT, OnChangeEdit)<br />
END_MESSAGE_MAP()<br />
<br />
<br />
<br />
BOOL CTlBar::LoadToolBarEx (UINT id)<br />
{<br />
bool bReturn;<br />
bReturn = CTlBar::LoadToolBar (id);<br />
<br />
int iPosition = CommandToIndex (ID_nEDIT);<br />
<br />
SetButtonInfo (iPosition,ID_nEDIT,TBBS_SEPARATOR,EDITLEN);<br />
<br />
<br />
CRect rect;<br />
GetItemRect (iPosition, &rect);<br />
rect.bottom = 20;<br />
<br />
DWORD dwStyle = WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL;<br />
m_Ctrl_EDIT.CreateEx(WS_EX_CLIENTEDGE,_T("EDIT"),NULL, dwStyle, rect, this, ID_nEDIT);<br />
<br />
<br />
m_Ctrl_EDIT.SetWindowText (m_TestString);<br />
return bReturn;<br />
}<br />
<br />
<br />
<br />
void CTlBar::OnUpdateEdit ()<br />
{<br />
AfxMessageBox ("Funktion OnUpdateEdit !!!",MB_OK);<br />
}<br />
<br />
<br />
<br />
void CTlBar::OnChangeEdit()<br />
{<br />
AfxMessageBox ("Funktion OnChangeEdit !!!",MB_OK);<br />
}<br />
In teh TlBar.h:
<br />
#if !defined(AFX_TLBAR_H__1741EA96_4BB2_4E63_8A8A_F21C15ACF84F__INCLUDED_)<br />
#define AFX_TLBAR_H__1741EA96_4BB2_4E63_8A8A_F21C15ACF84F__INCLUDED_<br />
<br />
#if _MSC_VER > 1000<br />
#pragma once<br />
#endif // _MSC_VER > 1000<br />
<br />
<br />
class CTlBar : public CToolBar<br />
{<br />
public:<br />
CTlBar();<br />
<br />
BOOL LoadToolBarEx (UINT id);<br />
public:<br />
<br />
public:<br />
<br />
<br />
public:<br />
virtual ~CTlBar();<br />
<br />
<br />
afx_msg void OnUpdateEdit();<br />
afx_msg void OnChangeEdit();<br />
DECLARE_MESSAGE_MAP()<br />
public:<br />
CEdit m_Ctrl_EDIT;<br />
CString m_TestString;<br />
};<br />
<br />
<br />
<br />
<br />
#endif // AFX_TLBAR_H__1741EA96_4BB2_4E63_8A8A_F21C15ACF84F__INCLUDED_<br />
<br />
|
|
|
|
|
At least you could erase all assistant lines and leave just the relevant ones. And even more if they are in another language (I understand them I use german VC too, but many people won't).
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Thx for your quick answer Nelek,
could you help solving my problem ?
Regards
Croc
|
|
|
|
|
CrocodileBuck wrote: could you help solving my problem ?
Yes, many people could help you. All that Nelek's asking is that you clean up your post (not by creating a separate post) by removing all but the relevant lines of code. Folks here help for the fun of it so asking them to read through pages of unnecessary code is a sure way to get ignored.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
O.K. I cleaned up the code, i hope i haven't deleted too much !
I tried to send as much info as it is possible sorry !
Is it better now ???
In The Doc.cpp:
<br />
void CEditCtrlDoc::OnFill() <br />
{<br />
((CMainFrame*)GetParent())->SetMyToolBarEditText("blabla");<br />
}<br />
In the Doc.h:
<br />
<br />
<br />
public:<br />
BOOL m_bFill;<br />
public:<br />
<br />
CString m_TestFlag;<br />
protected:<br />
afx_msg void OnUpdateFill(CCmdUI* pCmdUI);<br />
afx_msg void OnFill();<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
<br />
Inthe TlBar (the new toolbarclass):
<br />
#include "stdafx.h"<br />
#include "EditCtrl.h"<br />
#include "TlBar.h"<br />
<br />
<br />
#define EDITLEN 80 <br />
#define EDITPOS 3 <br />
<br />
<br />
CTlBar::CTlBar()<br />
{<br />
m_TestString = "default !!!";<br />
}<br />
<br />
CTlBar::~CTlBar()<br />
{<br />
}<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CTlBar, CToolBar)<br />
ON_CBN_EDITUPDATE (ID_nEDIT, OnUpdateEdit)<br />
ON_CBN_EDITCHANGE (ID_nEDIT, OnChangeEdit)<br />
END_MESSAGE_MAP()<br />
<br />
<br />
BOOL CTlBar::LoadToolBarEx (UINT id)<br />
{<br />
bool bReturn;<br />
bReturn = CTlBar::LoadToolBar (id);<br />
<br />
int iPosition = CommandToIndex (ID_nEDIT);<br />
<br />
SetButtonInfo (iPosition,ID_nEDIT,TBBS_SEPARATOR,EDITLEN);<br />
<br />
<br />
CRect rect;<br />
GetItemRect (iPosition, &rect);<br />
rect.bottom = 20;<br />
<br />
DWORD dwStyle = WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL;<br />
m_Ctrl_EDIT.CreateEx(WS_EX_CLIENTEDGE,_T("EDIT"),NULL, dwStyle, rect, this, ID_nEDIT);<br />
<br />
m_Ctrl_EDIT.SetWindowText (m_TestString);<br />
<br />
return bReturn;<br />
}<br />
<br />
void CTlBar::OnUpdateEdit ()<br />
{<br />
AfxMessageBox ("Funktion OnUpdateEdit !!!",MB_OK);<br />
}<br />
<br />
void CTlBar::OnChangeEdit()<br />
{<br />
AfxMessageBox ("Funktion OnChangeEdit !!!",MB_OK);<br />
}<br />
In teh TlBar.h:
<br />
<br />
class CTlBar : public CToolBar<br />
{<br />
<br />
public:<br />
CTlBar();<br />
<br />
BOOL LoadToolBarEx (UINT id);<br />
public:<br />
virtual ~CTlBar();<br />
afx_msg void OnUpdateEdit();<br />
afx_msg void OnChangeEdit();<br />
DECLARE_MESSAGE_MAP()<br />
CEdit m_Ctrl_EDIT;<br />
CString m_TestString;<br />
|
|
|
|
|
...by the way, if it is possible or if you want i can send a zip file with my project, it is only 51 KB !
Thanx a lot
Croc
|
|
|
|
|
CrocodileBuck wrote: What I want is to fill the EditBox whith values calculated in the Doc.h by clicking the fill button (Btn with the green point).
Every click on the Fill button another value in the EditBix !
The On Fill function is in the Doc.cpp !
But this isn't working !
But what is not working? Have you used the debugger to step through the code? What happens in SetMyToolBarEditText() ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
first i get a not declared identifier at ((CMainFrame*)GetParent())->SetMyToolBarEditText("blabla");
then i included the MainFrm.h in doc.cpp now i get :
: error C2660: 'GetParent' : Funktion akzeptiert keine 0 Parameter
: error C2227: Der linke Teil von '->SetMyToolBarEditText' muss auf Klasse/Struktur/Union zeigen
GetParent needs a hwnd but how can i get one ?
Best regards
Croc
P.S.: Are there tuts our there which explain the Prob whith an edit in a toolBat ? I can only find 1 or 2 tuts which discribe the usage of comboboxes. Or are ther perhaps sources / code snippets ???
|
|
|
|
|
CrocodileBuck wrote:
first i get a not declared identifier at ((CMainFrame*)GetParent())->SetMyToolBarEditText("blabla");
Well, is SetMyToolBarEditText() a member of CMainFrame ?
CrocodileBuck wrote: GetParent needs a hwnd...
That depends on which version you are using. To access the frame from within your CDocument -derived class, then you would need to use:
((CMainFrame *) AfxGetMainWnd())->SetMyToolBarEditText("blabla");
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
now GetMainWnd is undeclared !
when i include CMainFrame ic get these errors :
: 'GetParent' : Funktion akzeptiert keine 0 Parameter
: Der linke Teil von '->SetMyToolBarEditText' muss auf Klasse/Struktur/Union zeigen
Best regards
Croc
|
|
|
|
|
CrocodileBuck wrote: now GetMainWnd is undeclared !
Well, it's only valid from within a CWinThread -derived class.
CrocodileBuck wrote: : 'GetParent' : Funktion akzeptiert keine 0 Parameter
Why are you still calling this?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Oh no, I made a mistake typing your code, now it will work, you are the best !
Many, Many Thanx !
Greetz
Croc
|
|
|
|
|
hi all,
I am woking on windows moblie. I want to know, is there any API to determine the name of device. How can i determine the name of progamatically the name of device.
pls help me.
Thanks
Yudhisthira Attry
|
|
|
|
|
If I remeber rightly it's written into the default registry by Platform Builder when the build of CE is out together. That's where I'd start looking. I'm sorry I can't dig around and get you any more info but I've got DEADlines and all that.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
What do you call the name of Win CE device?
See ::GetSystemInfo() and ::SystemParametersInfo() in your doc.
cheers,
AR
|
|
|
|
|
Hi....
I working on a dialog based application. This should have all SDI features like menu, print, save etc....
please help me....
Thanks in advance
varun
|
|
|
|
|
Add them by yourself. Choose what you need and go to the articles, there are lots of them than will help you if you read them.
Or just make a SDI document and take CFormView as the main View, then use CDialogs for the other things.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
What is the simplest method I can use to get lines drawn on dialog boxes?
Thanks
|
|
|
|
|
pDC->MoveTo (x1, y1);
pDC->LineTo (x2, y2);
Simple enough?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|