|
I want to change the bitmap on my toolbar button when user presses the button i.e. if initially its showing x bitmap then when user presses it it should show y bitmap on that coreesponding button
Thanx in advance
|
|
|
|
|
One way is to Set the owner draw property of the button to TRUE. Derive a class from CBitmapButton and override the DrawItem function in that derived class.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
another way to do this is to have 2 toolbar buttons and show/hide them appropriately
cje
|
|
|
|
|
Hi,
i try to write a ISAPI Extension for Win CE 4.2 to view dynamic webpages.
The got the ISAPI environment working it can now read templatefiles and replace tags in the template but now i try to fill the page with data form a SQL CE 2.0 Server. As far as i know there is the only way to connect by using ole db. right?
i found the article about accessing MS SQL Server CE v1.0 / 2.0 without ADO object. I tried to implement it. When I call the included test function it tells me that SQL Server is running. And with the example application it's no problem to connect and create tables and so on.. but when i try to connect to my database it always fails.
Anyone can help me with this?
Her's my example code:
<br />
<br />
#include "stdafx.h"<br />
#include "WriteFunctions.h"<br />
#include "ReadFunctions.h"<br />
#include "SqlSvrCe.h"<br />
<br />
<br />
<br />
BOOL APIENTRY DllMain( HANDLE hModule, <br />
DWORD ul_reason_for_call, <br />
LPVOID lpReserved<br />
)<br />
{<br />
return true;<br />
}<br />
<br />
BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVersion)<br />
{<br />
pVersion->dwExtensionVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);<br />
<br />
strcpy(pVersion->lpszExtensionDesc, "ISAPI DB Connection");<br />
<br />
return true;<br />
}<br />
<br />
DWORD WINAPI HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pECB)<br />
{<br />
HRESULT hr;<br />
WriteHTMLHeader(pECB);<br />
WriteHTMLHead(pECB, "ISAPI DB Connection");<br />
WriteHTML(pECB, "Checking SQL Server\r\n<br>");<br />
if (SqlServerSelfTest() != 0)<br />
{<br />
WriteHTML(pECB, "SQL Server CE not installed!\r\n<br>");<br />
<br />
} else {<br />
WriteHTML(pECB, "SQL Server CE installed!\r\n<br>");<br />
}<br />
<br />
hr = CreateSqlSvrCeProvider();<br />
WriteHTML(pECB, "Result : %d\r\n", hr);<br />
hr = ConnectDB(TEXT("\\StoreCard\\Tmp\\database.sdf"));<br />
if (FAILED(hr)){<br />
WriteHTML(pECB, "Can't Open\r\n<br>");<br />
}<br />
<br />
WriteHTMLFoot(pECB);<br />
<br />
return HSE_STATUS_SUCCESS;<br />
}
|
|
|
|
|
Can someone point me to the best control/class that I can plug in to a dialog app created in VC++ using MFC so that I can display a simple array of 27 numbers as a 2D profile. It doesn't need to have any runtime user input or customisation. My program calculates two arrays, and displays some numeric values based on them, but it would be nice if the user could see each of the two arrays plotted on a graph like they would see it in an Excel chart, ideally with the points joined by smoothed lines
tks in advance
|
|
|
|
|
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
many thanks, I got that to work on the whole, but the rescaling of axes isn't working.
here is what i am doing, the x values go from 0 to 26, the y value are between 0 and 2, double values
// display chart
CChartSerie* pLineSerie = m_ChartCtrl.AddSerie(CChartSerie::stLineSerie);
CChartAxis* yaxis = m_ChartCtrl.GetLeftAxis();
CChartAxis* xaxis = m_ChartCtrl.GetLeftAxis();
yaxis->SetMinMax(0,2);
xaxis->SetMinMax(0,27);
double XValues[27];
for(int k = 0; k<27; k++)
XValues[k] = k;
pLineSerie->SetPoints(XValues,rowarray,27);
m_ChartCtrl.RefreshCtrl();
|
|
|
|
|
of course I immediately spot the error
should be
CChartAxis* xaxis = m_ChartCtrl.GetBottomAxis(); !!!!!
|
|
|
|
|
Hi all!
I am making a program with Win32 API and MSVC++ 2003 that lists running processes on users computer. It works well up to this point but i wanted to add an extra feature. Put a second list box and and filled it with names of processes that i don't want to show in main listbox. like "svchost.exe", "cfosspeed.exe", "spd.exe". I tried this in ListProcesses() function:
char chhh[260];
char tmprr[260];
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)){
found = 1;
}
else {
found = 0;
}
}
if(found==0){
LvItem.pszText=chhh;
LvItem.iSubItem=0;
ListView_InsertItem(hList, &LvItem);
LvItem.iSubItem=1;
LvItem.pszText="0";
ListView_SetItem(hList, &LvItem);
}
} while( Process32Next( hProcessSnap, &pe32 ) );
But it doesn't work. I tried to put for example "cfosspeed.exe" instead of tmprr, it ignored successfully.
by the way, hIgnore is hwnd of ignore list box.
Thanks!
|
|
|
|
|
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++
|
|
|
|
|