|
csrss wrote: if((dwStyle & SS_CENTERIMAGE) == TRUE)
& is not a boolean operation, nor is SS_CENTERIMAGE equal to 1 . Try:
if ((dwStyle & SS_CENTERIMAGE) == SS_CENTERIMAGE)
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Thanks!
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
I build an app w/VC++6 . I design a window with an EDIT CONTROL (IDD_MYEDIT) , associate a CEdit control (m_myedit ). I switched on the PASSWORD style of the control.
Can be triggered this style on or off during the program running?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
This should do it:
void ToggleStyle(HWND hEdit)
{
if(SendMessage(hEdit,EM_GETPASSWORDCHAR,0,0) == '*')
SendMessage(hEdit,EM_SETPASSWORDCHAR,0,0);
else
SendMessage(hEdit,EM_SETPASSWORDCHAR,(WPARAM)'*',0);
SetFocus(hEdit);
}
You can have a look here[^] for an explanation, if you're interested
modified 13-Sep-18 21:01pm.
|
|
|
|
|
Thx I will try it tomorrow. It is 2105.
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
As far as I know, and according to the docs[^], after the edit control has been created, the ES_PASSWORD style can't be changed.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That's true, you can't add or remove ES_PASSWORD directly with SetWindowLong, but with EM_SETPASSWORDCHAR[^] you can still have the desired effect.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
Cool thanks!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
How to create a modeless or embedded CFileDialog, GetOpenFileName() or GetSaveFileName() into user Dialog?
Thanks
|
|
|
|
|
I'm not 100% sure what you are trying to do but you can look here[^] for help on CFileDialog . Alternatively if you are looking to customise these dialogs to your own specifications then try here[^].
The best things in life are not things.
|
|
|
|
|
|
Why would you want a modeless CFileDialog? I can't think of any case where a user would select some sort of open/save button and have the software not wait for an input or a cancel.
Regardless of that though, if you really want it, just make your own class derived from CFileDialog (you'll have to replace DoModal() with a call to Create() ). Override the virtual methods OnOK() and OnCancel() and you have your own modeless CFileDialog.
|
|
|
|
|
|
Dear All,
I've a String. Now i've converted to MD5 hash checksum value.
Now i want to decode the same string from the hash value.
Please tell me how to do thi.
Note : I'm using Crypto++ library.
Thank you all.
|
|
|
|
|
Sk_cpp wrote: Now i want to decode the same string from the hash value.
you cannot "decode" a hash value back into the original data.
|
|
|
|
|
Hi All,
Sorry for the lengthy description, I don't know how else to explain it...
I have a program which has a sqlite database backup function.
It opens the source.db file, writes backup version info and date into a backup.db file, appends those info with binary stream of source.db, and then closes both files.
However, my program fails with a sharing violation when it tries to open the source.db
CFile csf;
CFileException e;
if (!csf.Open(_T("source.db", CFile::modeNoTruncate | CFile::typeBinary | CFile::modeRead, &e ))
{
if (e.m_cause == CFileException::sharingViolation )
AfxMessageBox(_T("Sharing Violation!!"));
}
I traced the program to filecore.cpp, looked like my program cannot obtain a file handle at this line:
HANDLE hFile = m_pTM != NULL ?
m_pTM->CreateFile(lpszFileName, dwAccess, dwShareMode, &sa, dwCreateFlag, dwFlags, NULL) :
::CreateFile(lpszFileName, dwAccess, dwShareMode, &sa, dwCreateFlag, dwFlags, NULL);
Even though the source.db is in use, I should still be able to have read access to it, right?
Another observation that puzzles me is that the backup function works on another .db file created by the same program.
I've been searching on the web and tried everything I can. Would someone please give me some suggestion?
Thanks,
Helen
|
|
|
|
|
TheHelenLee wrote: Even though the source.db is in use, I should still be able to have read access to it, right?
Not necessarily. If some other process has opened the file exclusively, using the flags CFile::shareExclusive, that would prohibit all other access.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Chris,
My light bulb turned on when you mentioned about the CFile::shareExclusive flag. In my code to open file for reading, I didn't have CFile::shareDenyNone, I guess it defaults to shareExclusive when I don't specify it? After I set the flag, the program works. It looks like my program was stepping on its own foot.
I'm just still puzzled as to why it works for one file, but not the other when I don't use the shareDenyNone flag. Any ideas?
Thank you for helping me out, I feel so relief now that the problem is solved!!
|
|
|
|
|
Hi all,
i m start working on access database,i have no idea about this please help me for this.
and provide me info and guidance to establich database connection and execution of Query for insertion or retrivel of values in database.
thanks in advance
|
|
|
|
|
Le@rner wrote: i m start working on access database,i have no idea about this
Then your best bet would be to do some research into databases in general and Access[^] in particular.
The best things in life are not things.
|
|
|
|
|
there different option for database connection and operations like DAO,ADO,ODBC,OLE DB etc .
please tell me which one is better to continue.
|
|
|
|
|
Le@rner wrote: please tell me which one is better to continue.
Take a look at some of the links I found for you, and possibly some of the articles here on CodeProject; the answers are there.
The best things in life are not things.
|
|
|
|
|
if i am having an access file that is contains a table with some columns,
now odbc is fine for this or not?
i am choosing ODBC to continue is it ok.
modified on Thursday, June 30, 2011 8:24 AM
|
|
|
|
|
Le@rner wrote: please tell me which one is better to continue.
Better for what? Each has its own strengths and weaknesses. You are the only one that knows your requirements so ultimately only you can decide which is better.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Hi all,
i want to know what type of dll is created by MFC that is easily use by any language or platform.
i am working on MFC Application, here i want to create a dll of my application,now i want to use it in c#,VB or any other platform.
please help me how can i do this,
and also provide me info or guidance to use dll and importing and exporting of dll file.
thannks in advance.
i m waiting for ur valuable suggestion.
|
|
|
|