|
|
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/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
Could you or Mr Pazzuzu post the code for ex03aView.cpp::OnDraw?
sure, here it is (pssst, there's no ex03aView.cpp fil e in the project ; i found this into pagesView.cpp) :
void CpagesView::OnDraw(CDC* pDC)
{
CpagesDoc* pDoc = GetDocument();
CSize sizeTotal;
sizeTotal.cx = 80;
sizeTotal.cy = 80;
CRect rect;
GetClientRect(&rect);
MemDc tempDC(pDC,&rect);
int pageWidth = 800;
int pageHeight = 800;
int pageGap = 5;
int pageNumber =3;
SIZE size;
size.cx = 1000;
size.cy = (pageHeight*3)+100;
tempDC->Rectangle(CRect(0,0,pageWidth,pageHeight));
tempDC->TextOut(0,pageGap,"This is the first line on the FirstPage");
sizeTotal.cx *= MulDiv(m_textMetrics.tmAveCharWidth, m_iZoomFactor, 100);
sizeTotal.cy *= MulDiv(m_textMetrics.tmHeight, m_iZoomFactor, 100);
SetScrollSizes(MM_TEXT, sizeTotal);
}
thanks for answering
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Ok. He's using a class named MemDc, which I suppose is the one doing the actual no-flicker work.
Anyway, I'd just point Mr. Pazzuzu to this post[^], which might be of help, and let him post something here if he needs more help.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
|
In the MSDN example, I can see in order to ensure only one thread access a resouce, we use:
CSingleLock singleLock(&m_CritSection);
singleLock.Lock();
// resource locked
//.usage of shared resource...
singleLock.Unlock();
However, since CCriticalSection (inheritance from CSyncObject) already have a Lock method memeber, cannt we just do?
m_CritSection.Lock();
// resource locked
//.usage of shared resource...
m_CritSection.Unlock();
Thanks!
|
|
|
|
|
A critical section is a nice way to control access to a section of code, not really a resource. (Unless, all access to that resources is only in that section of code)
A lock is a nice way to control accesses to an object/resource though different code paths and shared data.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
CCriticalSections are usually (not always) class members or global objects that never go out of scope. So if you use CCriticalSection::Lock() you have to remember to call CCriticalSection::Unlock(). This can be tricky to implement if you code can take many divergent paths inside the lock. Using CSingleLock makes this much easier as you would normally declare the CSingleLock inside a function or loop or some other small bit of code where it goes out of scope and is destroyed when no longer needed. CSingleLock automatically unlocks the sync object from within its destructor, you do not have to explicitly call CSingleLock::Unlock().
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I am using .NET with and MFC application.
I have 2 List Boxes on my main dialog. I want to change the color of just one of them to a "pink" for error state. Here is what I have so far....., but it is changing the color of both list boxes to the color.
In the constructor of my main dialog...
m_pEditBkBrush = new CBrush(RGB(255, 200, 200));
HBRUSH CPPMLAnalyzerDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
/*HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
pDC->SetBkColor(RGB(10,100,100));
// TODO: Return a different brush if the default is not desired
return hbr;*/
switch (nCtlColor) {
case CTLCOLOR_LISTBOX:
pDC->SetBkColor(RGB(100, 100, 100));
return (HBRUSH)(m_pEditBkBrush->GetSafeHandle());
default:
return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
/*pDC->SetBkColor(RGB(100, 100, 100));
return (HBRUSH)(m_pEditBkBrush->GetSafeHandle());*/
}
}
As you can see, I am trying to set the background color and then return the CBrush from before.
Not sure what I am doing wrong.
Thanks,
Josh
|
|
|
|