|
in the CDlgLogon class constructor, are you passing the dialog template ID to the CDlgBase class constructor so that it can pass it on to CDialog? I think not!
CDlgBase::CDlgBase (UINT IDD, CWnd* pParent)
: CDialog (IDD, pParent)
{
...
}
CDlgLogon::CDlgLogon(CWnd* pParent)
: CDlgBase(CDlgLogon::IDD, pParent)
{
...
}
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
yes.i does not.
and thanks a lot!
gucy
|
|
|
|
|
You are greate! This is commom error for beiginners
|
|
|
|
|
Hi,
In a dialog-based application, i have a menu, a toolbar and also in order to accelerate the process i make some keyboard functions by using PreTranslateMessage. I used the Keys from F2 to F12.
The keys worked just fine except for the F10.
I note that when the key F10 is pushied the menu also show push a little at the top-left menu title, but it don't implement my expected command.
Here is the PreTrans function i used.
BOOL CEfmraDlg::PreTranslateMessage(MSG* pMsg)
{
switch(pMsg->message)
{
if(pMsg->hwnd = m_ListBox.m_hWnd)
{
case WM_KEYDOWN:
{
switch((WORD)pMsg->wParam)
{
case 'n':
case 'N':
{
m_updown = 1;
m_spinValue.SetPos(m_spinValue.GetPos()+1);
return TRUE;
}
case 'p':
case 'P':
{
if(m_secNum <= 0)
return FALSE;
else{
m_updown = 0;
m_spinValue.SetPos(m_spinValue.GetPos()-1);
return TRUE;
}
}
case VK_F2:
{
OnEfmLamp();
return TRUE;
}
case VK_F3:
{
OnEfmRead();
return TRUE;
}
case VK_F4:
{
OnEfmAbort();
return TRUE;
}
case VK_F5:
{
OnTocInfoFile();
return TRUE;
}
case VK_F6:
{
OnTocInfoCD();
return TRUE;
}
case VK_F7:
{
OnEfmCode();
return TRUE;
}
case VK_F8:
{
OnBinaryCode();
return TRUE;
}
case VK_F9:
{
OnBlock();
return TRUE;
}
case VK_F10:
{
OnSubQ();
return TRUE;
}
case VK_F11:
{
OnSubCode();
return TRUE;
}
case VK_F12:
{
OnSubRW();
return TRUE;
}
default : break;
}
break;
}
}
}
return CResizableDialog::PreTranslateMessage(pMsg);
}
How to deal eith this?
Thanks in advance!
chen
|
|
|
|
|
I think you must try to handle a F10 key in WindowProc procedure instead PreTranslateMessage
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Try handling F10 Message in WM_SYSKEYDOWN.
Please refer MSDN WM_SYSKEYDOWN help.
Regards,
Uma Mahes
|
|
|
|
|
Hi,
Thanks a lot!
It worked by using WM_SYSKEYDOWN.
chen
|
|
|
|
|
In outlook, when you want to send a mail to more than one person.you can add the receiver's name to the edit box one by one. And when you want to remove a receiver,you can just select the receiver's name in the box and can delete the whole string insdead of delete the characters one by one.I think it is very cool because it can prevent the user from removing the reveiver by mistake.But how can i make a edit
box like this? thank you.
|
|
|
|
|
It's actually a rich edit control rather than a plain edit control.
|
|
|
|
|
I have a parent hWnd. When I EnumChildWindows I can GetWindowText on each child to find the caption. But how do I get the Class Name of the children while inside the EnumChildWindows callback?
|
|
|
|
|
GetClassName()
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Use ::GetClassName(hWnd, className, _MAX_PATH) win32 API to retrive
the name of the class.
Regards,
Uma Mahes
|
|
|
|
|
Is there a way to change the print page orientation to
landscape in a dialog mode, i e I'm not using Document-
View mode? To print I've previously used ShellExecute
method.
|
|
|
|
|
Look this code:
PRINTDLG pd;
pd.lStructSize=(DWORD)sizeof(PRINTDLG);
if(AfxGetApp()->GetPrinterDeviceDefaults(&pd))
{
DEVMODE FAR *lpDevMode=(DEVMODE FAR *)::GlobalLock(pd.hDevMode);
lpDevMode->dmOrientation = (short)(bLandscape) ? ORIENT_LANDSCAPE : DMORIENT_PORTRAIT);
pDC->ResetDC(lpDevMode);
::GlobalUnlock(pd.hDevMode);
}
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Thanks, but I get these five errors when compiling:
error C2065: 'bLandscape' : undeclared identifier
error C2065: 'ORIENT_LANDSCAPE' : undeclared identifier
error C2059: syntax error : ')'
error C2065: 'pDC' : undeclared identifier
error C2227: left of '->ResetDCA' must point to class/struct/union
Generating Code...
Error executing cl.exe.
It seems bLandscape does not exist. Where does that variable come from? I can also not find ORIENT_LANDSCAPE in MSDN.
|
|
|
|
|
I can't write a code for yours. Just it is a sample of the code and not realy code.
bLanscape is a variable which specified what you want orient. TRUE - LANSCAPE, FALSE - PORTRAIT.
DMORIENT_LANDSCAPE is constant for DEVMODE strucrure. Therefore, you must look in MSDN DEVMODE structure and not constants.
pDC is a pointer to your context of the printer.
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Thanks for your reply Eugene!
However, I'm sorry I still dont get it. I'm not using Document-View mode in which I think I know how to retreive the Device Context (pDC). I'm using Dialog mode. How can you acheive this?
I also noticed you converted bLandscape to short. Why? Isn't it only the value that's assignmed dmOrientation that needs to be short?!
Finally, does this alter the settings of my default printer straight away without showing any dialog, or what happens?
Thanks again,
Joachim
|
|
|
|
|
Hi
i will like to know how can i reflect the colour i selected from an image and have it reflected in a dialog box. I am thinking of filling up an edit box of the dialog box with the selected color on the image. Not sure how it can be done or is there another way i can go abt doing it. Please help. Not too good with programming
thanks
|
|
|
|
|
I am using visual C++ 6.0 to develop interface.
I put a listview ActiveX control on the dialog , set the property "gridlines" with TRUE and it shows the feature like Access.But what i want is that there are gridlines only on where there are data items. in other words,if there are 2 items in the listview control,there are 2 rows of gridlines in the listview control.
How can i realize that?
BTW where can i find help document about ActiveX contorl?
gucy
|
|
|
|
|
long time ago,I download the tabbed exploer source in this codeproject.
but I've lost it in accident.
now I am trying to find it.but where is the source?
can you help me to find it?
feature:
it is based on MFC,MDI
it is embedding the webbrowser control.
all browsed site page is located in a new tab window .
all popup page is also located in a new tab window .
please help me!
please
|
|
|
|
|
please, hwo can i jump a page in wizard 97 when a radio Button Is clicked.
please Help
|
|
|
|
|
Hi there,
I'm a COM newby, and I'm trying to figure out this event sink thing. The typelib I am trying to use has a coclass in it with two interfaces. One is a dispinterface derived from IDispatch, it also exposes an outgoing interface/connection point thing (derived from IUnknown) which exposes two methods. Now according to the documentation these methods will get called at the apropriate time and the parameters to the call will contain the data I need. So how on earth do I go about hooking into that outgoing interface getting some event notification??
Does anyone know? Thanks in advance....
*¨¨`)
¸¸.·´ ¸.·*¨¨`)
(¸¸.·* ¸ .·*
¸¸.·*
(¸¸.~~> Joel Holdsworth.
|
|
|
|
|
You have to implement a sink object on the client side. Do a search at CodeProject, CodeGuru, and Google for examples.
Kuphryn
|
|
|
|
|
I have been going through the book Modern C++ Design. Obviously, since it is using generic programming alot of doesn't work on VC6, but I was curious about the following error when working with Object Factory example..
I have a class defined as "Shape" and a method defined as :
Shape * CreateConcreteShape();
Now, I have a class, called ShapeFactory as following:
class ShapeFactory
{
public:
static ShapeFactory * Instance();
protected:
typedef Shape * (*CreateShapeCallback) ();
// Returns true if registeration was successful
typedef std::map <int, createshapecallback=""> CallbackMap;
ShapeFactory();
ShapeFactory(const ShapeFactory & );
ShapeFactory& operator=(const ShapeFactory&);
bool RegisterShape (int ShapeId, CreateShapeCallback CreateFn);
bool UnregisterShape(int ShapeId);
Shape * CreateShape(int ShapeId);
CallbackMap callbacks_;
private:
static ShapeFactory * m_pInstance;
~ShapeFactory(); // the destructor should not be called from outside
};
Now, I have a class Line that inherits from Shape and it contains the following:
class Line : public Shape
{
public:
Line();
virtual ~Line();
virtual Shape * CreateLine();
virtual void Draw() const;
virtual void Rotate(double angle);
virtual void Zoom (double zoomFactor) ;
private:
static ShapeFactory TheFactory;
};
When I try adding the CreateLine method of the Line class to the ObjectFactory as shown below, I get the following compile-time error:
Line::Line()
{
ShapeFactory * pShapeFactory = ShapeFactory::Instance();
if(pShapeFactory != 0)
pShapeFactory->RegisterShape(1, CreateLine());
}
Error:
error C2664: 'RegisterShape' : cannot convert parameter 2 from 'class Shape *' to 'class Shape *(__cdecl *)(void)'
There is no context in which this conversion is possible
How do I fix this problem?
thanks
|
|
|
|
|
Hold on - the second parameter of RegisterShape(1, CreateLine()); is defined as "CreateShapeCallback CreateFn", not Shape* so what is happening is the compiler is unable to convert from a pointer to Shape class returned by CreatLine() to a pointer to the actual function itself. Squarepeg -> round hole. So if you really do want to insert a pointer to the function CreateLine then you will need to remove the brackets from CreateLine in pShapeFactory->RegisterShape(1, CreateLine());, so instead of executing the fn you can just take it's pointer.
*¨¨`)
¸¸.·´ ¸.·*¨¨`)
(¸¸.·* ¸ .·*
¸¸.·*
(¸¸.~~> Joel Holdsworth.
|
|
|
|