|
CPU usage increases for list view for same app under XP
-------------------------------------------------------
I've been working on an application for several years which uses MS ListView controls to display large grids of data (perhaps 50 lines by 100 columns).
background: The application displays market data, amongst other things, from electronic exchanges.
The application updates individual cells relatively rapidly.
I handled the CustomDraw events to provide formatting such as colors.
The list view is in virtual mode.
All was well on Win2000. CPU usage was reasonable. However, when I open the same window under XP, the CPU usage seems to increase dramatically.
I used the ATLControls.h list view wrapper as a thin wrapper around the control, and compiled under VC6, SP5.
Does anyone have any clues?
Thanks in advance
Dan Hill
|
|
|
|
|
PS Am also using WTL MDI wrappers
|
|
|
|
|
Hi All,
I have been going through one of my older projects and updating it from WTL 7.0 to 7.1 and am getting error which I have no idea how to fix.
I have search through the forum and have found no-one else has had this problem... or the problem is so easy that I cannot see the solution.
All I have done is changed the path to my wtl 7.0 include to now point to the 7.1 includes. I then rebuild my app and get the following error
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atlapp.h(396) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atlapp.h(397) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atlapp.h(595) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atlapp.h(599) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atlapp.h(600) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atlapp.h(603) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atlapp.h(844) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atluser.h(39) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atluser.h(39) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atluser.h(57) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atluser.h(82) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atluser.h(205) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atluser.h(490) : see reference to class template instantiation 'WTL::CMenuT<t_bmanaged>' being compiled
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atlgdi.h(78) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atlgdi.h(86) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atlgdi.h(88) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atlgdi.h(528) : error C2872: 'ATL' : ambiguous symbol
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atlgdi.h(682) : see reference to class template instantiation 'WTL::CBitmapT<t_bmanaged>' being compiled
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\WTL71\INCLUDE\atlframe.h(380) : error C2872: 'ATL' : ambiguous symbol
.... and it keeps on going
I am using visual c++ 6.0
ANy ideas on why this is happening?
cheers
Bryce
|
|
|
|
|
Hi all
I have implemented IDochostUIHandler for my HTML control hosting. The container for the HTML control is IE. now i want to handle events from top level menu such as FILE/Edit. what interfaces i need to add to acheive the same.
BTW i looked into msdn for the same, it says
////MSDN////
IDocHostUIHandler::ShowUI Method
Called by MSHTML to enable the host to replace MSHTML menus and toolbars
/////
My question is When these function is called and who calls it?
thanks in Advance
Abhishake
|
|
|
|
|
Hello,
In my application I call a dll, which contains an exported class.
The class has a member function, which passes a std::list by reference.
When using the push_back member of the list, the application just freezes after a few iterations:
In my main app:
<br />
std::list< std::basic_string<TCHAR> > m_Columns;<br />
int bReturn=pMyDllClass->doit(m_Columns);<br />
In my dll
<br />
int CMyDllClass::doit(std::list< std::basic_string<TCHAR> >& out)<br />
{<br />
...<br />
for (int n=0; n<20; n++)<br />
{<br />
out.push_back(std::basic_string<TCHAR>("test");<br />
}<br />
...<br />
return 0;
}<br />
After iteration 11 or so, the app freezes.
I I use this piece of code in my main app, so not using the dll but using a normal class, it works perfectly.
Any idea what I'm doing wrong
Thanks
Regards
Wim
|
|
|
|
|
I see two potential problems here:
1. You may be using VC6. In that case you need to either patch your STL, or use STLPort in order to pass STL objects accross DLL boundaries.
2. You are statically linking CRT and C++ Standard library. If you are doing this, than you should better delete objects in the same dll where they are created.
|
|
|
|
|
Hello,
Thanks for your reply.
1) I'm using Visual C++.NET 2003, with latest sdk's.
2) I've set the 'Minimize CRT usage in ATL' to No. I'm not using atl for the dll anyway...
If I should delete my objects in the dll I'm using, how can I do that?
After all, I'm passing the std::list reference from my main program to the dll. The dll is just stuffing the std::list with data...
Regards
Wim
|
|
|
|
|
Wim Jans wrote:
After all, I'm passing the std::list reference from my main program to the dll. The dll is just stuffing the std::list with data...
"Just stuffing" is the problem. That's because you allocate the data you "stuff" in one module (dll), and delete it in the second one (exe). Arguably the easiest way to get around this problem is to follow Michael Dunn's advice.
|
|
|
|
|
The app and the DLL must both be linking to the DLL version of the CRT for that to work. If one (or both) use the static LIB version, each will have a different heap, and one cannot alloc/free on the other's heap.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
Step1) I made a program in C which contains user defined data-types and functions.
Step2) then this file is included in a Win32 project which makes use of MFC to create a Class which is derived from CDC and contains member variables of type defined in the C file; the output of this project is a .LIB file,
Step3)I can link this LIB file to a MFC project and works fine. But When I go ahead to use this lib file to create an ATL_COM DLL where I instantiate the class , the compiler reports several errors regarding the class is unidentified, all the type definitions are undefind.
Pls suggest me a remedy to this problem.
|
|
|
|
|
Does your ATL project and LIB project have the same runtime libraries? DLL or static, single threaded or multi threaded?
I've run into that problem a couple of times, and the solution to my problem was to make the LIB, which I'm linking with, have the same runtime library settings as the ATL DLL.
--
Booohoo!
|
|
|
|
|
I've used the same project->settings i.e "Use MFC in a Static Library". for both LIB and ATL projects
##I defined the Class CMyDC derived from CDC in my LIB project.
##I copied the LIB file to the ATL COM project directory,
##then added the "myFirst.LIB" in the Project -> Settings -> Object/Library Module
## then created an object dc of type CMyDC
The error Messages are :-
1) error C2065: 'CMyDC' : undeclared identifier
(CMyDC is the name of the class I've defined in my lib file)
2) error C2146: syntax error : missing ';' before identifier 'dc'
3) error C2065: 'dc' : undeclared identifier
|
|
|
|
|
I've used the same RUNTIME options i.e /MD for both projects
PLS HELP........
|
|
|
|
|
i m working in .net ..
i took two listbox web server controls..ok
In My Listbox1 there is some data which comes from database
on client side & i added some elements from listbox1 to listbox2 i have done this by using javascript ok...
Now on some event my page is going to refresh.. so what ever the data i have add on client side in listbox2 vanishes as page get refresh..
what i think as .Net provide a view state so how it get vanishes ....
so can u tell me where i m wrong...
the reason behind to think so, is that (if we add some data in text box through javascript or we just enter through our key board) and when it do the server trip it remains there ,then why not for list box.. so please help me and tell me where i m wrong...
thanks in advance...
|
|
|
|
|
|
[EDIT2] Nevermind, I just discovered Updatelayout() and realized how stupid my question was
Hello everyone, I'm a real newbie to programing both WTL and MFC so bare with me.
I'm trying to subclass a CButton to a CWindowContainer in a framewindow derived from
CMDIChildWindowImpl. But for some reason it won't show up. Am I trying to do something that isn't possible?
Thanks in advance,
Skandal
[EDIT] I don't know if it's obvious from my post that I'm using WTL.
|
|
|
|
|
Hi,
I am facing a peculiar problem with usage of maps in the following code
#include <iostream>
#include
#include <deque>
#include <string>
using namespace std;
typedef const string& CIR;
typedef enum { IEArgString, IEArgNumber, IEArgSpecial } IEArgType;
class IEArg {
public:
//* Element name and value and embedded datatype.
string name;
string value;
IEArgType dataType;
//* Default constructor given name and value.
IEArg(CIR n, CIR v) : name(n), value(v) { dataType = IEArgString; }
IEArg(CIR n, CIR v, IEArgType t) : name(n), value(v), dataType(t) { }
};
typedef map < IEArg,string > IEArgList;
// typedef map < string,IEArg > IEArgList;
inline CIR key(const IEArg& iea) { return iea.name; }
typedef deque < IEArg > IEOArgList;
main()
{
int days=10;
IEArgList al;
string where;
string nam="1235";
string val="12";
// Maps and multimaps deal with pairs
typedef pair < IEArg,string > entry;
// typedef pair < string,IEArg > entry;
entry p1(IEArg("1234","A"),"Time");
// entry p1("Time",IEArg("1234","A"));
entry p2(IEArg("4567","B"),"Transaction");
// entry p2("Transaction",IEArg("4567","B"));
entry p3(IEArg("5678","C"),"ResultCode");
// entry p3("ResultCode",IEArg("5678","C"));
// Insert values into the phonebook
al.insert(p1);
al.insert(p2);
al.insert(p3);
where = string("Userid='") + "SASI" + string("'");
cout<<"Value of where is "<<where<<endl;
if="" (days=""> 0) {
where += string(" AND ");
where += string("Time >= (CURRENT TIMESTAMP - ");
where += string(days);
where += string(" DAY)");
}
IEArgList::iterator iter;
for (iter = al.begin(); iter != al.end(); iter++) {
cout<<"values are:"<<(*iter).first.name<<":"<<(*iter).first.value<<":"<<(*iter).second<
|
|
|
|
|
If you had spent 2 minutes on reading the documentation for std::map , you would have seen that either you must provide a less than operator (operator< ) for IEArg , or provide a binary functor/predicate type as the third template parameter to std::map which knows how to compare two IEArg s.
--
Booohoo!
|
|
|
|
|
Honestly,i didnt get what you said as i am relatively new to STL. why do we need a less than operator.But then even with out it,it worked if the order of passed arguments is reverse(as in bold).Infact with the current code its failing in insert function.
Can you give a bit more clarification on this(with specific to code)?
Thanks
Sasi
|
|
|
|
|
std::string already has an operator< .
Using a map implies you want the collection to be ordered, in which case you have to provide an ordering criterion. If you don't want the collection ordered use a std::vector or other container.
What is the software supposed to do?
Paul
|
|
|
|
|
Infact i am trying to migrate the application using IBM open classes to standard c++/STL. Originally its written using IKeySet and i changed it to map as recommended.
The interesting thing with this peice of code is the way its working with reversal of argumenst for map.i am not able to compiel as its failing in insert. Please suggest me a way out!
|
|
|
|
|
Your question has been answered twice now.
Paul
|
|
|
|
|
Thanks a lot both of you guys!!
I overloaded the < operator and now i am able to compile it and its working!!
But i have anotehr small question to you.Is there a provision to pass only IEArg(key) by leaving string(value) to the insert function. If its the case,will it take any default value?? I asked this question as IKeySet's add method has a provision like that
|
|
|
|
|
is there any autodeletion of classes in WTL?
|
|
|
|
|
Asking such questions, followed by such conditional statements, kind of sucks.
--
Booohoo!
|
|
|
|