|
:->
an advice : type with your nose, you'll be long faster !!!
|
|
|
|
|
toxcct wrote: an advice : type with your nose, you'll be long faster !!!
Regards,
Vijay.
God may not give us what we 'want', but he surely gives us what we 'need'.
|
|
|
|
|
|
I cant get the damn list box to change the ownerdraw property when i subclass it.
Part of the code :
CWnd * wnd = NULL;
while (wnd = FindWindowEx(this->m_hWnd,(wnd == NULL ? NULL : wnd->m_hWnd),"ListBox",NULL))
{
MyListBox * temp = new MyListBox();
temp->SubclassWindow(wnd->m_hWnd);
temp->ModifyStyle(0,LBS_OWNERDRAWFIXED);
TempControlAdd((CWnd*)temp);
temp = NULL;
} Thanks for the Help.
Artificial Intelligence is no match for Natural Stupidity
No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
I can't always be wrong ... or can I?
|
|
|
|
|
Hi there,
I think the LBS_OWNERDRAW* styles can be set only upon creation of the listbox control.
|
|
|
|
|
Thanks for the help.
Artificial Intelligence is no match for Natural Stupidity
No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
I can't always be wrong ... or can I?
|
|
|
|
|
If anybody need a solution here is one[^]
Artificial Intelligence is no match for Natural Stupidity
No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir
I can't always be wrong ... or can I?
|
|
|
|
|
Hi,
I created dll and trying to export a function which in turn calls InvokeHelper function,But my dll is created using win32 dynamic library it is not recognizing InvokeHelper,so i included the macros,
_AFX_NO_OCC_SUPPORT and AFX_CDECL.Now it is showing error as,
error C2061: syntax error : identifier 'CWnd'.What i have to do.Please help me...
Siddharth
|
|
|
|
|
Include afxwin.h , remove statement #include <windows.h> , if there is any.
siddharthsan wrote: _AFX_NO_OCC_SUPPORT and AFX_CDECL
I wonder, why you needed to use this?
|
|
|
|
|
If I include afxwin.h it showing the following error,
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
What i have to do...
Siddharth
|
|
|
|
|
Remove line #include <windows>, if there is any.
|
|
|
|
|
I removed windows.h from stdafx.h and included afxwin.h in my header file.Now it is not recognizing the InvokeHelper and it's parameters.Giving error as
error C2065: 'InvokeHelper' : undeclared identifier
error C2065: 'DISPATCH_METHOD' : undeclared identifier
error C2065: 'VT_EMPTY' : undeclared identifier
What would be the problem...
Siddahrth
|
|
|
|
|
How do you expect to use an OCC_SUPPORT method by using the _AFX_NO_OCC_SUPPORT macro to ommit
OCC support in the MFC code??
Get rid of that macro!
*EDIT* You probably shouldn't be messing with AFX_CDECL either unless you know what you're doing.
Look at the declaration for CWnd::InvokeHelper()...
#ifndef _AFX_NO_OCC_SUPPORT
COleControlSite* GetOleControlSite(UINT idControl) const;
void AFX_CDECL InvokeHelper(DISPID dwDispID, WORD wFlags,
...
See why it won't work with that macro?
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hi
When i use CDialogTemplate class in my application, then there is error occure as error C2065: 'CDialogTemplate' : undeclared identifier, so to use this class is there is need to include any Header file in code.
Regards
Atul M
|
|
|
|
|
Its declared in afxpriv.h . But why you needed to use this class ?
Refer this[^] link for more information.
|
|
|
|
|
Off the top of my head the answer would be YES! A template is just an outline of the code which the compiler needs to generate. That means that without the outline it can not generate it. Therefore it does not exist and can not exist until you provide the outline for it.
Bottom line: Include the header for any template that you wish to use.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hi,
In my application there is two window.
I have used PreTranslateMessage
In that i have written
bool nFlag = CDialog::PreTranslateMessage(pMsg);
if(pMsg->message==WM_KEYDOWN)
{
if(IsCTRLpressed() && IsALTpressed())
{
if(IsDpressed())
{
//delete code
}
}
}
It is wroking on 2000 pro. but in XP
it's not wroking can any one tell me WHY?
what is wrong with it?
Thanks,
Rushiraj
|
|
|
|
|
rushiraj.jhala wrote: if(IsCTRLpressed() && IsALTpressed())
How these function looks like ?
rushiraj.jhala wrote: it's not wroking can any one tell me WHY?
what is wrong with it?
What do you mean by not working ?
|
|
|
|
|
IsCTRLpressed() looks like
#define IsCTRLpressed() ( (GetKeyState(VK_CONTROL) & (1 << (sizeof(SHORT)*8-1))) != 0 )
#define IsALTpressed() ( (GetKeyState(VK_MENU) & (1 << (sizeof(SHORT)*8-1))) != 0 )
#define IsDpressed() ( (GetKeyState('D') & (1 << (sizeof(SHORT)*8-1))) != 0 )
and when I press CTRK+ALT+D I want to execute delete function.
now when I press CTRK+ALT+D
IsCTRLpressed returns true
IsALTpressedreturns true
but
IsDpressed returns false
bool nFlag = CDialog::PreTranslateMessage(pMsg);
if(pMsg->message==WM_KEYDOWN)
{
if(IsCTRLpressed() && IsALTpressed())
{
if(IsDpressed())
{
delete();
//delete code
}
}
}
Thanks,
Rushiraj
|
|
|
|
|
rushiraj.jhala wrote: #define IsCTRLpressed() ( (GetKeyState(VK_CONTROL) & (1 << (sizeof(SHORT)*8-1))) != 0 )
No need for this complex definition, simply
#define IsCtrlDown() ((GetKeyState(VK_CONTROL)<0)?TRUE:FALSE)
this will do.
rushiraj.jhala wrote: but
IsDpressed returns false
You are handling the WM_KEYDOWN in PreTranslateMessage, so no need for IsDPressed, check
pMsg->wparam == 'D'
This will work in all the versions
-- modified at 3:09 Friday 23rd March, 2007
Also you can change the definition global to all keys as below,
#define IsKeyDown(nKeyCode) ((GetKeyState(nKeyCode) < 0)?TRUE:FALSE))
and you can call this as,
IsKeyDown(VK_CONTROL);
IsKeyDown(VK_MENU);
Do your Duty and Don't expect the Result
Rate this Post, if I helped You
|
|
|
|
|
hi,
Thanks
But it is also not wroking,
I get
pMsg->wParam = 18.
Thanks,
Rushiraj
|
|
|
|
|
rushiraj.jhala wrote: pMsg->wParam = 18
How did you check yhis value? 18 is Alt(VK_MENU) key...
Use the below code segment,
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == 'D'))
{
if (IsKeyDown(VK_CONTROL) && IsKeyDown(VK_MENU))
{
/* Ctrl+Alt+D is pressed */
}
}
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
Jus try d below...
#define IsKeyDown(nKeyCode) ((GetKeyState(nKeyCode) & (1 << (sizeof(SHORT)*8-1))) != 0)
and in Pretranslate Message,
if (IsKeyDown(VK_MENU) && IsKeyDown(VK_CONTROL) && IsKeyDown('D')){
delete();
}
Selva
|
|
|
|
|
Thanks it is working.
Thanks,
Rushiraj
|
|
|
|
|
Dear friends,
Can we remove or Hide Menu bar from Form View??
I dont want Menu bar on form view b'coz i m using tab controls..
Please help me.. its very urgent for me.. I tried deeting every menu but then it is giving me an error as "cannot create empty document"...
Megha
Friend in need is a friend indeed
|
|
|
|