|
zareee wrote: i have a static text control in a dialog box ,how to find the dimensions of the static text.
for adding Variable to static control you have to Change It's Special ID IDC_STATIC to something else, after changing id of static control from properties window.. follow advice from White Sky
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I am working on one CAD application. Application is developed in MFC with document view architeture. In my application there are different views of same geometry object. Views are like FRONT, BACK, TOP etc. Now I want to print all view on same page. In this case TOP view should be in center and all other views should be on different side of TOP view. Is this possible in MFC and if yes then how?
Thanks & Regards,
Kalpesh
|
|
|
|
|
Hi everybody,
in a CFormView i like to catch the CTRL and Down-Key if i'm at the Grid...
Exists a special key-code for this combination? So that i can catch it over the KeyDown-Event ?
Or only over Accelerators ( But Accelerators working with the MainFrame )
Thanks
|
|
|
|
|
baerten wrote: in a CFormView i like to catch the CTRL and Down-Key if i'm at the Grid...
Overriding PreTranslateMessage should help.
|
|
|
|
|
thanks
yes i did it already for the ENTER Key...
But in the CTRL + DOWN case i must test if two keys were pressed
Must i store the first key in a variable ( activate by on KeyDown, release on KeyUp )
and test so the second key
Or exists a special keycode for double-pressed keys ?
|
|
|
|
|
In OnKeyDown (no, thats not the handler for the Down-key pressed )
you could check for any key-combination like this:
if (Key==VK_DOWN && GetKeyState(VK_CONTROL))
Or, you would check it in PreTranslateMessages:
BOOL CSomeFormView::PreTranslateMessage( MSG* pMsg)
{
if ( WM_KEYDOWN == pMsg->message )
{
switch (pMsg->wParam)
{
case VK_UP:
{
if( GetKeyState(VK_CONTROL))
{
OnUp();
}
break;
}
case VK_DOWN:
{
OnDown();
break;
}
case VK_SPACE:
{
OnStop();
break;
}
}
}
return CFormView::PreTranslateMessage(pMsg);
}
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
if (Key==VK_DOWN && GetKeyState(VK_CONTROL))
works perfectly
Big thanks !!
bzw DANKE
|
|
|
|
|
Hello,
is there any way to set an tabitem inactive,disabled?
Mean, whenn i start my program, the tabitems(2-5) should be disabled?!
Thank you for help.
break;
|
|
|
|
|
|
Hello WhiteSky,
have an example for me with CDialog?
regards
break;
|
|
|
|
|
Did you search on codeproject?I think I saw an example and I think its on WTL
|
|
|
|
|
break; wrote:
Hello,
is there any way to set an tabitem inactive,disabled?
Means , user can't click on tab control or all controls on should be disabled
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Right, that is what i want, but is not easy!!
regards
break;
|
|
|
|
|
break; wrote: Right, that is what i want, but is not easy!!
i still couldn't know what do you want!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
sometimes ar items from an tab control inactive, mean, you can't select this tabitem!
My problem is that i have to solve the same problem, to set some items on an tabcontrol inactive!
So user can't select them!
Example:
CTabCtrl-> have 5 tabitems, 1-3 are active 4-5 are not active until the program has finish them work!
Now understand what i mean, is just like previous post from WhiteSky, but i can't to use it?!
regards
break;
|
|
|
|
|
He want to disables one item on TabCtrl
|
|
|
|
|
jup!
thats right , your example is in wtl project, i cant use it in my mfc project with dialog!?
bye
break;
|
|
|
|
|
Did you see on example (I think)its convert to WTL and author says wheres orginal program
|
|
|
|
|
Hi,
Is it possible to create the service with log on as "this account" and SERVICE_INTERACTIVE_PROCESS
Noel
|
|
|
|
|
I created a service with "SERVICE_INTERACTIVE_PROCESS". If i run the service i got the icon on the system tray.
Is it possible to get the icon on the system tray without using the "SERVICE_INTERACTIVE_PROCESS". If so how?
Thanks in advance.
Noel
|
|
|
|
|
noeleon wrote: Is it possible to get the icon on the system tray without using the "SERVICE_INTERACTIVE_PROCESS". If so how?
Yes.
Check out Shell_NotifyIcon(NIM_ADD...)
|
|
|
|
|
noeleon wrote: I created a service with "SERVICE_INTERACTIVE_PROCESS". If i run the service i got the icon on the system tray.
Is it possible to get the icon on the system tray without using the "SERVICE_INTERACTIVE_PROCESS". If so how?
Thanks in advance.
you have to fill NOTIFYICONDATA struct for that or have a look at this article; http://www.codeproject.com/shell/CTrayIcon.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Here is the code snippet:
IMalloc* pMalloc;
SHGetMalloc(&pMalloc);
HIMAGELIST hSysImageList = NULL;
LPITEMIDLIST pidl = NULL;
SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl);
SHFILEINFO sfi;
ZeroMemory(&sfi, sizeof(SHFILEINFO));
hSysImageList = (HIMAGELIST) SHGetFileInfo((LPCTSTR)pidl, 0,
&sfi, sizeof(SHFILEINFO), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
pMalloc->Free(pidl);
if(!pMalloc)
pMalloc->Release();
//Images for the CoolCool Folders....
CImageList* pImgList = CImageList::FromHandle(hSysImageList);
m_nImgListCnt = pImgList->GetImageCount();
CBitmap clBitmap;
clBitmap.LoadBitmap(IDB_FOLD_REG);
pImgList->Add(&clBitmap,RGB(255,0,255)); //FAILS HERE
clBitmap.DeleteObject();
The application crashes when we are trying to add our own icons to the system image list in Vista.
How to get around this issue????
Thanks
Indrajit
|
|
|
|
|
What exactly does "fail" and "crash" mean? Have you stepped into the Add() method with the debugger?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I got a linking problem. I think it has something to do with MFC and such but I`m not sure.. The problem is as follows:
I made a .dll file and in it is a class derived from CDialog, something like:
#ifdef __DLL_BUILD__<br />
#define LD_DECSPEC __declspec(dllexport)<br />
#else<br />
#define LD_DECSPEC __declspec(dllimport)<br />
#endif<br />
<br />
class LD_DECSPEC CDllDialog : public CDialog<br />
{<br />
public:<br />
CDllDialog( CWnd* pParent = NULL ); <br />
CDllDialog( UINT nIDD, CWnd* pParent = NULL ); <br />
virtual ~CDllDialog();<br />
<br />
<br />
enum{ ID_DLG_LOGOUT = 200 };<br />
<br />
public:<br />
virtual BOOL PreTranslateMessage( MSG* pMsg );<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
<br />
protected:<br />
<br />
virtual BOOL OnInitDialog();<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
In another project I want to derive another dialog from that dialog like:
class CDLG_AppSelect : public CDllDialog <br />
{<br />
public:<br />
CDLG_AppSelect(CWnd* pParent = NULL);<br />
enum { IDD = IDD_LOGINAPP_DIALOG };<br />
<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
<br />
<br />
protected:<br />
CLD_Button m_btnCancel;<br />
CLD_Static m_statDlgTitle;<br />
void CreateControls();<br />
<br />
virtual BOOL OnInitDialog();<br />
afx_msg virtual int OnPressCancel();<br />
afx_msg virtual int OnStartApplication();<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
The error I got is:
DLG_AppSelect.obj : error LNK2019: unresolved external symbol "protected: static struct AFX_MSGMAP const CDllDialog::messageMap" (?messageMap@CDllDialog@@1UAFX_MSGMAP@@B) referenced in function "protected: static struct AFX_MSGMAP const * __cdecl C
DLG_AppSelect::_GetBaseMessageMap(void)" (?_GetBaseMessageMap@CDLG_AppSelect@@KAPBUAFX_MSGMAP@@XZ)
So it looks it has something to do with the DECLARE_MESSAGE_MAP macro or something... Does anyone know how to solve this problem?
Thanks for any info you can provide
Davy
|
|
|
|