|
probably custom control is the way to go, if you search here in cp you will find many good tutorial on how to dothat.
-Prakash
|
|
|
|
|
Do you know how to work with DC's
Get the dc of the dialog as
HDC hdc=::GetDC(m_hWnd);
and then use the line drawing functions to draw on the dialog through the DC
Once you are done with the dc release it.
Here's a sample code
HDC hdc=::GetDC(m_hWnd);
MoveToEx (hdc,0,0,NULL);
LineTo (hdc,100,100);
::ReleaseDC (m_hWnd,hdc);
-- modified at 7:42 Friday 18th August, 2006
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
In WM_PAINT you can use from dc for draw line
CPaintDC dc(this); dc.MoveTo dc.LineTo(...) Is your purpose?
|
|
|
|
|
About CView problem,thank
<<<<<<<<<preview.h>>>>>>>
class Preview : public CView
{
public:
virtual void OnDraw(CDC* pDC);
virtual BOOL OnPreparePrinting(CPrintInfo *pInfo);
void OnPrint(CDC *pDC, CPrintInfo* pInfo);
};
<<<<<<preview.cpp>>>>>>>>>
void Preview::OnDraw(CDC* /*pDC*/)
{
}
BOOL Preview::OnPreparePrinting(CPrintInfo* pInfo)
{
return DoPreparePrinting(pInfo);
}
void Preview::OnPrint(CDC *pDC, CPrintInfo* pInfo)
{
CString str=_T("rrr");
pDC->TextOut(0,30,str);
}
<<<<<<<<<<<dialog.cpp>>>>>>>>
Preview * p=new Preview();
p->GetDC()->TextOutW(1,2,_T("rxg"));
i think add char to p;
Debug no Error,but run Error
how to add char to TextOutW function in p
sorry,My English isn't good
thank
|
|
|
|
|
rxgmoral wrote: but run Error
Do you mean in Release ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
rxgmoral wrote: sorry,My English isn't good
English aside, what's the actual problem? What are you trying to do?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi
I wrote a regular dll based on MFC to use it in VB.but in VB at run time when i call the exported function from that dll.the error is comming as "Bad dll calling convention".i used __stdcall in the dll and also i mantained the .def file like
EXPORTS
MyFunction @1
I do not know what is wrong with this.Please help me.its urgent.
nirmal
|
|
|
|
|
Show the code of the function (declaration and definition) and the way you declare it in VB.
|
|
|
|
|
On XP this can be done by simply holding down the Shift key when opening a folder whose view is already set to thumbnails.
Is this possible in win2000 by using MFC?
Thanks in Advance.
Amar
|
|
|
|
|
Hi all,
Im using custom draw to change the color or the listctel item.
But i cant change the highlight color . how can i get it done.
thankx
regards
GAN
|
|
|
|
|
If you want to highlight a particular row, try this in your OnCustomdrawList function:
COLORREF crText, crBkgnd;
if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
{
if ( (pLVCD->nmcd.dwItemSpec % 3) == 2 )
{
LOGFONT lfFont;
CFont *pFont = GetFont();
_ASSERTE( pFont );
pFont -> GetLogFont( &lfFont );
CFont m_fBFont;
m_fBFont.CreateFontIndirect( &lfFont );
SelectObject(pLVCD->nmcd.hdc,m_fBFont);
crText = RGB(255,0,0);
crBkgnd = RGB(255,255,0);
pLVCD->clrText = crText;
pLVCD->clrTextBk = crBkgnd;
}
*pResult = CDRF_NEWFONT;
}
}
To color the background of a particular column, try this:
if ( (CDDS_ITEMPREPAINT | CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage )
{
COLORREF crText,crBkgnd;
if (0 == pLVCD->iSubItem)
{
crText = RGB(128,0,225);
crBkgnd = RGB(247,241,202);
}
else
if (1 == pLVCD->iSubItem)
{
crText = RGB(0,128,0);
crBkgnd = RGB(247,241,202);
}
pLVCD->clrText = crText;
pLVCD->clrTextBk = crBkgnd;
*pResult = CDRF_DODEFAULT;
}
Fortitudine Vincimus!
|
|
|
|
|
how to change the highlight color of listctrl
IM ASKING FOR CHANGING HIGHLIGHT COLOR OF THE LISTCTEL
-- modified at 8:13 Friday 18th August, 2006
|
|
|
|
|
GANsJob wrote: highlight color of listctrl
A list has many parts - headers, rows or items, columns or subitems.... The text color of each can be changed; the background color (or what you call "highlight" color of each individual part can be changed.
When you say, "Change the highlight colour of listctrl please specify which part of the listctrl you mean.
Fortitudine Vincimus!
|
|
|
|
|
When you say, "Change the highlight colour of listctrl please specify which part of the listctrl you mean.
Selected item's higlight color
|
|
|
|
|
|
|
Hi Everyone,
Visual Studio .Net 2002 with Service Pack 1
Windows XP Pro/Home with Service Pack 2
I have a multi threaded application (sometimes even up to 30 threads) and though that enabling Hyper Threading on my pc would obviously give an performance improvement, which is the case.
However, now (with HT enabled) I can still compile and program as normal, but I am experiencing severe instability problems. When the compiled application runs on another PC with HT enabled all seems fine, but when I run the application on a PC withouth HT, it crashes very frequently (usually withing 30 seconds) and very randomly.
If I disable HT on my development PC and recompile the application, it works fine on both HT enabled pc's and on pc's without HT. So the problem definately seems related to HT.
Are there compilation switches that I should enable/disable to fully support HT or multiple processors platforms ? Why does the HT compiled application crash on non-HT pc's ?
Thank you
Oliver
|
|
|
|
|
hello everyone.. how can we detect the connection breakdown (if there is any) while uploading files onto an FTP server? also, is there anyway that a programmer can increase the speed at which the files are uploaded on to the server?
vijay aroli
|
|
|
|
|
I had a dialog displayed at runtime in my Application and that contains textbox item in it.
I need to locate the text item in my project. My project contains several dialogs ( say 700).
How do I locate the textbox ( Window) in the design environment. Is there any easy method avaiable for that. I can able to get the details of that text item using spy++. But I donno how to fix the window in design mode.
Thanks in advance.
|
|
|
|
|
Sivaraman Dhamodaran wrote: My project contains several dialogs ( say 700).
Sivaraman Dhamodaran wrote: But I donno how to fix the window in design mo
Just to clarify: you hav an app holding lots of dialogs, one of them has a problem you want to fix, but you cannot find which it is.
-> 1. Stepdebug until you find it ?
-> 2. Are the dialog created using the resource editor, or arethey created dynamically at runtime ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Locate the control id using Spy++ then open up resource.h find the corresponding name with that ID
then find all instances of that name this will greatly narrow the search.
does this help
G_S
|
|
|
|
|
Thanks G_S.
I converted the control ID into Decimal ( Spy++ displays the CID in Hex.) and fixed the control..
Thanks a Lot.
|
|
|
|
|
how can i use this to work more faster ? :
int h = 0;
while(!pName->IsEOF())
{
int nItem = m_list2.InsertItem(h, pName->m_name);
m_list2.SetItemText(nItem, 1, pName->m_city);
m_list2.SetItemText(nItem, 2, pName->m_country);
pName->MoveNext();
h++;
}
pName->Close();
}
Bravoone
|
|
|
|
|
What is slow ? The filling of the list ctrl, or the reading of your data in the class pName is pointing at ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
filling of the CListCtrl !
Bravoone
|
|
|
|