|
|
hi all i had created the SDI application,i named the project "Test3" now in the title bar Test3-unitiled appear i want to change the whole Text to My own suppose "Toolbar 1 " etc how to do that throug the code,so that i can change that dynamically.
Tasleem Arif
|
|
|
|
|
Have a look in the string table resource - that'll contain the application name
|
|
|
|
|
Is AfxGetApp()->GetMainWnd()->SetWindowText("123"); your purpose?
|
|
|
|
|
Thanks it did worked
Tasleem Arif
|
|
|
|
|
|
i have tried to search the answer myself, and found an beginner's article "MFC under the hood" by Nishant Sivakumar. He explained Winmain() was defined in appmodul.cpp which can find in MFC\SRC directory :
extern "C" int WINAPI
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
// call shared/exported WinMain
return AfxWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
}
i understand that winmain() simply call AfxWinMain, but the code above is _tWinMain() not usual Winmain(). What is _tWinMain(), and where is Winmain()? help me please.
|
|
|
|
|
kumyim wrote: What is _tWinMain(), and where is Winmain()?
_tWinMain is probably the TCHAR version of WinMain() but why would anyone care? Why do you think you need to know "where it is"?
led mike
|
|
|
|
|
led mike wrote: Why do you think you need to know "where it is"?
When you are used to one language, in order to learn a second you need to know how it compares and how it works. The English word brother has three translations in Chinese, what do I care what the other two are when I only know one? I will tell you after I go and insult somebody!
|
|
|
|
|
Ok... MFC is NOT a language. but whatever I was just wondering.
led mike
|
|
|
|
|
I did not imply that MFC was a language, and I appologise if you missunderstood. What I meant to say is somebody who is used to coding in C, then start learning the MFC side of C++, is going to be very confused. MFC does a lot of work behind the scenes, many of the functions we have come to learn and accept are no longer required. In my opinion, in order to start learning MFC 'from another language', you need to know what the 'translations' are, or what functions an MFC method is actually calling.
|
|
|
|
|
waldermort wrote: and I appologise if you missunderstood.
Nah, you did nothing wrong. It's probably me.
led mike
|
|
|
|
|
i don't really agree with your demonstration here.
MFC hides the main() function, and if it does, it is certainly for good reasons.
you don't have to know "where is" main() nor "what it does". you only have to know "where to start when using MFC"...
|
|
|
|
|
toxcct wrote: MFC hides the main() function, and if it does, it is certainly for good reasons.
That is probably true. And I would also go as far as saying that if you are using MFC then you have no need to access the main() function. But...
toxcct wrote: you don't have to know "where is" main() nor "what it does". you only have to know "where to start when using MFC"...
... if you already know what main() does, how it's used and what exactly it's purpose is. Infact if you have come to believe (not quite true I know) that every program must have a main() fuction, then you start with MFC, aren't you going to wonder WTF?
If you are starting out with MFC and C++ as a first language, then you don't need to know nor will you care. But when it's a second language you will start translating what you know into what you are learning.
|
|
|
|
|
waldermort wrote: toxcct wrote:
you don't have to know "where is" main() nor "what it does". you only have to know "where to start when using MFC"...
... if you already know what main() does, how it's used and what exactly it's purpose is.
i still don't agree. MFC provides an additional abstraction level which you don't need to "crack" at all. if you'r curious about the internal, read the docs, they're full enough. as an example, when you use a Windows API, you read the MSDN, so you know exactly how to use what or what function, right ? but do you go every time to the sources to try to understand how they coded the API ? i hope no so !
also, you know the program entry point is main(). but did you know that a program start is not really main() ? do you know all the initialisations the operating system does for you silently ?
|
|
|
|
|
toxcct wrote: i still don't agree.
Each to their own I suppose. MSDN has a wealth of info, so I agree, there is no need to go to the sources. But understanding what is going on under the hood, in a way that you are used to, is helpful to learning. I'm not saying you must know what is happening behind the scenes, but if you already know and simply don't understand whats in the foreground, don't you think you would learn it a hell of a lot faster by knowing what functions the wrapper is calling?
toxcct wrote: also, you know the program entry point is main(). but did you know that a program start is not really main() ? do you know all the initialisations the operating system does for you silently ?
I did mention that in my post, perhaps you missed it
|
|
|
|
|
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)<br />
<br />
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPCSTR lpCmdLine, int nCmdShow)
The first works along side TCHAR and is able to switch between UNICODE and ANSI, look at the LPCTSTR. The second will only work with ANSI builds.
|
|
|
|
|
Have you looked in ...\Microsoft Visual Studio\VC98\MFC\SRC\Winmain.cpp?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
your answers were so helpful. yes, _tWinMain() is same as WinMain(). it was define in tchar.h in include folder.
thank alot.
|
|
|
|
|
hi,
iam intersted to lear Windows CE and eVC++ plz tell which books are good to learn
|
|
|
|
|
Hi.
One can add the Tool-tips for the controls present on the Tool bar. But
How to add the Tool-tip for the Pushdown buttons present on the dialog box?
Thanks.
Rakesh
|
|
|
|
|
Rakesh_Thakur wrote: One can add the Tool-tips for the controls present on the Tool bar. But
How to add the Tool-tip for the Pushdown buttons present on the dialog box?
Hope this[^] helps.
|
|
|
|
|
You need to create tooltip and set TOOLINFO and Send TTM_ADDTOOL
|
|
|
|
|
hi;
i'm using dynamic c to program a rabbit IC
in my program i use rtc, the real time clock, but reasently we all changed form summer to winter time, and i thought that the rtc changed allong with my pc when i would compile and download it again but it doenst.
How do i change this, and not by just setting the hour myself everytime i download it, like in a sample of dynamic c manual
anybody an idea??
thx alot
grz muk
|
|
|
|
|
There are plentry of time functions here. I suggest you code up a little demo application to see how they all work.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|