|
|
|
int LoadString( HINSTANCE hInstance,
UINT uID,
LPTSTR lpBuffer,
int nBufferMax
);
Unfortunately, I couldn't understand first parameter of this function. Can you explain this parameter?
|
|
|
|
|
int LoadString( HINSTANCE hInstance,
UINT uID,
LPTSTR lpBuffer,
int nBufferMax
);
Unfortunately, I couldn't understand first parameter of this function. Can you explain?
|
|
|
|
|
If the StringTable is in the same application then you can pass NULL as first parameter
|
|
|
|
|
"error C3861: 'LoadString': identifier not found, even with argument-dependent lookup"
Can you tell me that what is the reason of this error? All the parameter of this functon are correct as given below.
TCHAR sz[160];
LoadString(NULL,IDYES,sz,sizeof(sz));
|
|
|
|
|
check by incuding "windows.h"
|
|
|
|
|
mehmetned wrote: How can I use this methods or functions? (LoadStrıng or LoadResource)
See here.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
First of all i'm working in a MDI evironment
I want to create a CDialog that would kind off stay on the background of all other windows so i've placed it in the MainFrm Object:
VERIFY(pMainFrame->m_InitialDlg.Create(CInitialDlg::IDD, pMainFrame));
VERIFY(pMainFrame->m_InitialDlg.SetWindowPos(&wndBottom, 0, 0, 0, 0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE));
The trouble is that m_InitialDlg stays on top of all the other Windows (the Doc/View/Frame ones) Any ideea how to fix this?
Is there a beter way of doing it that does not require the CDialog..?
-- modified at 5:01 Tuesday 11th July, 2006
|
|
|
|
|
eusto wrote: The trouble is that m_InitialDlg stays on top of all the other Windows (the Doc/View/Frame ones) Any ideea how to fix this?
Set the dialog's parent to NULL . Since the MDI frame is the parent hence it stays on top of it.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Tried it with null also it's still a modal window and hence it has top most style (as opposed to views)
|
|
|
|
|
eusto wrote: Tried it with null also it's still a modal window and hence it has top most style (as opposed to views)
How are you displaying it. Are you calling DoModal() or ShowWindow().
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
|
eusto wrote: ShowWindow
I am surprised. Then how is it being displayed as a modal dialog. Are you able to interact with the parent window.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
I'm able to interact with the parent window..in fact it's just as if it weren't there. I can push buttons and stuff on views behind it...It's just that it is drawn on top of all other modeless windows. It's quite odd..try it, you'll see. Just create a MDI project, add in a dialog, add a member to that dialog to your mainframe class and call:
VERIFY(pMainFrame->m_InitialDlg.Create(CInitialDlg::IDD, pMainFrame));
VERIFY(pMainFrame->m_InitialDlg.SetWindowPos(&wndBottom, 0, 0, 0, 0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE));
in OnCreate method of the MainFrame class
|
|
|
|
|
eusto wrote: VERIFY(pMainFrame->m_InitialDlg.SetWindowPos(&wndBottom, 0, 0, 0, 0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE));
What about simple ShowWindow() Is that of any use.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
It's actually the same thing. SetWindowPos gives more options. I guess i could play with showwindow(sw_show)/showwindow(sw_hide) depending wether or not there are open documents but that's not a nice thing.
|
|
|
|
|
eusto wrote: VERIFY(pMainFrame->m_InitialDlg.Create(CInitialDlg::IDD, pMainFrame ));
This is the problem I guess. You are setting the parent to pMainFrame . Hence it stays on top of the frame. Give NULL and it will go behind.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Ok, now my code looks like this:
VERIFY(pMainFrame->m_InitalDlg.Create(CInitialDlg::IDD, NULL));
pMainFrame->m_InitalDlg.ShowWindow(SW_SHOW);
It's still the same thing. Actually now i can't even press the buttons on m_InitialDlg.
This is the dialog's style:
DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | DS_CENTER | WS_CHILD
|
|
|
|
|
eusto wrote: | WS_CHILD
Why is WS_CHILD given for a dialog that you want to be popup. . Lol make it WS_POPUP .
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Thanks for your help man. It's still not working though . Have you done this? Are you sure it will eventually work this way?
|
|
|
|
|
Do i need to call repaint or something anywere? If i set style to popup, it becomes visible when the user presses a button in that area of the main frame( Even though another child window is opened)
|
|
|
|
|
eusto wrote: VERIFY(pMainFrame->m_InitialDlg.Create(CInitialDlg::IDD, pMainFrame ));
Instead of pMainFrame give m_InitialDialog.GetDesktopWindow().
i.e
VERIFY(pMainFrame->m_InitialDlg.Create(CInitialDlg::IDD, m_InitialDialog.GetDesktopWindow()));
I did a small sample and this worked...
static CAboutDlg dlg;
if( dlg.m_hWnd == NULL )
dlg.Create( IDD_ABOUTBOX,dlg.GetDesktopWindow());
dlg.ShowWindow(SW_SHOW);
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Thanks...I forgot about GetDesktopWindow() ..what was i thinking?
Thanks
|
|
|
|
|
Can't draw CString string with DrawString(GDI+)
CString str=_T("test string");
FontFamily fontFamily(L"Times New Roman");
Font font(&fontFamily, 24, FontStyleRegular, UnitPixel);
PointF pointF(30.0f, 10.0f);
SolidBrush solidBrush(Color(255, 0, 0, 255));
graphics.DrawString(str.GetBuffer(), -1, &font, pointF, &solidBrush);
|
|
|
|