|
Call the SetExtendedStyle function with LVS_EX_FULLROWSELECT as the parameter.
|
|
|
|
|
I don't believe that will do the trick. I think the LVS_EX_FULLROWSELECT parameter only allows you to select a row by clicking anywhere on any column in that row, rather than on just the first column text. It won't actually highlight the row.
To achieve the highlighting, you'll have to custom draw the control yourself, and you can find many examples of that on this site and on codeguru in the listcontrol sections.
best of luck
|
|
|
|
|
I need to access function1 in class2 from class1. Everytime I try to do this i get an error about statically linking. "illegal call of non-static function........ it is Error C2352. Since this function takes values and updates controls based on these values I can't use static functions. Can anyone tell me what to do ?
-Matt Newman
|
|
|
|
|
you can only call non-static (ie. normal) methods on an object if you have an instance of the object.
so, either create an instance of class2 or find an already-exisiting instance of it.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
you can only call non-static (ie. normal) methods on an object if you have an instance of the object. so, either create an instance of class2 or find an already-exisiting instance of it.
I am a beginner and I am not sure what you mean by create an instance. Could you elucidate this for me?
-Matt Newman
|
|
|
|
|
This is really one of the basic principles (maybe the most basic principle) in all of Object Oriented programming: you have a set of functions and properties grouped together that comprise an "object". You can tell the object to do something (invoke methods on the object), to report its state, to change its state, etc..
CString myString;
After this statement executes, "myString" is an "instance" of CString. Or, you could say "myString is an object of type CString".
Now you can call CString methods on myString:
BOOL b = myString.IsEmpty();
myString.MakeUpper();
etc..
What you can't do is call (non static) CString methods without having a CString object to call them on:
CString::Reverse();
This statement makes no sense (at all).What are you trying to Reverse? There is no object there. It's a verb without a noun.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Now I remember. Thanks for the help and the refresher course.;)
-Matt Newman
|
|
|
|
|
This code doing problems in run time, When it read from the file this gets incorrect values in the parameters of the struct. Please ! try find the problem !!!!!!!
class CPerson {
CPerson();
public:
virtual ~CPerson();
public:
dPerson per;
CPerson* pNext;
CPerson* pBack;
};
-------------------------------------------------------------
________________________________________________________________
//cpp file:
-----------------
void CDemo::OnButtonAdd()
{
CFile file;
// CFileException ex;
if(file.Open(strPath, file.modeWrite |file.modeNoTruncate|file.modeCreate ))
{
file.SeekToEnd();
file.Write( &(person.per) , sizeof(dPerson));
MessageBox("************ S A V E D ************** ");
}
}
/************************************************************/
// Read the one first CPerson from the file:
void CDemo::read_person(CFile* persons)
{
CPerson* q = new CPerson;
DWORD dwRead = sizeof(dPerson);
if((*persons).Read(&q->per, sizeof(dPerson)))
{
q->pNext = q->pBack = NULL;
p_head = p_tail = q; //p_head and p_tail are member variables of CDemo - type CPerson*
}
else delete q;
}
/************************************************************/
|
|
|
|
|
Have you tried to add the flag CFile::typeBinary when opening the files?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,,
I have a MDI application. I like to get a pointer to the view of a particular document, and them activate it,,
this is the way that I do it,, but it doesn't work
pDoc= GetDocument();
POSITION pos = pDoc->GetFirstViewPosition();
while (pos != NULL)
{
pView = pCurrDoc->GetNextView(pos);
pCurrView=(CTurboMechView*)pView;
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
pFrame->SetActiveView(pCurrView,TRUE);
}
Thanks
Ehsan Behboudi
|
|
|
|
|
I think that you should activate a frame, not a view - this is MDI app, right? Do you have multiple views in one MDI child frame?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
i dont' have multiple views in one MDI child frame.
but i have several documents open...
so I like to be able to activate a particular View..
I can get a pointer to the document. and then i can get a pointer to the View of that documents. but i can't activate the view..
any ideas??
Ehsan Behboudi
|
|
|
|
|
Assuming you have the document pointer
POSITION ViewPos = pDoc->GetFirstViewPosition();
ASSERT(ViewPos);
CView* pView = pDoc->GetNextView(ViewPos);
ASSERT(pView);
pView->GetParentFrame()->BringWindowToTop();
|
|
|
|
|
thank you
it was helpful
Ehsan Behboudi
|
|
|
|
|
Hi,
I am modifying a DCOM sever, i have written some new functions and would like to package them into their own interface. How do i do this, a sample piece of IDL is shown for one of the interfaces that already exists on the object. Is there anything i need to watch out for? where do i get the uuid from
[
uuid(5E816CCA-628A-4959-B1FE-05465C3393EB),
helpstring("IDocumentVision Interface"),
pointer_default(unique)
]
interface IDocumentVision : IUnknown
{
}
Cheers
Rich
|
|
|
|
|
You can get the uuid from GUIDGen.exe, should be in the tools folder in your Visual Studio installation. I always add it to the tools menu for easy access.
|
|
|
|
|
If I use a prebuild command to auto-generate a source file, can I then add that source file to the current project?
|
|
|
|
|
Hi there,
I was wondering if there is anyway to detect what system DSNs are currently configured on a given machine within a Windows Application?
thanks
|
|
|
|
|
Look under this reg key: HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI
|
|
|
|
|
I'm using a CListView-derieved class which displays SQL-results in report style.
I decided to turn the background gray, so I called SetBkColor() in OnInitialUpdate. The problem is, that this backgroundcolor can only be seen in areas, where no items are draw and as a flickering background when scrolling the list.
What must be done to override the standard item background color?
Pseudocode is code to demonstrate a concept, not designed to be run.
Like certain Microsoft software.
|
|
|
|
|
|
Sorry, but it doesn't help me.
On handling this message, i can decide to paint or not paint the background.
This is well doing, and my desired black background is already painting but not at the items background. That is my problem. The areas, where no item is 'overpainting' are black.
Any idea?
--------------------------------------------------
"Pseudocode is code to demonstrate a concept, not designed to be run.
Like certain Microsoft software. "
|
|
|
|
|
Use identical color with LVM_SETBKCOLOR and LVM_SETTEXTBKCOLOR (or CListCtrl::SetBkColor/SetTextBkColor if you're using MFC):
CListCtrl &lst = ...;
lst.SetBkColor(RGB(255, 0, 0));
lst.SetTextBkColor(RGB(255, 0, 0));
This should make all background red.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Attention please~~~
Hi~
I'm a University student preparing a graduation thesis, in Korea.
But in the process, there raised an obstacle, so I'm in stuck with a problem.
So now I sincerely call for your help...
As the question contains some images and source file, I make out html document file.
The address is http://my.netian.com/~sibuzigi/forsite.htm
I hope your quick and adequate answer.
p/s Please~~~ Somebody help me~~~!^^;;;;;;
|
|
|
|
|
the site is korean,, how do you expect an answer buddy?
Ehsan Behboudi
|
|
|
|