|
thank guys, tries both solution but no luck, more help would be nice
Gpat
|
|
|
|
|
Hello everyone,
I have an application that uses the web browser ActiveX control that displays content from other users. For security, I would like to restrict the control to only displaying the content by disabling scripting, embedded controls, etc. I'm sure this is possible, but I have not figured out how to do this.
Thanks!
-Joel
|
|
|
|
|
I created a program using visual basic. For some functions the program accesses a dll which was created using visual c++. When the program is run on a computer that does not have visual studio installed, functions which make calls to the dll generate an error:
Unable to load DLL 'filename.dll': This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1).
Reinstalling the application does not help, and when the program is run on a computer that does have visual studio installed, calls to the dll work as expected without generating any type of error. I even attached and installed all the latest Visual C++ Runtime Libraries, and still no luck.
Is there some component that is installed with Visual Studio that I need to attach to my program installation? Is there some way I can create or access the dll such that it does not need this component?
|
|
|
|
|
You're probably missing the CRT. You could statically link
to the C runtime. Or you can deploy the redistributables...
Deployment (C++)[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Various smart card certificates are imported into the system store. When a smart card is inserted into the reader, the user have to select his certificate from the list of certificates in the sistem and then insert the PIN.
To verify that the certificate selected from the system store correspond to the smart card currently in the reader I try to send a challenge to the smart card (GemPlus CSP)
- A crypto context from the certificate selected from the system store is acquired.
- A crypto context from the smart card in the reader is acquired.
- A challenge is created with random data (CryptGenRandom()).
- The public/private key pair is obtained from the certificate in the system. (CryptGetUserKey(AT_KEYEXCHANGE)).
- The challenge is encrypted with the previous public key from the certificate in the system store (CryptEncrypt()).
- The public/private key pair is obtained from the smart card (CryptGetUserKey(AT_KEYEXCHANGE)).
- The encrypted challenge is decrypted with the smart card (CryptDecrypt(AT_KEYEXCHANGE)) which should use his private key.
But when CryptDecrypt() with the crypto context of the smart card is called, error NTE_PROVIDER_DLL_FAIL (0x8009001D) is obtained.
Where is the error ? NTE_PROVIDER_DLL_FAIL is an error raised when a context is acquired, according to the documentation, but it seems to have no relation with Crypt/Decrypt !
Thanks
|
|
|
|
|
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.
|
|
|
|