|
can't handle the double click event on CListCtrl item
As I understand I should specify some list control's style..
but which of them?
|
|
|
|
|
|
NoName II wrote: can't handle the double click event on CListCtrl item
Why not? What code do you have in place for this? What are the symptoms? Be a tad more specific, please.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Hi all!
I want to write a program like Watchdog O Matic, but there are some difficult things because of the knowledge. I have some question in my mind but still not answer yet:
1. How to know/detect a application have error like : Access Violation, Runtime Library, MFC error to restart the application.
2. Where's document to solve above issue
If you known something please let me know...
Thanks for watching..
|
|
|
|
|
From yesterday to today, the declaration of _com_dispatch_method has vanished from my Dev PC, so #import statements for Dispatch itnerfaces don't work anymore. I still have comdef.h, which has all the others (e.g. _com_dispatch_propget) and a __c_com_dispatch_methoddecl, but nothing else can be found.
(Weird thing is: I just installed a soundcard driver and an InstallShield eval, , I can't think of anything else...)
[edit]With a sharp look, __c_com_dispatch_methoddecl can be transformed into __cdecl _com_dispatch_method . Now it's hard not to blame this on InstallShield [/edit]
Some of us walk the memory lane, others plummet into a rabbit hole
Tree<t> in C# || Fold With Us! || sighist
-- modified at 5:02 Thursday 4th May, 2006
|
|
|
|
|
hi all,
i am getting problem on QuerySibling(...) method of PropertyPage please tell me, i am writing QuerySibling(...) method in PropertyPage named two and sending some Data to PropertyPage three where i am collecting the Data. But in first time the Page is not able to Transfer the Data to ThirdPage.
here is the snippet of code.
second page:
------------------------------------------------------------------------------
BOOL two::OnSetActive()
{
CStringArray abc;
abc.RemoveAll();
abc.Add("1");
abc.Add("2");
abc.Add("3");
abc.Add("4");
abc.Add("5");
if(QuerySiblings(1,(LPARAM)&abc)){ //Sending Data to Third Page
CancelToClose();
}
return CPropertyPage::OnSetActive();
}
/-----------------------------------------------------------------------------
third Page:
LRESULT three::OnQuerySiblings( WPARAM wParam, LPARAM lParam )
{
switch(wParam)
{
case 1:
CStringArray* pString = (CStringArray*)lParam;
if(str1.GetSize() > 0) //Remove all the Map Values
str1.RemoveAll();
for(int i =0;i< pString->GetSize();i++)
str1.Add(pString->GetAt(i)); //Collecting Data from Page Two !!!
pString->RemoveAll();
break;
}
return Default();
}
/-----------------------------------------------------------------------------
for the first time i am not able see the Reflected Data in Page Three after traversal of page2 (two) to page3 (three) twice only i am getting the data.
but in MSDN he has given the only method to be change the data from one property page to another property page.
please let me know it is urgent!!!!!!!!!.
help me out.
uday.
uday kiran
|
|
|
|
|
hi all,
its just "PSP_PREMETURE" flag before the Property sheet is Shown. I got It.
uday.
uday kiran
|
|
|
|
|
I wanna save some value into the a txt type file.
for example, I save the value in *.txt file as follow,if the font is not matching, the columns/lines maybe become curve,sach as:
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
1>How can I set the text file display font in my code?
2>How can I get the exact single vaule that saved before?
|
|
|
|
|
zeus_master wrote: 2>How can I get the exact single vaule that saved before?
Use fprintf to write and fscanf to read.
Nibu thomas
Software Developer
|
|
|
|
|
I don't understand what you mean... If I pasted the lines you posted in a txt file and I open it with notepad, all columns are well aligned.
A file is just 'data' (binary or text) and it cannot contain font information (or the only way to do that is to have your own file format and your own program that will read the file).
|
|
|
|
|
please see my code below:
BYTE regdata[5][0x10][0x10];
BOOL CxxDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
BYTE h,i,j;
for (h=0x00;h<5;h++) {
for (i=0x00;i<0x10;i++) {
for (j=0x00;j<0x10;j++) {
regdata[h][i][j]=(BYTE)(i*0x10)+j;
}
}
}
return TRUE; // return TRUE unless you set the focus to a control
}
void CxxDlg::OnButtonSave()
{
// TODO: Add your control notification handler code here
CString buf;
CString buf1=" ";
BYTE h,i,j;
for (h=0x00;h<5;h++) {
buf1.Format("\r\n\r\nBank%x: \r\n-----",h);
buf +=buf1;
for (j=0x00;j<0x10;j++) {
buf1.Format("-%02X-",j);
buf +=buf1;
}
for (i=0x00;i<0x10;i++) {
buf1.Format("\r\n-%02X- ",i);
buf +=buf1;
for (j=0x00;j<0x10;j++) {
buf1.Format("%02X ",regdata[h][i][j]);
buf +=buf1;
}
}
}
CFileDialog fdlg(FALSE,"PJ",NULL,OFN_OVERWRITEPROMPT,
"text File(*.txt)|*.txt|map file(*.map)|*.map|All files(*.*)|*.*||",this);
fdlg.m_ofn.lpstrTitle="Data saving";
if (fdlg.DoModal()==IDOK)
{
m_strCurFile=fdlg.GetPathName();
CStdioFile csfile(m_strCurFile,CFile::modeCreate|CFile::modeReadWrite|CFile::typeText);
csfile.WriteString(buf);
csfile.Close();
}
}
I saved the values in *.txt or *.map file, but when it was opened by notepad with the defaut font, the columns becomed unaligned. So I want to know that is there any way to set the font view of the files? or they are only related with operating system?
As the code above, I saved the value of array regdata[5][0x10][0x10] as hex-string in the *.txt file. how can I read the value back to regdata[5][0x10][0x10] one-by-one?
|
|
|
|
|
Hi
Use CFile with binary mode
by
KK
|
|
|
|
|
If you want to display the lines with straight columns, then you have to use a monospaced font (where all characters has got the same width), such as "Courier New" or "System"
In a text file, you can't choose what font to use when the file is viewed.
If you need to do that, try a .rtf, .doc or a .pdf file.
|
|
|
|
|
|
I didn't really understood what you explained but it looks like a painting problem. Are you sure all the code for the painting is made in OnPaint ? (and nowhere else)
|
|
|
|
|
Cedric,
In another words,
map mode = MM_TEXT
View origin=0,0(top left)
first line drawn (10,10-------- 20,10)
I scroll view ..with scroll bars and bring the view to an doc area where first line is not visible.
second vertical line drawn .. say (15,200----15,210)
but for second line its taking coordinates as (15, 20----15,30)
its not adding origin + scroll range to the points
what can be the reason.
Leya
|
|
|
|
|
You didn't answer my question: is everything drawn in OnPaint ?
Post the code of your OnPaint handler (use the pre tags to format it properly).
|
|
|
|
|
rectLs = ls->GetBoundingRect();
pDC->DPtoLP(&rectLs);
rectLs.InflateRect(1, 1);
This is useless because it doesn't have any impact on the drawing (drawing is made in DrawLineString).
But, your didn't show your drawing code. Post the DrawLineString function (and everything that is related to the drawing of the line.
I suppose CLineString is one of your class ?
|
|
|
|
|
By rereading your previous post I think the problem is in fact not a drawing problem but how you save the point ! The problem is that in the point you get in the OnLButtonDown doesn't take in account the scroll positions (that's logical) but only the client coordinates !
Thus, you need to add the coordinates of your scroll bar to the point. I suppose your view class derives from CScrollView ?
Then, you can retrieve the position of the scrollbar by calling GetScrollPosition.
Then, you need to add the X an Y from the scroll position to the point received in OnLButtonDown.
|
|
|
|
|
Thanks Cedric,
Atlast you understood.
I wonder how I can improve my english communication?
thanks,
Leya
|
|
|
|
|
Maybe by practising more . It is like programming, it takes time to be fluent with.
Anyway, does that solve your problem ?
|
|
|
|
|
How do I change the menubar's background to show a tiled bitmap or to show in come color else?
I'd like to display a bitmap as the menubar( not menu item) background..
Can any 1 show me the way ?
Deeply appricate your help...
|
|
|
|
|
I must be missing something in the cleanup, but here is a cut version of the code that causes the leak.
<br />
CExcelRange usedCells = oSheet.get_UsedRange();<br />
<br />
<br />
COleSafeArray cellArray(usedCells.get_Value());<br />
<br />
<br />
usedCells.Clear();<br />
usedCells.ReleaseDispatch();<br />
VariantClear(cellArray);<br />
cellArray.Clear();<br />
cellArray.Detach();<br />
I have deliberately cut down my code for testing so it essentially does nothing but load the file. There is no code between "COleSafeArray cellArray(usedCells.get_Value());" and "usedCells.Clear();" to help narrow down the leak.
If I comment out the line "COleSafeArray cellArray(usedCells.get_Value());" (and oviously the associated cleanup so it will compile) I have no leak, but if it calls this line I get an immediate loss of ~4-5 times the file size which equates to about 30 meg per file. If I run this multiple times it continues to drop, so I don't think it is a windows caching problem. Anybody know what I'm missing?
When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
|
|
|
|
|
OK I've worked it out. It seems you cannot set the data via the constructor or it will cause a leak, don't ask me why, it just does. Otherwise it works fine. The fix is to replace the faulty line with these two
COleSafeArray cellArray;
cellArray.Attach(usedCells.get_Value());
I have also noticed with this fussing today that if a value is assigned to any form of variant based objects in C++ it will leak unless you call Clear() after every assignment. One of the many reasons why I despise variants.
When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
|
|
|
|
|
hi
1)I want to Verify Windows Firewall Settings in VC or VB(since API functions can be used in both).
2)Verify DCOM Privileges to run DCOM based applications
can anyone point to some links or atleast give an idea abt the kind of functions to look for?
thanx in advance
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
-- modified at 4:23 Thursday 4th May, 2006
|
|
|
|