|
Unable to use it.
error C2065: 'CString' : undeclared identifier
|
|
|
|
|
What version of Visual C++ are you using?
Maxwell Chen
|
|
|
|
|
|
OK. You chose not to support MFC in the project settings.
You can use the C style formatting.
If you need to treat strings as objects, you can use std::string from <string> header. But the format way differs.
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: you can use std::string from <string> header. But the format way differs
sure it does, there's no format() function in the STL's string class.
but Boost provides one.
however, in case you didn't read the whole thread, CString is a ATL class, so it is still usable in a ATL project...
|
|
|
|
|
toxcct wrote: however, in case you didn't read the whole thread, CString is a ATL class, so it is still usable in a ATL project...
I just created an ATL project (EXE) with VC++ 2005.
No it does not recognize CString.
Error C2065: 'CString' undeclared identifier.
#include <altstr.h>
Maxwell Chen
|
|
|
|
|
Ok., why using CString causes error?Is there any header file is missing?
|
|
|
|
|
#include <atlstr.h>
Maxwell Chen
|
|
|
|
|
Ya!! it solves the problem!
|
|
|
|
|
include the correct header buddy !
|
|
|
|
|
#include <atlstr.h>
Thanks!
Maxwell Chen
|
|
|
|
|
Sakthi_Vel wrote: For ATL program with no MFC support.
Starting from Visual C++ .NET, I think that ATL and MFC have merged together.
Maxwell Chen
|
|
|
|
|
Try using std::stringstream or boost::format[^]!
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
1) please read the thread before answering
2) what you suggest has already been proposed
3) CString works fine however, as it is an ATL class though.
|
|
|
|
|
toxcct wrote: 1) please read the thread before answering
Guilty
toxcct wrote: 2) what you suggest has already been proposed
Not really - you did just barely mention it with: "but Boost provides one".
I gave the link
toxcct wrote: 3) CString works fine however, as it is an ATL class though.
Thats true, but he explicitly asked for formating other than using CString but for the wrong reason
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
|
I need to free memory in CMyListCtrl.
void CMyListCtrl::OnDestroy()
{
UnInit();
CListCtrl::OnDestroy();
}
It's ok, but the comments says to add code after called CListCtrl::OnDestroy
So I try to find another way
BOOL CMyListCtrl::DestroyWindow()
{
UnInit();
return CListCtrl::DestroyWindow();
}
But it is not called by the framework.
Where should I do UnInit in this sample?
|
|
|
|
|
What is done in the UnInit()?
|
|
|
|
|
It calls GetItemData, so UnInit should be called before CListCtrl is destroyed.
I'm finding a right place to call UnInit .
|
|
|
|
|
GetItemData should be called before the call to CListCtrl::OnDestroy()
void CMyListCtrl::OnDestroy()
{
GetItemData( 0 );
CListCtrl::OnDestroy();
GetItemData( 0 );
}
|
|
|
|
|
Of course you should delete your own data before call the base class's OnDestroy function.
Your own data should be deleted first, and then the listctrl's internal data.
A Chinese VC++ programmer
|
|
|
|
|
Dear all
i have one file which includes a 150x4 array in D driver, how can i open it and print on the screen? that means i just want to see the output is right or wrong,thanks a lot.
my file was saved as excel formate.
Li Zhiyuan
11/1/2008
|
|
|
|
|
li zhiyuan wrote: my file was saved as excel formate.
True excel format (.xls) or CSV format (.csv)?
Maxwell Chen
|
|
|
|
|
.xls, microsoft office excel workbook is type
Li Zhiyuan
5/10/2006
|
|
|
|
|
Hi all,
Does anybody have any experience with Application Memory Management using a proprietary database?
We have hit a bit of a snag using the 2gig process address space with our product for customers who have large amounts of data. Our server manages several databases, each with 200+ tables, and up to 65,000 records in each table. Currently, when the server fires up, we load in all the databases into Virtual Memory regardless if they're needed or not. As part of the load process, we "reserve" the maximum number of possible memory for each table so we can easily add records to the end that table. We only commit to the number of records that are active. Problem is, Windows will only allow us to "reserve" up to the 2gig mark.
We've considered a few options:
- including only loading in the required databases - but it IS possible that at any given time, all databases will be required (Client/Server application).
- Writing a mechanism that would leave not recently used tables on disk until required.
- Use a process for each database - could get messy with mutex's etc.
A few questions:
- Does anybody have any experience here? What kind of mechanism does your software use?
- Is there a way to elegantly go beyond the 2gig limit?
- How does SQL/MySql handle large databases - ie: When a new record is added to the table - does it append the new record to the end of the allocated memory block?
Unfortunately for our market, the evil proprietary database is the way to go. We're not in a position to change to migrate to anything new at the moment.
Any information/suggestions you might have would be greatly appreciated.
Thanks.
Mike.
|
|
|
|