|
So long as you aren't writing for Windows 95 or NT 4.0, and have a Platform SDK installed. Otherwise you'll have to draw the gradient yourself ( no big deal ).
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Can anyone tell me how I can create a Modeless Dialogbox inside an MDI Window. If I create a dialog as modeless, using the Create function, and set the parent to the MainFrame MDI window, the dialog appears non-focused, as if it is disabled but you can still do everything with it.
I found the solution once before, but can't recall it
Any help will be appreciated...
|
|
|
|
|
Dear Sir/Madam,
Can I have a way to convert the view class in MFC Exe project into a DLL
to be used by other program? Since many functions are include in my View
class, it's not so easy to extract them as independent ones. So I am
wondering if I can make the whole view class as a DLL and use it in other
project. Thank you for your any suggestion.
Best regards,
C. Lei
|
|
|
|
|
Yes it is possible to export the view class.
You can export classes from an MFC Extension
DLL, but u got to be sure that it does not
have any dependencies, like using the data
from the document object. If any dependencies
are there then include those classes also.
|
|
|
|
|
Help!
I'm using the Rich Edit control (version3 on win2k) and
I'm trying to code
up a 'Page View' option for an editor I'm writing, the sort of
thing that'll Zoom up/down the text view by a percetage or to
the whole page or page width - you know the sort of thing.
I've got the zooming up working through the new EM_SETZOOM message
and appropriately selected ratio values for nNum and nDenom
but I can't get the zoom down to work, which is vital for the page view.
Has anyone been able to do this?
Are there any other cunning ways to do this?
|
|
|
|
|
|
add this line after the "includes"
#pragma comment(lib,"ddraw.lib")
regards
|
|
|
|
|
|
gern geschehen
|
|
|
|
|
You need to add the .lib library of Direct Draw in the settings of yor project, do ALT+F7, or prject/settings in the menu of vc++, select the link tab, and add the library. Y don't have the MSDN here, but i think that is ddraw.lib
Cheers....
Carlos Antollini.
|
|
|
|
|
- Please take a look at the two macros:
#define DEBUG(x) cout<<#x"="<
|
|
|
|
|
# and ## are preprocessor commands. #x results in the substitution "x" while x##y results in xy .
DEBUG(var) becomes cout<<"var""="<<var<<endl;
FIELD(MyField) becomes char* MyField_string; int MyField_size
And if you're wondering what happens to "var" "=" , the preprocessor concatentates adjacent string literals, so that becomes "var=" .
--Mike--
http://home.inreach.com/mdunn/
"....." -- Silent Bob
your with and
|
|
|
|
|
Thanks Mike pal!
- I still have a question. Do you mean x##y results in a single identifier?
- Can you help?
- Have a nice day?
Thanks,
Maer
|
|
|
|
|
|
I have two dialogs.
I the main dialog which is shown when the app is starting, I write this in the OnInitDialog():
CSecondDialog dlg; // this is the other dialog!
dlg.m_checkbox.SetCheck(1); // m_checkbox is a simple Check Box control, I puted it on the dialog with drag-and-drop
The program crashes and the debuger shows this
_AFXWIN_INLINE void CButton::SetCheck(int nCheck)
{ ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, BM_SETCHECK, nCheck, 0); }
Is there any options for the Check box that isn't avaible?
or....
|
|
|
|
|
It is failing because the checkbox hasn't been created yet, the check box won't be created until the InitDialog function of CSecondDialog has been completed.
The easiest solution would be to create a BOOL flag for the checkbox, set that and then inside the CSecondDialog::InitDialog do the SetCheck code. Either that or use the built in DDX functionality of CDialog.
Michael
|
|
|
|
|
Well , I successed to create my first ATL and it is works.
But the problem that remains is that I dont success to use full at the controls of the ATL Dialog. [ATL object][Miscellaneous][Dialog]
the code line's :
--------------------------------------------
CEdit* pText = (CEdit*)GetDlgItem(IDC_EDIT1);
pText->SetWindowText("Hello! ");
pText->UpdateWindow();
-------------------------------------------
or:
--------------------------------------------
CStatic* image = (CStatic*)GetDlgItem(IDC_PICTURE);
image->......
.....
----------------------------------------
cause to crush the program in run time.
How can I use at the controls correctly ?
|
|
|
|
|
Where is this code being called from, is it before or after the InitDialog. Also what error message are you getting?
Off the top of my head, I thought the GetDlgItem returned a HWND so you can't cast it to a CEdit.
In my ATL/WTL dialogs I do the following,
declare a CEdit variable in the dialog class
CEdit m_editDest
and then in my InitDialog
m_editDest = GetDlgItem(IDC_NUMBER);
m_editDest.LimitText(64);
Michael
|
|
|
|
|
GetDlgItem returns CWnd* , so the code that mimi writed is correct.
apparently there are another problem.
|
|
|
|
|
CWnd::GetDlgItem returns a CWnd*, but ::GetDlgItem returns a HWND. CWindow::GetDlgItem ( the ATL function ) returns a HWND also.
As the code mimi provides does not call GetDlgItem in the scope of an instance of CWnd, unless it is inside an MFC CWnd derived class, Michael is correct.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
If mimi is using an ATL Wizard created dialog, then CWnd doesn't exist. The only GetDlgItem in the Atl DialogImpl class is the one which returns the HWND. Although looking at the answers further down it looks like he isn't using ATL correctly.
Michael
|
|
|
|
|
Thank you !
1. This my code called from OnOk func of CDialog.
2. The project pass compilation without errors or warnings But in run time when the program arrive to this lines I gets message error that performed illegal action and the program will close.
|
|
|
|
|
In your question you say that you are using an ATL generated Dialog class, but CDialog is an MFC class. Can you post the class defintion so that I can see which kind of framework you are using as I'm getting confused.
Michael
|
|
|
|
|
not CDialog .
But your suggestion cause error at compilation:
It is not returns CEdit
|
|
|
|
|
My fault too. I only gave you half a story. ATL doesn't support CEdit natively. There are two ways you can get a CEdit control in an ATL dialog. The easiest way is to use the WTL headers that come with the platform sdk or secondly you can read the following knowledge base item http://support.microsoft.com/support/kb/articles/Q223/4/39.ASP
Michael
|
|
|
|