|
<try adding this class>
class return_value
{
public:
typedef AccumulationTraits traits_type;
typedef traits_type::AccT type;
};
I changed your class like this:
class return_value
{
public:
typedef AccumulationTraits< T > traits_type;
typedef traits_type::AccT type;
};
and placed it at the end of file accumulationtrait.hpp
and the program can be complied with no error and run well.
|
|
|
|
|
Hello Yaki_15,
Congratulations on resolving your problem. Strange thing is that I did declare the "traits_type" typedef in "return_value" class as "AccumulationTraits< T >". The "< T >" somehow disappeared when I posted my message.
It's good anyway to see that your code is now working well
Best Regards,
Bio.
|
|
|
|
|
Hi all,
Respected Members,
I want to upload pd's and mp3 files using .net 2003, if any one have idea plz mail to me
My email id: vijayprakash.g@gmail.com
thank you.
Vijayprakash.g
vijayprakash.g
|
|
|
|
|
|
I am a newbie.
I need print a kind of bill , which content some title word and a table . I use a listviewctrl as the container including data.
hte following work is printing them to a bill with their precise position. I can not write the code of printint data with my wtl programme.
how to?
|
|
|
|
|
Scenario:
Using a dll with javascript. The DLL resides in the server, and gets
downloaded into the client's machine as I specify the codebase= in the <OBJECT> tag of the HTML page.
Question:
How do I change the Classid of my component? The problem is that when I make a new version of the component, The client machine doesn't recogonise it as new(as the classid is remains the same as the older one) and hence it doesn't download the
new copy of the dll. So no matter what changes I make in my component, the client machine continues to use the older version of the dll that it downloaded long time ago until I mannually remove it from downloaded programs. Please help.
|
|
|
|
|
Use the #Version=a,b,c,d fragment identifier on the CODEBASE attribute documented here[^] to have the browser download a newer version of the component. You can keep the CLSID the same.
If your new version of the component is not compatible with the older version, you should change the CLSID.
|
|
|
|
|
breakthrough .
|
|
|
|
|
I am using a WTL list control.
when i use the control with records more than 10000, the application gets hanged, and it takes too much time.
Where the same code used with commctrl's listview, i have no problem in adding any number of records.
**************The code snipeet************************
for (DWORD i = 0; i < dwCount; i++) {
LVITEM lvi = {LVIF_TEXT|LVIF_PARAM}; lvi.iItem = i; lvi.lParam = i;
char text[0x8000]; lvi.pszText = text;
//State
lstrcpy(text,pStates[i]);
lvi.iSubItem = 0; lvi.iItem = (int)SendMessage(m_hwndListFiles,LVM_INSERTITEM,NULL,(LPARAM)&lvi);
//Name
WideCharToMultiByte(CP_ACP,0,pwszNameExt[i],-1,text,ARRAYSIZE(text),NULL,NULL);
lvi.iSubItem = 1; lvi.mask = LVIF_TEXT; SendMessage(m_hwndListFiles,LVM_SETITEM,NULL,(LPARAM)&lvi);
//Location
WideCharToMultiByte(CP_ACP,0,pwszLocation[i],-1,text,ARRAYSIZE(text),NULL,NULL);
lvi.iSubItem = 2; SendMessage(m_hwndListFiles,LVM_SETITEM,NULL,(LPARAM)&lvi);
//Size
SizeToStr(text,ullSize[i]);
lvi.iSubItem = 3; SendMessage(m_hwndListFiles,LVM_SETITEM,NULL,(LPARAM)&lvi);
}
*******************************ENd of code******************************
When i use this in project where common controls {commctrl.h} is used, it works in less than a second for 7000 records, but wen used in any VisualStudio Environment with WTL or MFC, it takes more than 100 seconds.
Can you help me on this.
|
|
|
|
|
Hmm.. I find this difference in times boggling. The WTL layer on top of the listview is extremely thin. You can easily verify this by looking at the source code for it. As far as I know, there are no "hooks" in WTL that hijacks the common controls code.
Is the listview control the same control (same code which instantiates it, etc) in all environments? If you are hosting a listview control in a WTL container window, it might have REFLECT_NOTIFICATIONS() in its message map. That would probably generate a lot of unnecessary callbacks to the listview control. If you are subclassing the listview, that too will add a small overhead (but nowhere near what you describe - unless the subclassed window's wndproc is fubared).
I have had the misfortune of loading 500+ items in a listview in an MFC project. The loading time is closer to 1 second than 100 seconds (maybe 2-5 if the database is congested). And that is on < 1 Ghz hardware.
May I ask where you get the data from? If it is already residing in memory, I would suggest to use a different strategy for displaying the data by using the LVS_OWNERDATA feature of the listview. It's slightly slower in repaints (not noticeable by the average user, but if you've lived and breathed CListCtrl for half a lifetime you'll notice it ), but is MUCH faster in initialization and destruction.
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|
|
I have implement IContextMenu::QueryContextMenu() and IObjectWithSite::SetSite() interface in Pocket IE.I want to get the URL when I right click a hyperlink,but I do not know how to implement this.Anybody can teach me??Anybody can help me??please!
Thanks a lot.I apologize for my bad English.
-- modified at 5:48 Tuesday 10th October, 2006
|
|
|
|
|
I am using WTL75 with Visual Studio 2005.
I have created all the UI controils and it works fine.
But in XP when when Windows XP theme is enabled the button is getting hidden. At an initial stage if we set the focus on to the button (by pressing tab or alt keys) it shows, but after that it never gets displayed.
Even if it is displayed, once when the parent window loses the focus and it retains the focus, the buttons are getting reased again.
Can anyone help me on this.
|
|
|
|
|
I use the following code to draw an icon on the Window.
HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_HELP), IMAGE_ICON, m_nButtonWidth, m_nButtonHeight , LR_DEFAULTCOLOR);
<br />
::DrawIconEx(hDC, 2, 2, hIcon, m_nButtonWidth, m_nButtonHeight, 0, NULL, DI_NORMAL);
This draws the icon on the Window. But my problem is that my window has a gradient background and my icon has a white background so when I draw the icon, the square shape of the icon with the white background is visible. I want to make the white portion of the icon transparent so that my Window background is visible. How do I do it?
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
|
|
|
|
|
Load up your icon in the VS6 resource editor, and change your white background to the "transparent" color, which is the icon that looks like a monitor filled with cyan towards the top of the color palette. That should work.
If you're not using VS6, then I'm not sure how to do it.
(Not sure why you were voted down for this).
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
|
You ve to use Alpha layer blending to the image to remove the background of the image. this should be done using the help of some grafix team.
Try using Alpha layer, thats the solution for this. filling the background with transparent color may npot be working all the time.
|
|
|
|
|
Dear All,
I want to write one COM with ATL Executable program or Service program.
Can one help me to get one exact easy article to do this ?
Kindly...
|
|
|
|
|
|
In the two places I have boldened below, should the code be checking for 'b' to be NULL instead of psz, after the call to T2BSTR ???
HRESULT ToLower()<br />
{<br />
USES_CONVERSION;<br />
if (m_str != NULL)<br />
{<br />
LPTSTR psz = CharLower(OLE2T(m_str));<br />
if (psz == NULL)<br />
return E_OUTOFMEMORY;<br />
BSTR b = T2BSTR(psz);<br />
if (psz == NULL)<br />
return E_OUTOFMEMORY;<br />
SysFreeString(m_str);<br />
m_str = b;<br />
}<br />
return S_OK;<br />
}<br />
<br />
HRESULT ToUpper()<br />
{<br />
USES_CONVERSION;<br />
if (m_str != NULL)<br />
{<br />
LPTSTR psz = CharUpper(OLE2T(m_str));<br />
if (psz == NULL)<br />
return E_OUTOFMEMORY;<br />
BSTR b = T2BSTR(psz);<br />
if (psz == NULL) return E_OUTOFMEMORY;<br />
SysFreeString(m_str);<br />
m_str = b;<br />
}<br />
return S_OK;<br />
}
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
Where you get this code from ? With VS2005 its different from what you have posted.
If at all there is code like this, then there is is bug. It should be checked with 'b'.
|
|
|
|
|
This code was lifted directly from the source for one of Microsoft's ATL libraries.
In this case, Visual Studio 6.0 - ...\VC98\ATL\Include\AtlBase.H
The function does not appear to be a problem in VS 2003 - it uses different algorithms - handling Unicode and other issues - see AtlComCli.H.
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
Yes, Now I can see it.
Is it is definitely a bug(Now we should say 'was', as VC 6 is no longer supported).
I wonder,How it goes unnoticed for such length of time.
May be, nobody is supposed to see implementation.
|
|
|
|
|
What documentation should i read?
Are there any books published (if yes, which ones should i buy),any good tutorials, where do i find the namespace's reference..?
Thanks
|
|
|
|
|
|
CodeProject site on the subject[^] is always a good place to start.
Before you begin you should be aware of what STL is in general.
STL stands for "Standard Template Library" and is a set of C++ templates to be used when creating common data structures such as arrays, lists, stacks, maps and so on.
If you don't know how to use templates and data structures mentioned above, or more important; when to use them, you should get yourself a book of basic C++ before taking the plounge into STL.
STL is like a toolbox with tools designed to solve different kinds of problems. You just have to know which tool to use in any given situation, otherwise the tool may become part of the problem.
Hope this helps
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|