|
|
Replacement message:
ListView is just a CListCtrl wrapped in a View class, so look at CListCtrl articles here on CP. Luckily, it's a later control and more easily part-owner-draw-able, unlike ListBoxes.
Iain.
-------------------------
Original:
I don't know the answer off the top of my head - but I bet you'd have to do some level of ownerdraw. Luckily, the ListView is a later control, and more easily part-owner-drawable. (Unlike ListCtrl).
Have a look on the articles here on CP. You may not find an exact answer, but I bet someone has an article with (eg) different fonts in different rows / columns that could give you a string hint.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
modified on Tuesday, May 13, 2008 9:53 AM
|
|
|
|
|
Iain Clarke wrote: Luckily, the ListView is a later control, and more easily part-owner-drawable. (Unlike ListCtrl).
How so?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
This was a little bit off the cuff - but ListCtrl has been around since my windows 3.1 programming days - ListView is all new fangled and windows 95ish.
Just look at the API for the common controls - with its NMCUSTOMDRAW, multi stages etc.
I didn't say it was *easy* in an absolute sense - just a relative one.
On the other hand, I usually either use ListCtrl for a simple list o' stuff, or jump straight to Maunder's original grid control - the early seed of codeproject. I've yet to give serious time to the new Dundas' open sourced one, as it would require too much rewiring of too many parts of my code.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Iain Clarke wrote: ...ListCtrl has been around since my windows 3.1 programming days...
Hmm, I don't recall seeing a list control until at least Windows 95. Prior to that, it was all listboxes.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Prior to that, it was all listboxes.
That's where we're going adrift.
Replace my texted ListView with ListCtrl, and my ListCtrl with ListBox...
Phew. I was wondering how we were disagreeing.
(earlier message edited)
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
I am creating a class as follows...
extern"C" class Logger
{ public:
string message;
void logMIN(string message);
void logMID(string message);
void logMAX(string message);
};
extern "C"
void Logger::logMIN(string message)
{
.....
}
extern"C"
void Logger::logMID(string message)
{
.....
}
extern"C"
void Logger::logMAX(string message)
{
......
}
I call these functions from main. Following is the error that I get on building... Please help me resolve this
Logger.obj : error LNK2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl log(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >) " (?l
og@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@Z)
...THANKS </char></char,struct></char></char,struct>
|
|
|
|
|
I just reported your message for posting the same thing over and over. You were given answers when you asked this question yesterday.
See here and here
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
yes but it was not resolved..
|
|
|
|
|
If it was not resolved, it could be only because you did not give sufficient information at first, and then you did not care to reply to the ones who posted to you. You could have replied to them, explaining what you tried and what was the outcome.
Is it hard to understand that if you post the same thing again, you will get the very same reply?
Also, I find it very difficult to understand things like "it is not working", "it was not resolved", etc.,
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
|
It was either Benjamin Franklin or Albert Einstein that defined insanity as doing the same thing over and over again and expecting different results.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I agree with Rajesh you should have followed the queries for your previous post instead of reposting it.
It seems you are missing the definition for a function whose prototype is something like,
string log(string);
and not related to the code you shown about the Logger class.
BTW, use <pre></pre> and format the message correctly when posting such messages.
|
|
|
|
|
I am sorry for doing that.
I have also included the function string log(string) but still that error persists.
|
|
|
|
|
pl_kode wrote: I have also included the function string log(string) but still that error persists.
how, where, and post full length error which shows "referenced in function _xxx".
|
|
|
|
|
I have done like this..
extern string log(string);
extern"C"
void Logger::logMIN(string message)
{
log(message);
}
error is...
Linking...
Logger.obj : error LNK2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > __cdecl log(class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > ) " (?l
og@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@Z)
Debug/test_dll_log.exe : fatal error LNK1120: 1 unresolved externals
</char></char,struct></char></char,struct>
|
|
|
|
|
pl_kode wrote: extern string log(string);
this is the declaration, where the definition? i Hope you know the meaning of function definition. I don't know such a prototyped function in SDK, if you know link with corresponding library.
|
|
|
|
|
The definition of log(message) is in another file in the same project. In which I print this message...
Goes like..
log(string message)
{
cout<<message;
}
the above function is called like what I had given earlier. This function is defined outside the Logger class.
|
|
|
|
|
your function prototype doesnot match with the definition, since these are in different compilation unit and the compilation unit where you defined the function doesnot aware of the faulty declaration, compiler didn't shown error,
you need ti change like this,
string log(string message)
{
cout << message;
return message;
}
or change the prototype as
extern void log(string message);
and define as
void log (string message)
{
cout << message;
}
|
|
|
|
|
Thanks a lot it worked.. Thank you for your time.
|
|
|
|
|
and you can go for pass - by - reference.
|
|
|
|
|
hai,
i have written a code to created a status bar and i get the following error while i run the project,what's wrong with the code???
"Unhandled exception at 0x7837b7a8 (mfc80ud.dll) in kk.exe: 0xC0000005: Access violation writing location 0x00000014."
and the error is shown here:
void CStatusBar::SetPaneInfo(int nIndex, UINT nID, UINT nStyle, int cxWidth)
{
ASSERT_VALID(this);
BOOL bChanged = FALSE;
AFX_STATUSPANE* pSBP = _GetPanePtr(nIndex);
error-------->pSBP->nID = nID;
if (pSBP->nStyle != nStyle)
{
if ((pSBP->nStyle ^ nStyle) & SBPS_STRETCH)
bChanged = TRUE;
else
{
pSBP->nStyle = nStyle;
pSBP->nFlags |= SBPF_UPDATE;
SetPaneText(nIndex, pSBP->strText);
}
pSBP->nStyle = nStyle;
}
and my coding is
m_bar.Create(this);
CRect rect;
GetClientRect(&rect);
m_bar.SetPaneInfo(1,scan,SBPS_STRETCH ,0);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,
scan);
CString s;
s="scan";
m_bar.SetPaneText(0,s);
Raja
|
|
|
|
|
AFAIK panes are 0 indexed so if you only have one pane in your status bar, then your code will crash.
|
|
|
|
|
Hi,
I got XOffice source from net but when I create a print preview of any document it directily sends print command to printer. Can anyone tell us how to avoid this.
Another problem is with excel where this code does not provide "Freez Panes" in Window menu. This option is not available at all. How to include such functionality.
This architecture is based on OLE.
Any input will help.
Thanks
SNI
jhghjghj
|
|
|
|
|
on a single click how do i take a snapshot and print of currently displayed screen using VC++/MFC
|
|
|
|