|
KnaveR wrote:
return DefWindowProc(hwnd, uMsg, wParam, lParam);
Shouldn't this be return DefDlgProc(hwnd, uMsg, wParam, lParam); instead?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
DefDlgProc will cause infinite recursion if i use it
|
|
|
|
|
Given this note in MSDN in relation to possessing a DialogProc:
You should use the dialog box procedure only if you use the dialog box class for the dialog box. This is the default class and is used when no explicit class is specified in the dialog box template. Although the dialog box procedure is similar to a window procedure, it must not call the DefWindowProc function to process unwanted messages. Unwanted messages are processed internally by the dialog box window procedure.
Have you just tried returning FALSE instead of other processing, as per this note:
Typically, the dialog box procedure should return TRUE if it processed the message, and FALSE if it did not. If the dialog box procedure returns FALSE, the dialog manager performs the default dialog operation in response to the message.
Maybe with the improved handler (using the IsDialogMessage) you don't need to call DefWindowProc.
Also, there is this note:
If the dialog box procedure processes a message that requires a specific return value, the dialog box procedure should set the desired return value by calling SetWindowLong(hwndDlg, DWL_MSGRESULT, lResult) immediately before returning TRUE. Note that you must call SetWindowLong immediately before returning TRUE; doing so earlier may result in the DWL_MSGRESULT value being overwritten by a nested dialog box message.
|
|
|
|
|
You are Da Man!!! A million thnx!!!
Have you just tried returning FALSE instead of other processing, as per this note... Maybe with the improved handler (using the IsDialogMessage) you don't need to call DefWindowProc.
Originally I was returning FALSE, but was not using IsDialogMessage. Hope that this helps someone in the future.
|
|
|
|
|
Dear group,
I am using the IHTMLCurrentStyle class (Visual C++) from the IE's API to get the colour of elements on webpages. I am using the method: HRESULT IHTMLCurrentStyle::get_color(VARIANT *p);
It works perfectly fine. As you might know i would need to do hexadecimal to RGB conversion. but the problem is that people sometimes encode colour as names instead of hexadecimal representation (red instead of #ff0000).
This makes life harder for me because i will need to convert colours from actual names to hexadecimal representations then to RGB format
Does anyone know any method which directly extracts colours in RGB formats ? or at least have any idea on how to perform this efficiently ?
Any ideas are welcomed
llp00na
|
|
|
|
|
|
Thanx for the reply Chris
I am afraid that doesn help alot, because i would need to perform some operations on the colours i extract.
therefore, i need the colours in RBG format, not in hex or string name formats.
llp00na
|
|
|
|
|
|
I understand what you suggested, but the problem is that web builders do not always use (names) to refer to colours. they most of times use hex format, normal formats such as #ffffff would be easy to convert to RGB representation. however, I have encountered some special cases where designers use #fff to refer to #0f0f0f !!!
llp00na
|
|
|
|
|
llp00na wrote:
I have encountered some special cases where designers use #fff to refer to #0f0f0f !!!
But did it work, or did it just default to black? When HTML encounters an invalid color, does it approximate or fail over to some color that's known to exist?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
llp00na wrote:
however, I have encountered some special cases where designers use #fff to refer to #0f0f0f !!!
But did it work, or did it appear to work because the browser either approximated a color, or just failed over to a color that's known to exist?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hii all
i am getting a single error when i complile my project
the error is::
c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
how to solve this error??????
thanks a lot
|
|
|
|
|
So are you including windows.h like the error indicates?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
no i am not including it(windows.h)!!!
sud i send u my whole project source code...i am buililding a database project using ado
i have included only comdef.h as an external header file....rest the mfc wizards add on its own which it does in every project
thats y i am not able to sort this error out??
please help
|
|
|
|
|
smartymanav wrote:
sud i send u my whole project source code
Not necessary. Right above the "fatal error C1189..." line in the Build window should be the name of a .cpp file. Look in that file for any irregularities.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
the name of the file is stdafx.h!!!
--------------------Configuration: Ado1 - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
Error executing cl.exe.
Ado1.exe - 1 error(s), 0 warning(s)
wat to do now...
i have only added one line to this file is:: #include <comdef.h>
please help and thanks
|
|
|
|
|
Ok, so you have a #include hierarchy like this:
stdafx.cpp
|
\---stdafx.h
|
----afxv_w32.h
|
\---comdef.h Is that right?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Is it possible to invoke the device manager programatically
and have it "scan for hardware changes"?
Steve
|
|
|
|
|
goiania wrote:
Is it possible to invoke the device manager programatically...
Sure, use:
ShellExecute(..., "open", "c:\winnt\system32\devmgmt.msc", ...); goiania wrote:
...and have it "scan for hardware changes"?
Don't know.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi,
I am using a CRichEditCtrl in an MFC application, it is being used for an output window. I now require to have a 'gutter' or margin area to the left of the rich edit control, on which i need to draw icons (one per line) in this gutter area. It needs to look similar to MS-developer studio editor where the grey area on the left shows an icon such as a bookmark.
<br />
e.g.<br />
|-------------------------------------<br />
| | My text is here <br />
| | <br />
| | <- Left is a gutter area <br />
| | <br />
--------------------------------------<br />
Any idea on how to do this please? I have trawled the web and see lots of samples, but none that do this or similar.
Any help would be much appreciated. Thank you.
James
|
|
|
|
|
I can't seem to undock my CDialogBar. It creates the dialog bar, and docks it to the left side of my main frame, but I can't drag it away. I'm not quite sure what's wrong. Any ideas?
Here's my code:
<br />
class CDlgTree : public CDialogBar<br />
{<br />
DECLARE_DYNAMIC(CDlgTree)<br />
<br />
public:<br />
CDlgTree(CWnd* pParent = NULL);
virtual ~CDlgTree();<br />
<br />
enum { IDD = IDD_DLGTREEBAR };<br />
<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
<br />
<br />
if (!m_treeBar.Create(this, IDD_DLGTREEBAR, CBRS_ALIGN_RIGHT | CBRS_ALIGN_LEFT | CBRS_GRIPPER, AFX_IDW_CONTROLBAR_LAST - 1))<br />
{<br />
TRACE0("Failed to create TreeBar\n");<br />
return -1;<br />
}<br />
m_treeBar.SetWindowText("Components");<br />
m_treeBar.EnableDocking(CBRS_ALIGN_RIGHT | CBRS_ALIGN_LEFT);<br />
Thanks
|
|
|
|
|
NTense wrote:
class CDlgTree : public CDialogBar
Not sure if this is related to your problem or not, but it might be.
Check this MSDN article[^]
Note this:
While it is normal to derive your own dialog classes from CDialog, you do not typically derive your own class for a dialog bar. Dialog bars are extensions to a main window and any dialog-bar control-notification messages, such as BN_CLICKED or EN_CHANGE, will be sent to the parent of the dialog bar — the main window.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi folks please help me. I am trying to learn how to simulate direct keyboard coding using the work of Fred Bulback from
http://www.geekhideout.com/iodll.shtml
I created a win32 console application and tried out the following codes :
PortWordOut(0x64 , 0xd2) ;
PortWordOut(0x60,18);
cin >> ch ;
cout << "ch= " << ch ;
cin.ignore(2);
PortWordOut(0x64 , 0xd2) ;
PortWordOut(0x60,19);
cin.get(nh);
cout << "nh= " << nh ;
cin.ignore(1);
//cin.get(sh) ;
PortWordOut(0x64 , 0xd2) ;
PortWordOut(0x60,20);
cin.get(sh);
cout << "sh= " << sh ;
The result is this :
both
PortWordOut(0x60,19);
and
PortWordOut(0x60,20);
are not captured by nh and sh as they are supposed to be.When i run the codes through debug i noticed that both codes which
are 'r' and 't' are produced but on the debug screen so it implies that the 2 lines of code work but output are send to the
wrong place.Incidentally the first line PortWordOut(0x60,18) works very well.
Can anybody please help explain what I did wrong and how I can get the keyboard to generate all 3 chars to the console
screen.
Regards and thanks
|
|
|
|
|
hello every one,
i received this morning a mail that revealed to be a CPian in a high need of help (Mr Pazzuzu[^])... saddly, i cannot help him as i don't really understand his need... (maybe i don't have enough knowledge on the related topic).
As he had some difficulties to know where to ask his question (and as i didn't wnat him to mail me for that), i created a thread on my personal homepage to let him ask.
now, if anyone have any idea about this[^], i'd be very grateful not to answer on my homepage but here, on that current thread you're reading at the moment...
thank you so much...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Could you or Mr Pazzuzu post the code for ex03aView.cpp::OnDraw ?
Mr Pazzuzu wrote:
TemporaryDc is created locally in "ex03aView.cpp::OnDraw"
I suspect OnPrepareDC is not being called for TemporaryDc , but it's just a hunch
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|