|
Hi,
Please forgive me any redundancy or newbie naivete, but i am having a problem with setting text in a static field in a dialog with the full pathname retrieved by a call to GetPathName() member of the CfileDialog class. Specifically, a path such as:
D:\Program Files\Microsoft Visual Studio\MyProjects\CmodConverter\Debug. It gets truncated to:
D:\Program Files\Microsoft Visual.
I presume this is due to a long-filename issue since d:\celestia\models\cassini.3ds works fine.
Any ideas?
Thanks,
Sean
Firefly, Stargate, Farscape: in that order
|
|
|
|
|
It sounds like you need to make the static control wider.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hmmm,
It seemed big enough but i did not check it with that big a string - i will experiment further. Also, I was wondering about the backslashes in the path - could an escape sequence be happening? I will fiddle with that notion too...
Thanks for the reply!
Sean
Firefly, Stargate, Farscape: in that order
|
|
|
|
|
smbika wrote:
Also, I was wondering about the backslashes in the path - could an escape sequence be happening?
No, that only applies to string literals in the code.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks again for the help - it was indeed the size of the field, but i did find i had to change the slashes to double slashes or they did not show up - sigh...
I have another problem which i will begn another thread on...
lemme know...
Firefly, Stargate, Farscape: in that order
|
|
|
|
|
darn it - looks like i was wrong about the double slashes too - sokay - as long as it works and i have learned
thanks again and my apologies for the mistake...
Sean
Firefly, Stargate, Farscape: in that order
|
|
|
|
|
Hi,
I am using a frame, which is an inherited class from CFrameWnd, in an
MFC application.
When I open & close the frame, there are few extra GDI objects & User
objects that gets created. That is, when a close is performed, all
those user objects & GDI objects created do not get lost. I am
monitoring this using the Windows Task Manager itself.
Presuming a memory leak, I tried stepping thru the code to notice any
memory leak but that is not reported either...
Can somebody please help me with some pointers regarding this...?
Sailu
|
|
|
|
|
Does it leak the GDI objects everytime you open and close the frame or just the first time. If it is just the first time then it is nothing to worry about and is just MFC keeping handle to things that it will reuse.
If the GDI count keeps going up with repeated open/closes then you do have a probelm.
Mike
|
|
|
|
|
Yes. It indeed keeps going up with repeated open/closes.
Any ideas as to how do I exactly zero-in to the cause...???
-Sailu
Mike Beckerleg wrote:
Does it leak the GDI objects everytime you open and close the frame or just the first time. If it is just the first time then it is nothing to worry about and is just MFC keeping handle to things that it will reuse.
If the GDI count keeps going up with repeated open/closes then you do have a probelm.
Mike
|
|
|
|
|
Try posting some code for us to have a look at.
|
|
|
|
|
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)
|
|
|
|