|
Oooops.
Ahem! Actually I leave that to the compiler.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
char szData[] = "1006";
or
char szData[AnySizeGreater4] = "1006";
|
|
|
|
|
Good one.
Simple and nice.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi ,
I have created an Application in which I am showing a dialog box on a button click. The window is getting populated but it is not focused when it gets populated. The parant window which was in focus after populating this dialog box ..still focused..
Which property should i set so that my newly populated window will get focused.
|
|
|
|
|
How are you showing the dialog box?
Is it modeless, model or system modal?
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
«_Superman_» wrote: Is it modeless, model or system modal
I need this dialog a Modal dialog box.
I have set the System Modal property to FALSE.
|
|
|
|
|
If using MFC, call the DoModal method, otherwise call the DialogBox macro.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Still my dialog window is not Modal..
I have done this :
m_HPCRWODlg.Create(this->m_hWnd);
m_HPCRWODlg.DoModal();
Please help..
|
|
|
|
|
why do you have to use create function?
just give this
m_HPCRWODlg.DoModal();
in your button. It should work.
|
|
|
|
|
Hi,
Based on the value 'SELECTED' I am trying to do some statements.
The following code doesnt work for the two values of 'SELECTED'.
typedef enum{
APPLE =0,
ORANGE =1
}FRUITS;
#define SELECTED APPLE
#if SELECTED == 1
AfxMessageBox("orange");
#else
AfxMessageBox("apple");
#endif
Kindly help.
Priya Sundar
modified on Tuesday, May 19, 2009 6:04 AM
|
|
|
|
|
#if is a pre-processor directive processed by the preprocessor and enum and AfxMessageBox are handled by the compiler. You cannot mix them this way. What is it that you're trying to do here?
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
«_Superman_» wrote: You cannot mix them this way.
Tell me one thing if I replace enum with #define and instead of AfxMessageBox, I define varA, then it compiles.
#define APPLE 0
#define ORANGE 1
#define SELECTED APPLE
#if SELECTED == 1
int varA = 100;
#else
int varA = 101;
#endif
Replacing enum with #define is fine but isn't the definition of varA also handled by compiler only?
I mean why int varA = 101; is ok and AfxMessageBox not?
|
|
|
|
|
I bet you have put that globally. I mean outside of all functions.
You cannot call a function globally unless you are assigning to a variable.
Try this.
#if SELECTED == 1
int varA = AfxMessageBox(L"Selected");
#else
int varA = AfxMessageBox(L"Not Selected");
#endif
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Yeah! u r correct!
But why so?
I mean why is it ok if I assign it to an int and not otherwise?
|
|
|
|
|
It isn't about a function call actually.
It is about initializing a global variable even if it means calling a function to do it.
So we can use that trick to execute a function even before the entry point of a program.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
|
#define APPLE 0
#define ORANGE 1
int varA = 0;
#define APPLE_DEFINED
#ifdef APPLE_DEFINED
varA = 100;
#else if ORANGE_DEFINED
varA = 101;
#else if PAPAYA_DEFINED
varA = 102;
#endif //APPLE_DEFINED
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Priya_Sundar wrote: #define SELECTED APPLE
As you've heard you can't do that. In the above line APPLE is not defined so SELECTED remains undefined so you always get
Priya_Sundar wrote: AfxMessageBox("apple");
You can only use
#define APPLE 0
#define ORANGE 1
|
|
|
|
|
Thanks All...
by defining it as 0 and 1 its resolved.
Priya Sundar
|
|
|
|
|
sir/madam,
i want to set a image as background for toolbar base on dialog,but i do not know to do it,i know do it on view/Frame,because i do not know execute OnPaint function in CToolbar base on dialog,i need your help,thanks.
|
|
|
|
|
Bitmap ToolBar[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
thank your answer,,i had got the demo,but it implement on view/fram,,i need implement it base dialog,,i search much,,but did not get needing answer.
|
|
|
|
|
Is your problem for displaying the toolbar on the dialog or you have already done it and then problem is with the display of the image on the toolbar?
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
i have already shown toolbar on dialog,now my problem is how to display background image for the toolbar.
|
|
|
|
|
hi
i want to develop a MFC application to control my system volume and mike(line-in) settings.Kindly help me.
thanx in advance.
|
|
|
|