|
Hi all,
I am working on PropertySheet and PropertyPage (WizardMode). I have two Property Pages.
In second property page there are
1. single edit box
2. Back, Finish and Cancel Buttons.
When i click Finish after entering some value in edit box, i return CPropertyPage::OnWizardFinish();. This is OK.
But problem is
When i click Finish without entering any value in edit box, i return FALSE.
The Property page is present. But the mnemonic doesn't work. That is
ALT B for Back
ALT C for Cancel
Please give me the solution.
THanks in Advance.
|
|
|
|
|
MemoryDevice wrote: ALT B for Back
This should work. Doesn't B of Back underlined, when you press Alt ?
MemoryDevice wrote: ALT C for Cancel
Mnemonic is not present for Cancel button. Need to use Esc key.
|
|
|
|
|
prasad_som wrote: Mnemonic is not present for Cancel button.
Ya. You are right.
But ALT B is not working.
|
|
|
|
|
MemoryDevice wrote: But ALT B is not working.
I made a simple test app, where it works as it should. Perfect.
Can you show code how your property page class looks like, how property sheet is contructed.
|
|
|
|
|
When i click Finish without entering any value in edit box, i return FALSE.
The Property page is present. But the mnemonic doesn't work.
As i said, it DOES NOT work fine only in above case.
In all other cases it works fine.
|
|
|
|
|
And how can I guess that without seeing some code ? I'd already asked for that.
|
|
|
|
|
My very large app was shipped to a customer and as you might guess it failed. My code has lots of try catches in it and I though it strange that it failed with no exception traps shown in the log. After trying to insert some deliberate exceptions I found that the exception traps are not working at all. To test what was going on I created a console app:
int _tmain(int argc, _TCHAR* argv[])
{
printf("Start\n");
try
{
int *pWord=NULL;
*pWord=999;
}
catch(...)
{
printf("Error was caught\n");
}
printf("Stop\n");
return 0;
}
This should display
Start
Error was caught
Stop
But it actually displays
Start
.. the the MS crash dialog pops up.
Does anyone know why my exception traps have been disabled.
Richard.
Hell I thought it was funny .....
|
|
|
|
|
All is working as it should on a standard compliant C++ compiler. Low level exceptions are not meant to be caught by C++ catch blocks; only C++ exceptions thrown by the C++ throw keyword are. MSVC6 was buggy in this area and such exceptions could be caught by this construct. This bug was fixed in later versions. The "old" (non standard) behaviour can be enabled via the /EHa[^] compiler switch. Alternatively you can use SEH[^] to catch low level exceptions; be warned however that this is specific to the Windows platform and doesn't unwind the stack.
Steve
|
|
|
|
|
Thank you, that explains why it all worked fine under the old compiler.
Your reply is much appreciated.
Hell I thought it was funny .....
|
|
|
|
|
So I made the changes and it made no difference to the problem.
However, I managed to connect the debugger and what I've found is frightening.
The problem is ocurring because I'm passing an invalid parameter to
localtime_s but rather than reporting any error or throwing an exception it is directly calling:
_invoke_watson(pszExpression, pszFunction, pszFile, nLine, pReserved);
So msvcrt80.dll directly invokes DrWatson rather than throwing an error for you to catch.
Now looking at their code I can see that in order to catch invald parameters in my code I'm going to have to add an invalid parameter handler into it. This seems strange to me, surly rather than calling DrWatson, it should throw an exception or even return the error that the docs say it will return for an invalid value.
Hell I thought it was funny .....
|
|
|
|
|
I don't generally approve of catching such exceptions (access violations). There are exceptions (not the programming type) – such as in low level code – but in general littering code with “catch alls” just makes debugging hard and postmortem debugging near impossible. A good rule when using exceptions is this: only catch what you expect can be thrown if the program is functioning normally. Breaking this rule can make you wish you never heard of exception handling. For example, if you get an access violation while building a doubly linked list you crash and the debugger or Dr.Watson dump is at the problem point; if the exception is caught the program continues with a corrupted list and if your lucky a crash occurs some time later and you’re left tearing you hair out trying to find the source of the corruption; if you’re unlucky the program doesn’t crash at all but just doesn’t work properly.
Steve
|
|
|
|
|
null pointer or access violation exceptions are not treated as C++ exceptions but as SEH exceptions. You cannot catch SEH exceptions using the try catch block, you need to use a __try, __except block instead.
There is away of unifying the two different exception handling mechanisms. Search for SEH on codeproject and you should find an article that describes how to do this.
|
|
|
|
|
I tried my chance on the lounge - the responses were entertaining but not strictly useful!
Arabic speakers, hebrews, and other right to left writers (and readers), I need your help here!
When I copy the following text from Word
ف3.ي (أي )سنة ولدت؟
And paste it in any application (Notepad, IE, Excel), I get this
3. في )أي (سنة ولدت؟
Note that I have no idea what I am saying here and I hope this is not insulting!
The 3. at the right (hence the start) gets moved to the left (hence the end) and the parenthesis are inverted.
The copy and paste works within Word (except when using the special paste without formatting).
So here is my question: is there a settings in Windows or in a given application for the copy and paste to work correctly? What can I do to copy this properly?
Thanks in advance!
|
|
|
|
|
Hi guys,
I want to add my application to Quick Launch bar. How can I do it using source code in vc++ 6.0.
Please refer some source code or APIs.
Thanking in Advance
Velayudhan
|
|
|
|
|
You have to create a shortcut to your application in the directory <drive>\documents and settings\<user>\Application Data\Microsoft`\Internet Explorer.
To create a shortcut, browse CP articles, you should find it easily.
-- modified at 7:15 Wednesday 21st March, 2007
To find the directory path, use SHGetSpecialFolderPath.
|
|
|
|
|
: velayudhan_raj wrote: I want to add my application to Quick Launch bar. How can I do it using source code in vc++ 6.0.
<br />
%APPDATA%\Microsoft\Internet Explorer\Quick Launch\
is path to quick launch based on user. It automatically takes logged in user application data folder path.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
whether we have to include any header file for AfxGetWinApp(). since i got AfxGetWinApp() undeclared identifier.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: since i got AfxGetWinApp() undeclared identifier
yes, because its AfxGetApp .
|
|
|
|
|
deeps_cute wrote: hether we have to include any header file for AfxGetWinApp(). since i got AfxGetWinApp() undeclared identifier.
Arise Awake Stop Not Till ur Goal is Reached.
any why you need AfxGeatApp()??? just a query
|
|
|
|
|
I'm new in VS2005. I've developed 2 simple dialog based
MFC apps: in the first case the user interface (I mean buttons,
checkbosex, ans so on....)is shown in the old Windows style
while in the second case it is shown in the WinXP Style.
I've done nothing to select the UI style (I suppose there are
some different settings in projects but I can't find it).
Can someone explain me what setting allows to choose the UI style ?
Thanks a lot.
|
|
|
|
|
Are these MFC apps? Is the one with the new XP style a UNICODE app? There is a "quirk" in the included manifest (stdafx.h) in VS2005 where the generated app uses the old-style visual if the app is not UNICODE. If the app is UNICODE, you get the new-style visual. There is an #ifdef around the manifest in the VS-generated stdafx.h such that the manifest is only included for UNICODE apps.
Judy
|
|
|
|
|
Hi everyone!
I'm finding API's function or MFC class for working with FAT(File Alocation Table): Read infomation from FAT, work with directories and files (copy, read, write, delete...).
Can somebody show me ?
Thank you at all.
Nothing Is Impossible !
|
|
|
|
|
There is plenty of information about the FAT file system on the Internet, just Google for it.
You can use CreateFile() to open a volume (logical disk), and then use SeekFile/ReadFile/WriteFile to read and write sectors on the volume.
But you do know that Win32 natively does support the FAT file system? If you just want to use a FAT formatted disk for the usual file handling functions, just do it. You don't have to care about if the disk/volume is formatted for NTFS or FAT, it just works.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Hello everyone,
I have a bunch of dynamically created static controls on my MFC dialog.
I would like the user to be able to click on those. So how do I map the notification message from the control to a handler function?
I have no problem mapping the message from a static control created at designtime:
<br />
BEGIN_MESSAGE_MAP(CSomeprojectDlg, CDialog)<br />
...<br />
ON_STN_CLICKED(IDC_STATIC_TEST, OnStnClickedStatic)<br />
...<br />
END_MESSAGE_MAP()<br />
<br />
BOOL CSomeprojectDlg::OnInitDialog()<br />
{<br />
...<br />
GetDlgItem(IDC_STATIC_TEST)->ModifyStyle(0, SS_NOTIFY);<br />
...<br />
}<br />
<br />
void CSomeprojectDlg::OnStnClickedStaticTest()<br />
{<br />
MessageBox("Hello");<br />
}<br />
My code when creating the controls programatically:
<br />
BOOL CSomeprojectDlg::OnInitDialog()<br />
{<br />
...<br />
#define FirstID 2000<br />
<br />
for(i=1; i<=10; i++)<br />
{<br />
pWnd= new CWnd;<br />
pWnd->Create(_T("STATIC"), "SomeText", WS_CHILD | WS_VISIBLE | SS_NOTIFY, CRect(x_pos1, y_pos1, x_pos2, y_pos2), AfxGetMainWnd(), FirstID + i);<br />
}<br />
...<br />
}<br />
<br />
Thanks
-- modified at 5:22 Wednesday 21st March, 2007
|
|
|
|
|
Futterama wrote: GetDlgItem(IDC_STATIC_TEST)->ModifyStyle(0, SS_NOTIFY);
This step is unnecessary here, as you have already mentioned SS_NOTIFY style while creating control.
Futterama wrote: pWnd->Create(_T("STATIC"), "SomeText", WS_CHILD | WS_VISIBLE | SS_NOTIFY, CRect(x_pos1, y_pos1, x_pos2, y_pos2), AfxGetMainWnd(), FirstID + i);
Set this dilaog as parent of the static text. Modify your code to,
pWnd= new CWnd;
pWnd->Create(_T("STATIC"), "SomeText", WS_CHILD | WS_VISIBLE | SS_NOTIFY, CRect(x_pos1, y_pos1, x_pos2, y_pos2), m_hWnd, FirstID + i);
If one of FirstID + i is equal to IDC_STATIC_TEST , handler OnStnClickedStaticTest will be called.
|
|
|
|