|
Hi all,
I have disabled my grid lines of ListCtrl, so that it is not visible now.But I need to draw a border line(should be splitted line) between some items ie my listCtrl will looks like this
col1 col2 col3 col4 col5
itm1 itm2 | itm3 itm4 itm5
itm1 itm2 | itm3 itm4 itm5
itm1 itm2 | itm3 itm4 itm5
itm1 itm2 | itm3 itm4 itm5
itm1 itm2 | itm3 itm4 itm5
itm1 itm2 | itm3 itm4 itm5
And also I dont want to show the partition lies between the column heading
Can anybody tell a solution to this,
Thanks in Advance
George K JOlly
-- modified at 2:27 Thursday 24th August, 2006
|
|
|
|
|
I see two solutions:
1. Make an ownerdrawn control derived from the CListCtrl.
2. Use a grid control
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Hi Rage,
How can i make an ownerdrawn listcontrol,
Thanks
George K Jolly
|
|
|
|
|
|
Another one[^]
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
|
Another solution would be to use customdraw.
|
|
|
|
|
Hi,
Im getting BitMap file from my Pic folder ..if the pic folder is not in that drive i display the bitmap file from Resource file.This is requirement.Everythign is fine.When the Pic folder is not here it will pop up this message box when i click OK then it will display BMP file resource.
As per the coding it displays the BMP from resorce when i click OK,but the message box still exist in screen i continuosly press OK it does not go,then i have to press close icon in that box for 10 times then it goes off..whats the reason anything wrong in my code?
if(AfxMessageBox("Pic Folder is not there",MB_OK)==IDOK)
{
CDC dcImage;
if(!dcImage.CreateCompatibleDC(pDC))
return;
BITMAP bm;
CBitmap* pOldBitmap;
m_bitmap.GetBitmap(&bm);
pOldBitmap = dcImage.SelectObject(&m_bitmap);
pDC->BitBlt(350,100, bm.bmWidth, bm.bmHeight, &dcImage, 0, 0, SRCCOPY);
dcImage.SelectObject(pOldBitmap);
}
Anu
|
|
|
|
|
Probably, you written this code in OnPaint or similar function. Invoking message box cause it to call again(WM_PAINT)(it invalidates that area), and its going in endless loop.
Avoid calling messagebox there.
|
|
|
|
|
Yes, Im doing this in OnDraw().Ok Thank u.
Anu
|
|
|
|
|
More in general, avoid user interactions and whatever action that may be destructive respect to the drawing ... while drawing.
The good practice is to handle all user "options" with commands altering the "state" of the application (some member variables), and make OnDraw / OnPaint to already know everiting about their drawing.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
hi,
Inorder to not write the Code in OnPaint(...) function which is repetative you can Write your own member Function.
in order to get the Device Context like on Paint(...) member function,
Use CDC* ptr = ::GetDC(...) // In your Member function,
OnPaint(...) is Repetative.
this will propably solve the Problem.
Good Luck.
Uday kiran
|
|
|
|
|
How can we Find Resource Variables in a Project ?
Are All variables in ResourceFile becomes Resource Variables ?
Regarding This any help please .
|
|
|
|
|
Krishnatv wrote: How can we Find Resource Variables in a Project ?
What do you mean by this ? Is it resource Id's.
|
|
|
|
|
|
Hi
I am working with serialization.The data is getting stored.But the data is not getting loaded.What might be the possible reasons?
Following is my code.
if(ar.IsStoring())
ar<<getmyname();
else
="" {
="" if(version="">=1)
{
CString name;
ar>>name;
SetMyName(name);
}
}
}
}
Sandhya
|
|
|
|
|
I hope you have followed steps, mentioned here.
can you show its class declaration ?
|
|
|
|
|
do your serialized class inherits from CObject ?
also, does your class definition provides a DECLARE_SERIAL , and do you provide a IMPLEMENT_SERIAL in your implementation file ?
|
|
|
|
|
SandhyaSri wrote: But the data is not getting loaded.What might be the possible reasons?
Have you set a breakpoint on the if(version>=1) statement and single-stepped from there?
"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
|
|
|
|
|
Hey,
I just found this article http://www.codeproject.com/csharp/automate_word.asp
Its a great article and I follwed it and succesfully built my program in visual c# .net.
But now I would like to build the same program in visual c++.net, however I get stuck on the first step, adding the microsoft word COM object. I have tried every way to get the reference window open but cant do it.
Am i doing something wrong?
Cheers.
|
|
|
|
|
If you want to insert word activex in to a dialog right click on the dialog and select insert Activex control . Or u can try by using the CLSID of the com object . Both will work.
regards
krishnan
If u can Dream... U can do it
|
|
|
|
|
What problem you are facing ? If you are using CLR, then it is same way, as added in C# application. In case of MFC, you cannot add MS Word COM object, you can import its type library in you application and use it.
This may give you some idea.
|
|
|
|
|
Ok,
yes I am using mfc.
Can you recommend any good articles on importing its type library in the application?
Once i import it, can i then code pretty much the same as as explained in the tutorial i followed in my original post? ie. will i be able to use myWordDoc.SaveAs" for example? Or will it be completely different because im not using the com object?
Thanks very much for you help.
|
|
|
|
|
tmoney101 wrote: Can you recommend any good articles on importing its type library in the application?
I've not read article , you mentioned.
But you can see this article and ofcourse this article.
It shows how it can be used
|
|
|
|
|
Hi ,
I need to read the active font in the present forground window, which i trying
to do with the below sample code. But every time i execute the "GetTextFace" i get the
Font Name as "System ". I kept the foreground window as the "note pad" and if this
program is executed i always get the Font name as "system".
{
HFONT m_font;
int buf_size = 10000;
char* m_gbuf = new char [buf_size];
MAT2 m_mat2;
unsigned char chr= 'L';
int total_size ;
int divider =0;
RECT MsgRect;
memset(&m_mat2, 0, sizeof(m_mat2));
m_mat2.eM11.value = 1;
m_mat2.eM22.value = 1;
TEXTMETRIC *lptm = new TEXTMETRIC;
LOGFONT *lplf = new LOGFONT;
hwnd = GetForegroundWindow();
m_dc = GetDC(hwnd);
GetTextFace(m_dc, buf_size, m_gbuf);
printf(" %s \n ",m_gbuf);
GetTextMetrics( m_dc, lptm);
lplf->lfCharSet = ANSI_CHARSET;
strncpy(lplf->lfFaceName, m_gbuf, sizeof(m_gbuf));
lplf->lfHeight = lptm->tmHeight;
lplf->lfItalic = lptm->tmItalic;
lplf->lfUnderline = lptm->tmUnderlined;
lplf->lfStrikeOut = lptm->tmStruckOut;
lplf->lfPitchAndFamily = lptm->tmPitchAndFamily;
lplf->lfWeight = lptm->tmWeight;
lplf->lfWidth = lptm->tmAveCharWidth;
lplf->lfClipPrecision =0;
lplf->lfEscapement = 0;
lplf->lfOrientation = 0;
lplf->lfQuality = 0;
lplf->lfOutPrecision = 0;
m_font = CreateFontIndirect(lplf);
if(m_font == NULL)
printf("failed ");
SelectObject(m_dc, m_font);
GLYPHMETRICS gm;
chr= '1';
total_size = GetGlyphOutline(m_dc, chr, GGO_GRAY2_BITMAP, &gm, buf_size, (void*)m_gbuf, &m_mat2);
}
Can anyone please help, to capture the Font that is active in a Specified Window if we know the handle of that window.
I dont know much abt fonts and i am sure that i am terribly missing something, please help.
Thanks in Advance..
|
|
|
|