|
p->name is chinese word as
char name[32];
int idname;
m_role_file.FindFirst();
while (m_role_file.FindNext(idname))
{
CRole *p = m_role_file.Find(idname);
HTREEITEM treeitem;
treeitem=tree_ctrl->InsertItem(p->name,p->rolenum+2+6,p->rolenum+2+6,root2);
tree_ctrl->SetItemData(treeitem,ROLE_ITEM+p->rolenum+1);
}
|
|
|
|
|
Hmm...
I can't help you with the problem, because I don't think you've provided enough data. What was the word you tried to add for instance?
But asides from that, considering you are working with chinese words, wouldn't Unicode be better suited for your needs?
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Hi,
I have read a lot of articles and "Tips" but nothing couldn't help me. I use the Stringtable for my ToolTipTexts and have a modal DialogBox.
I've the following problem: I nedd ToolTips with more than 80 characters.
---------------------------------------------------
Inside the PreTranslateMessage function I call the RelayEvent function of the CToolTipCtrl-Class and inside the OnInitDiaog i registered and attached a Tool to the created CToolTipCtrl-Object. And I also used the SetMaxTipWidth(). And everything works fine but only with 80(!!) characters.
----------------------------------------------------
Can anybody help me to overcome this problem?
Thank you!
|
|
|
|
|
I am using the procedure "CreateWaitableTimer" in my program. When I try to compile it in VC++ ver 6.0 under windows 2000 ver5, service pack 2, it gives the error "undeclared identifier" inspite of the following:
->The library "kernel32.lib" has been linked in Project Settings.
->The header "winbase.h" has been included.
->The following Macros are defined before including "windows.h".
#if !defined _WIN32_WINDOWS
#define _WIN32_WINDOWS 0x0500
#endif
#if !defined _WIN32_WINNT
#define _WIN32_WINNT 0x0500
#endif
It will be great if anybody can help me to sort out this problem.
Thanks
|
|
|
|
|
sampal wrote:
#if !defined _WIN32_WINDOWS
#define _WIN32_WINDOWS 0x0500
#endif
#if !defined _WIN32_WINNT
#define _WIN32_WINNT 0x0500
#endif
Both of those preprocessor directives already have values so your code is not going to work as expected (i.e., they will only get assigned a value if they do not already have one). Remove the #if directive. Are those statements included before any other #include , not just windows.h ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
The error continues to appear even after removal of #if. These statements are not included before any #include.
|
|
|
|
|
sampal wrote:
These statements are not included before any #include.
They should be. Otherwise, they have no effect.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Visual Studio 6 predates Windows 2000. You need to update your SDK headers, which you can from Microsoft Platform SDK Update[^]. If you already have up-to-date headers, you need to ensure that they appear before the ones in the Microsoft Visual Studio directory in the Include Directories section of Tools/Options.
Security/fix note: by the way, you should be running Service Pack 4.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi everybody, I'm trying to compile a a C++ application with MS Visual Studio .NET 2003 Architect.
First I compiled a library (.lib), then I used this lib to develop an application.
During the linking operation I obtain this error message:
libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in geardebug.lib(text.obj)
(where text.obj is part of the lib I developed)
Can anybody help me to understand why this happens?
Thank you very much
|
|
|
|
|
Has anyone ever used return in a constructor? Is there anything special about this? I would assume that it skips the execution of the code below and returns a pointer to the object. Is this correct?
Thanks,
j
|
|
|
|
|
While it would be syntactically correct, it doesn't make much sense.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks for the reply, but I am still not sure. I am reviewing some code and this person uses return in a lot of constructors. But, I am with you.
|
|
|
|
|
patnsnaudy wrote:
I would assume that it skips the execution of the code below and returns a pointer to the object.
What do you mean by that? Constructors return nothing.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
ctor::ctor()<br />
{<br />
...<br />
do some stuff<br />
...<br />
if(true)<br />
{<br />
return;<br />
}<br />
...<br />
do some more stuff<br />
...<br />
}
I assume that "do some more stuff" would not get executed.
|
|
|
|
|
patnsnaudy wrote:
I assume that "do some more stuff" would not get executed.
Correct! Since if (true) is always true. it will return without executing "do some more stuff"
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
That's correct. But you also wrote and returns a pointer to the object, which is not true.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
I guess that I meant when you new the object that a pointer to the object would be passed back. The one thing that I thought return in a ctor may do is pass back null and not create the object
so:
ctor a = new ctor(); // thought that it was possible that a would be null if ctor called return, but now I know that is not the case. I could have tested it, but didn't want to spend the time.
|
|
|
|
|
All it will do is prevent the execution of code after the return statement. I consider it a bad practise, but I have seen developers use it whilst debugging.
Michael
CP Blog [^]
|
|
|
|
|
That's the answer I was looking for. You win the prize
|
|
|
|
|
Hello friends,
I had 4 image files stored in C:\windows\ directory. I want to display these images in a CListView. The main problem I am facing is the Whenever I resize the view, my images has to be resized automatically without disturbing the aspect ratio while displaying or loading the images.
Please help me.
Thank you,
Neelesh J Jain
Work Hard and a bit of luck is key to success
|
|
|
|
|
Does anybody know how to get the text from StatusBar with SBT_OWNERDRAW style?
any suggestions?
4apai
There're no impossible tasks. There're tasks that required infinite period of execution time.
|
|
|
|
|
Hi to all. This is a generic c++, rather a vc++ guestion, but i did not found another category to post it.
Is well known that c++ is (general) slower that Fortran in numerical calculations. I benchmark my code and i found that the Fortran implementation is at least 3 times faster.
The programm performs numerical calculation with floating point numbers, uses 3d or/and 4d arrays of doubles (actually arrays of pointers allocated dynamically with new operator). Sizes varies, but is typical the case 50x50x40x19 or greater.
There are a lot of routines that uses 3 or/and 4 nested for-loops where manipulations within arrays are taking place.
Searching the web i found that are existing a lot of array templates specially desinged for numerical computing purposes, but (as always) allmost no one is suitable for Microsoft's c++ compiler and Windows operating system.
Is there any ideas about how i can boost the code?
I have tried intel compiler but the difference is small...
Thanks in advance for any ideas....
|
|
|
|
|
Which version of VC++ are you using? VC++ 7.1 should be able to compile most of numeric template libraries (MTL, Boost uBlas, Blitz++).
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Now i'm using Visual Studio 2002 .Net. I will move to 2003 .Net just to try Blitz++....
|
|
|
|
|
Hi !
I have a vector like :
vector<myclass*>
I need to return this vector as :
vector<const myclass*>
but I don't see any easy way to do it ! Do I really have to take each item of the original vector and add it to the target vector, converting it to const in the process ?
Thanks for your help !
Jerome
|
|
|
|