|
I think you should reconsider your for loop like this:
bool found = false;
for( int r = 0; . . . )
{
SendMessage(hIgnore, LB_GETTEXT, r, (LPARAM)tmprr);
if( stricmp(chhh, tmprr) == 0)
{
found = true;
break;
}
}
if( ! found) . . .
I hope this helps.
|
|
|
|
|
It solved my problem. Thank you very much.
|
|
|
|
|
frbry wrote: SendMessage(hIgnore, LB_GETTEXT, r,(LPARAM)(LPCTSTR) tmprr);
I Suggest you to use LB_FINDSTRING
I think you can sort out the issue, if you debug the application.
frbry wrote: LvItem.pszText=chhh;
LvItem.iSubItem=0;
ListView_InsertItem(hList, &LvItem);
LvItem.iSubItem=1;
LvItem.pszText="0";
ListView_SetItem(hList, &LvItem);
One thing I noticed is that, you two times you are modifying teh iSubItems(the final value is 1).
In MSDN it's clearly saying that,
You cannot use ListView_InsertItem or LVM_INSERTITEM to insert subitems. The iSubItem member of the LVITEM structure must be zero
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
I removed LvItem.iSubItem=0; line but the list couldn't be populated.
|
|
|
|
|
I think the subitem should be zero.
I'm not getting anything more from the code.
check the following too.
1. Check GetLastError(); (put @err in the watch window while debuging to avoid coding).
2. If possoble use MFC
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
<blink>My Blog | Understanding State Pattern in C++
-- modified at 8:27 Wednesday 5th July, 2006
|
|
|
|
|
I trying to ignore "svchost.exe" but almost every process in main list gets ignored. Any suggestions?
|
|
|
|
|
I think you should post your changed code.
|
|
|
|
|
You're right.
char chhh[260];
char tmprr[260];
bool found = false;
do{
sprintf(chhh, "%s", pe32.szExeFile);
for(int r=0; r<SendMessage(hIgnore, LB_GETCOUNT, 0, 0); r++)
{
SendMessage(hIgnore, LB_GETTEXT, r,(LPARAM)(LPCTSTR) tmprr);
if( stricmp(chhh, tmprr) == 0){
found = true;
break;
}
}
if(!found){
LvItem.pszText=chhh;
LvItem.iSubItem=0;
ListView_InsertItem(hList, &LvItem);
LvItem.iSubItem=1;
LvItem.pszText="0";
ListView_SetItem(hList, &LvItem);
}
-- modified at 8:49 Wednesday 5th July, 2006
|
|
|
|
|
Since you moved the declaration of bool found = false; , you have to initialize it before for :
bool found;
do
{
. . .
found = false;
for( int r = 0; . . .)
{
. . .
}
. . .
|
|
|
|
|
Yeah, again it solved my problem!
Thank you very much.
|
|
|
|
|
How we can set borders to dialog,
please help me,
thank u
kanth
|
|
|
|
|
Right click on the property window. Go to border . There you can modify the border style of the dialog. A dialog has a border of type Dialog Frame by default in an MFC dialog based Application.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 6:57 Wednesday 5th July, 2006
|
|
|
|
|
thank u,
but i want custom border.
kanth
|
|
|
|
|
|
how to change the colour of the text in edit control in win32 application
Manjunath S
GESL
Bangalore
|
|
|
|
|
add a WM_CTLCOLOR handler either in the dialog box
or
Add the same in a class which is derived from the CEdit. (Subclass or create a control variable of your edit box to this class)
see the following code snippet
HBRUSH CSampleDialogDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (CTLCOLOR_EDIT == nCtlColor)
{
pDC->SetTextColor(RGB(0xFF,0,0));
}
return hbr;
}
Note that, if you are trying the above code in a dialog, will replace color of all edit boxes in the dialog.
See MSDN to know more about WM_CTLCOLOR message
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
How to get device context in win32 application. In this application i have a dialog on which iam displaying a static text, how to change text color of the text which is displyed on the edit control...
Manjunath S
GESL
Bangalore
|
|
|
|
|
Manjunath S wrote: How to get device context in win32 application
Use GetDC function
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
<blink>My Blog | Understanding State Pattern in C++
|
|
|
|
|
add Onctl function and add following code
HBRUSH hbr;
//HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor == CTLCOLOR_STATIC )
{
hbr=CreateSolidBrush(RGB(0,100,0));
pDC->SetTextColor(RGB(0,0,255));
pDC->SetBkColor(RGB(0,100,0));
//for text colour, also use this: pDC->SetTextColor(RGB(0,0,0));
}
else
{
if(nCtlColor == CTLCOLOR_BTN)
{
hbr=CreateSolidBrush(RGB(0,100,0));
pDC->SetTextColor(RGB(0,0,1));
pDC->SetBkColor(RGB(0,100,0));
// pDC->SetBkColor(TRANSPARENT);
// for text colour, also use this: pDC->SetTextColor(RGB(0,0,0));
}
// hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
}
return hbr;
Ashish Dogra
MCA
Noida
|
|
|
|
|
Use WM_CTLCOLOREDIT
whitesky
|
|
|
|
|
Hi,
I am using MSXML4.0 with VisualC++ 6.0.
I am not able to give XPath Queries for the xmls containing namespaces
Example:
SCL xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.iec.ch/61850/2003/SCL SCL.xsd"
If I try to use the XPATH /SCL the SelectSingleNode Function returns NULL
value.
What could be the reason. Please suggest possible solutions .
thanks in advance.
-- modified at 6:40 Wednesday 5th July, 2006
|
|
|
|
|
You're probably getting bitten by this[^].
XPath doesn't work if the document defines a default namespace. This behavior is by design
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
thanks for your reply.
but it is not helping us in anyway.
Actually we want to use XPath without including the prefixes.
If any example is available please share with us.
|
|
|
|
|
anil@kalkitech.in wrote: Actually we want to use XPath without including the prefixes.
Huh?! If the XML elements you're looking for are in a namespace, you *must* specify that namespace in your XPath query. They are an integral part of the element's name; you can't just ignore them!
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Hello all,
I have to create a pdf file from crystal without showing the report. I have the following code but it crashes with "memory can't be read". Anybody done this before?
CString m_csPath = "D:\\MyProg\\SendChecker\\Report\\quote.rpt";
CString csDskFile = "c:\\";
//first create the report
//Create an instance of the Application object
app->pApplication.CreateInstance("CrystalRuntime.Application.9");
//Use the File Dialog of the MFC to select the report file
BSTR FileName( m_csPath.AllocSysString());
//Open the report
app->pReport = app->pApplication->OpenReport( FileName );
csDskFile += a_csTrans;
csDskFile += ".pdf";
BSTR DskFile( csDskFile.AllocSysString() );
app->pReport->ExportOptions->FormatType = crEFTPortableDocFormat;
app->pReport->ExportOptions->PDFExportAllPages = TRUE;
app->pReport->ExportOptions->DestinationType = crEDTDiskFile;
app->pReport->ExportOptions->DiskFileName = DskFile;
VARIANT_BOOL pBool = FALSE;
app->pReport->Export( pBool ); //crashes here, why?
|
|
|
|