|
Great it works well,
Thanx for your answer
With regards,
Jeeva
|
|
|
|
|
Hi all,
I have made a dialog based application in vc2008, my problem is while my application is running if i press T it pops up a message from application...
I am not getting why i am getting this problem....
How can i remove this......
|
|
|
|
|
VCProgrammer wrote: if i press T it pops up a message from application...
Which message ? What does it say ?
|
|
|
|
|
hi guys!
I currently need a modeless dialog in wich i need this behavior.
The modeless dialog shows, and then if i click it's parent will bring the parent dialog to top most. But i can not achieve this behavior, i create the modeless dialog but when i click the parent window it becomes active but the modeless child window stay on top.
I tried to use setparent but my app crashes. i am using something like this:
<pre>CMydialog * dialog = new CMydialog();
dialog->Create(IDD_DIALOG);
// dialo->SetParent(this);
dialo->ShowWindow(SW_SHOW);</pre>
but when i uncomment setparent it crashes. Please someone help me, i am a noob in this!
|
|
|
|
|
Try this,
In .h file
......
CMyDialog* dialog;
.....
In .cpp file
.....
if (dialog != NULL)
m_pDlg->SetFocus ();
//
// If the dialog box doesn't already exist, create it.
//
else
{
dialog = new CMyDialog;
dialog->Create (IDD_OPTIONS);
m_pDlg->ShowWindow (SW_SHOW);
}
|
|
|
|
|
Thanks dude!
But i know now how to do what i asked for, is use the desktop window like it's parent
dialog->Create (IDD_OPTIONS, GetDesktopWindow());
and that´s it.
|
|
|
|
|
Hi,,
I have a file abc.reg.I want to install the registry file , but the main point is the RUN dialog as well as the conformation dialog should be hidden to the user. After shell execute the installation should be done silently.
Any help is appriciated.
Regards,
KDevloper
|
|
|
|
|
You must use CreateProcess instead of ShellExecute .
Give the lpCommandLine parameter as Regedit.exe /s <.REG filename>
«_Superman_»
|
|
|
|
|
Hi All
How to know my exe kill through Windows Task Manager?Plz help me
|
|
|
|
|
|
Thanks for reply
But can you tell me how to know through code?
|
|
|
|
|
pls explain did't got it.
|
|
|
|
|
|
Hi,
In my project we are using Visual Studio IDE. My compliler is not doing padding.I have to send one file to another project.That project is using Carbide IDE. That compiler is doing padding.
So I have to do padding and I have to send file.How to do padding using
#Pragma pack().
|
|
|
|
|
#pragma pack(n) where n can be a value of 1, 2, 4, 8 or 16.
«_Superman_»
|
|
|
|
|
hi all,
I have made a dialog based application in vc2008...
my problem is when i run my application sometimes it gives an error
Window has triggered a breakpoint in program.
This may be corruption of the heap, which indicates a bug in program or any of the dll it has loaded....
This may also be due to user pressing F12 while Program is in focus.
The output window may have more diagnostic information...
and sometimes it runs fine....
my application runs in release mode so can't debug it....
how can i resolve my problem...
|
|
|
|
|
Why cant you run it in debug?
|
|
|
|
|
Run the application in debug mode and read here[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
I have developed a Ribbon application on Vista using VS 2008. It works fine on Vista. I statically link MFC so that I can run it on XP too.
But when I run it on XP, it puts up a dialog box saying "A required resource was unavailble". Later if I press OK on this dialog, it puts up another one saying "Encountered an improper argument". Many such("Encountered an....") dialogs follow(one after another) until I terminate it from the task manager.
Interesting thing I noticed is that this scenario occurs when I just place the mouse pointer over the Ribbon bar. I do nothing else. Then I open the Task manager and see that the memory used is increasing by 8 Kbytes with every second. Eventually followed by the above scenario.
Wt ???????
modified on Thursday, February 5, 2009 8:51 AM
|
|
|
|
|
I solved the problem.
There was a resource leak in my code, but it was crashing in MS VC++ code.
I was getting the handle to dc(GetDC()) in some UI update event(ON_UPDATE_COMMAND_UI), but I was not releasing it.
|
|
|
|
|
How to play an Animation and make video render before logon through credential provider ?(Vista)
It seams VMR9 cannot work fine before logon. It's too slowly to run a wpf process.
(development of facial recognition credential)
modified on Wednesday, February 4, 2009 9:26 PM
|
|
|
|
|
I hope for your sake that you have a flame proof suit cuz you are about to get flamed for spamming the board.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Hi,
I've been searching far and wide on how to setup a client certficate so that my application can access a https server using winhttp.
Ultimate goal
Application uses the https server for storage and updating of personal statistics information. This data can be accessed from any machine with this application, using it's internal memory certficate, eg, the certficate shouldn't be stored in a windows certficate store, user identification is done on protocols internal to the script running on the server address.
Problem
The documentation on how to setup and use a client certifcate (p12) with password for a certificate store, is very poor to non-existent.
If I try to load a p12 certificate through:
m_hCertStore = CertOpenStore(
CERT_STORE_PROV_FILENAME,
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
NULL,
0,
L"my-client.p12"
);
The function fails, and as far as I can see, this is the only way to load a certificate for my application to use internally.
As mentioned above the ultimate goal is to have the certificate entirely in memory, but in the meantime it's acceptable to just load it from a file.
Solution?
Can anyone give some pointers on how to use a p12 file or other client certificate setup with a certifcate store?
When i test this same certifcate through IE it asks for the password contained in the file. So I'd imagine I'd have to supply this password through an API to load it into my certficate store, but there's no information how to work with this.
Any advice welcome, I'm completely stumped!!!
|
|
|
|
|
You have probably solved this by now, but, here are the key ideas for the client:
Read the .p12 into memory.
Use PFXImportCertStore to put it into a certstore
Use WinHttpSetOption with the WINHTTP_OPTION_CLIENT_CERT_CONTEXT parameter.
HCERTSTORE PFXImportCertStoreTCHAR( CRYPT_DATA_BLOB *PFX, const TCHAR * password )
{
#if defined UNICODE || defined _UNICODE
return ::PFXImportCertStore( PFX, password, 0 );
#endif
// Have to convert char * password to wchar_t *
size_t sizeInWords= 999;
wchar_t wcstr[999];
size_t count= strlen( password );
size_t returnValue;
errno_t err= mbstowcs_s( &returnValue, wcstr, sizeInWords, (const char *)password, count );
return ::PFXImportCertStore( PFX, wcstr, 0 );
}
// Use a .pfx certificate and private key
// Note that the certificate must be associated with a private key to avoid a ERROR_WINHTTP_CLIENT_CERT_NO_PRIVATE_KEY error.
//
void setClientCertificate( const std::vector< unsigned char > & clientPfx, const TCHAR * szPassword )
{
if ( 0 == (openFlags & WINHTTP_FLAG_SECURE) ) return; // No need to send a client certificate if using plain http
// Convert a .pfx or .p12 file image to a Certificate store
CRYPT_DATA_BLOB PFX;
PFX.pbData= (BYTE *)&clientPfx[0];
PFX.cbData= clientPfx.size();
HCERTSTORE pfxStore= PFXImportCertStoreTCHAR( &PFX, szPassword );
if ( NULL == pfxStore ) throw std::pair<int,int>( __LINE__, ::GetLastError() );
// Extract the certificate from the store and pass it to WinHttp
PCCERT_CONTEXT pcontext= NULL, clientCertContext;
while ( pcontext = ::CertEnumCertificatesInStore( pfxStore, pcontext ) ){
clientCertContext= ::CertDuplicateCertificateContext( pcontext ); // CertEnumCertificatesInStore frees its passed in pcontext !
BOOL stat= ::WinHttpSetOption( hRequest, WINHTTP_OPTION_CLIENT_CERT_CONTEXT, (LPVOID)clientCertContext, sizeof(CERT_CONTEXT) );
if ( FALSE == stat ) throw std::pair<int,int>( __LINE__, ::GetLastError() );
return; // Success
}
throw std::pair<int,int>( __LINE__, ::GetLastError() ); // No certificates in the store created from the pfx/p12
}
|
|
|
|
|
Hi.
I have an MSI package which works with 2000, XP and Vista Home Premium; after installation, in each case the ShellNew process works perfectly (a right click on the desktop and explorer offers the creation of a new file based on a template which is fully qualified; and life is good). However, under Ultimate the popup menu does not contain the option. I have tried adding the template (removing the qualified path from the Reg ShellNew entry) to the system ShellNew directory, but whatever I do; it simply will not work. Has something changed under Ultimate or is there an additional setting that I need to consider. Any help or comment would be much appreciated.
My best regards, in hopeful and optimistic anticipation.
James.
modified on Wednesday, February 4, 2009 5:10 PM
|
|
|
|