|
im doing a find dialog, here's my code
void CWordFind::OnButtonFindNow()
{
// TODO: Add your control notification handler code here
// update from screen to var
UpdateData(TRUE);
LVFINDINFO info;
int nIndex;
info.flags = LVFI_STRING;
info.psz = m_sFindWord;
if ((nIndex = m_pParent->m_ListCtrl.FindItem(&info)) == -1)
{
MessageBox("Word was not found.", "Find");
}
else
// highlight row nIndex
}
how can i highlight the row in CListCtrl?
the only thing that comes close as a member function is SetSelecteionMark, but it's not used for highlighting, i supposed..
thanks for your help
|
|
|
|
|
you need to take own draw over list control and set different background (font, frame, whatever) for item you like to highlite.
Yours, Katerina
|
|
|
|
|
any sample code for that? sorry im new at this
|
|
|
|
|
i think it is in MSDN or somewhere here, try to search
|
|
|
|
|
thanks, found a great one here..thanks again
|
|
|
|
|
If you want to select the item like you would do with the mouse, but you want to do it programmatically, this should do it:
if ((nIndex = m_pParent->m_ListCtrl.FindItem(&info)) == -1)
{
MessageBox("Word was not found.", "Find");
}
else
{
m_ListCtrl.SetItemState( nIndex, LVIS_SELECTED, LVIS_SELECTED );
m_ListCtrl.SetSelectionMark( nIndex );
}
Good luck,
Chris Richardson
|
|
|
|
|
hi,i'm studying Security issue,and i add the code in my prog:
#include "accctrl.h"
#include "aclapi.h"
...........................
CSecurityDescriptor sd;
sd.InitializeFromThreadToken();
hr = CoInitializeSecurity(sd, -1, NULL, NULL,
RPC_C_AUTHN_LEVEL_PKT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL);
_ASSERTE(SUCCEEDED(hr));
but the prog compiled show:
C:\CommuServ.0411(wnd.err)\CommuServ.cpp(83) : error C2065: 'CSecurityDescriptor' : undeclared identifier
what is wrong?
appreciate any help!!
|
|
|
|
|
did you added the correct header corresponding to your CSecurityDescriptor (like SecurityDescriptor.h) ?
TOXCCT >>> GEII power
|
|
|
|
|
Hi,
I'm looking for some code that understands mathematical expressions presented as a string (e.g. "y=sin(x)+2x").
Have you seen any code that does this? This code seems so fundamental to me, it could even be provided within MFC but I can't find it.
I'm writing an MFC application that will plot a x-y graph of a mathematical equation.
So ideally code I am looking for will accept a string input (e.g. "y=x^2+5") and an x value will output the corresponding y value.
Thank you
Shan
|
|
|
|
|
|
For your application you need to first "compile" the expression into some quickly-evaluatble form, and then repeatedly assign values to the variables in it (in your case -- 'x' only) and get the result.
I did that a long long time with UCalc, which back then had a .lib version.
Alternatively, if you're feeling up to it, you can write an infix parser, and create an expression tree or a postfix expression from it.
EFG also has a page full of links for such programs and libraries. Search for "+Expression +Evaluate +Library +EFG" on Google.
I'll be glad to elaborate more if you need.
|
|
|
|
|
have a look at the book The C++ Language from Bjarne stroustrup. Inside, he gives an example of "mathematic calculator" (about p.120).
TOXCCT >>> GEII power
|
|
|
|
|
No code actualy understands a mathematical expression! What I think you are looking for is a "Recursive Descent Parser"; the best example I ever found was in "Advanced C Programming" (may be out of print), it is much easier to understand than the one in "Bjarne stroustrup" book.
INTP
|
|
|
|
|
I want to hide my menu bar but I've read in msdn that a menu bar is always visible, but I think I've seen an application (running fullscreen, probably with WS_POPUP) has the ability to hide/unhide its menu bar.
Can we really do this using MFC ??
|
|
|
|
|
|
Hi,
What is the best way of using MFC's List to store data of this type?
typedef struct DATAGRAM
{
UINT packetID;
ip_header* ipHeader;
pcap_pkthdr* wpHeader;
const UCHAR* pkt_data;
} DATAGRAM;
ipHeader* etc are pointers to further structs. I tried plain CList DATAGRAM, DATAGRAM& and are having problems with code like:
packetCapture.AddTail(filledStruct);
The addtail is in a fairly fast loop and added data is going in fine and coming out of the list corrupted (due to something going out of scope before the operation is completed perhaps?)
I am probably doing something extremely retarded, any ideas?
|
|
|
|
|
Did you mean to do this instead?
packetCapture.AddTail (&filledStruct);
Also remember that filledStruct must be in scope for its address to be valid when you access the list after populating it. You might want to consider new() ing instances of DATAGRAM and adding those instances to the list. They will be around as long as your application runs since they're created on the heap. Be sure to free up this memory before your app exits.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi all,
I would be pleased if any one have an algorithm for building a software program to make a Gantt Chart i need to know the steps thanx all .
More Creativity
|
|
|
|
|
I'm writting my own Gantt control right now as i wasn't able to find anything suitable out on the web.
When i searched for existing Gantt related work the best (only) thing i found was :
http://ganttproject.sourceforge.net[^]
although this is all in Java it might provide a starting point.
I have tended to use MS Project as a guide to what kind of data needs to be stored and how to present the data in an interface. If you are going to have access to MS Project you may want to look at the database schema information provided with MSP. It can usually be found in the install directory e.g. C:\Program Files\Microsoft Office\Office\1033 and will be named OLE_DB.HTM, or PROJDB.HTM, or something similar depending on the version of MSP you have installed.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
hi,
I am trying to understand the Plot Grafhical Library (great library that plots grafhs that i downloaded from the PGL homepage and not the one you can download on the code project site) by programming a small example. but after i run the appliaction i find myself facing the next message : "Unhandled exception in try2.exe (MFCO42D.DLL): 0x0000005: Access Violation"
this violation occures while the program tries to call for a constructor of one of the PGL classes (CPGLRegion), and the debugger brings me to GetThreaterMode() function (from viewhtml.cpp).
if someone knows what is the problem, please help.
mloolm
|
|
|
|
|
hi,all:
when i use spy to trace my windows prog,the trace show that there is a window which the caption is "Default IME".
who can tell me:what is the "Default IME"?
another question:who can tell me the "winsta0" in function OpenWindowStation("winsta0",......)?
appreciate any help!!!!
|
|
|
|
|
Hello all,
please, does anybody know how to setup the RichTextControl (2.0) that it will appear only as the text on dialog box and not as edit field (e.g. that cursor changes and user can select it)?
I tried to set it as read only, but it doesn't help.
Thank to you all!
Katerina
|
|
|
|
|
i am not sure..just try
YourCtrlVariable.EnableWindow(FALSE);
I want to change Myself..Can u help me?
|
|
|
|
|
Hi,
it is not realy nice solution because i have to use different font (normal is grayed then), but still better than nothink,
maybe somebody knows better solution?
Anyway thanks!
how can i help you to change your self?
|
|
|
|
|
GirlsCanProgram wrote:
I tried to set it as read only, but it doesn't help.
Strange. This should work.
VERIFY (myRichEditCtrl.SetReadOnly (TRUE));
ASSERT (myRichEditCtrl.GetStyle() & ES_READONLY);
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|