|
you can use ATL::CString in your project i.e. ISAPI dll!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Bram, since you're still using VC5, CString isn't available separately from the MFC library.
Starting in VS2002 or VS2003 (I don't remember which), they moved CString out of the MFC library and into the ATL.
Software Zen: delete this;
|
|
|
|
|
Thanks Garry,
Good from you to remember that I still use VC5.
Santa has been and gone and did not leave a compiler package under the tree.
Hopefully, the Easter bunny is more generous, ( or Maybe St Valintine, although he HAS been very good to me in finding me a partner in Love,Life and Business) or even St Patric if all else fails.
Seeing that I use MFC as a DLL, I think that afterall the overhead is not all that big, so I included 'afx.h' in 'stdafx.h', and deleted 'windows.h' Code back on track with minor modifications!
Thanks again, and a happy 2008 for you and yours
Regards,
Deirdre
+
Bram van Kampen
|
|
|
|
|
Hello.
my prob that i can't change the default caption of my application on the main bar.
So how could i change it to smth like "BioHazard Engine"
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
The text can be set when the window is created, and can be
changed later with SetWindowText() or WM_SETTEXT.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
So, how Could i use the fuction SetWindowText ?? shoud i create any specific handler or what ?
Thx
IO found This Peace of code
#include <afxpriv.h>
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
AfxSetWindowText(m_pMainWnd->m_hWnd,"TestSDI- Farscape");
but i dont know what is the Type of the var m_pMainWnd. My prog is calles AUTO so i have AUTODOC AUTOVIEW & AUTOAPP classes
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
When a window is created, you get a window handle (HWND).
You can use that handle in a call to SetWindowText():
::SetWindowText(hwnd, _T("My Window Title"));
If you're using MFC, and you've created your main window in
the usual way, you can use something like this:
if (AfxGetApp()->GetMainWnd())
AfxGetApp()->GetMainWnd()->SetWindowText(_T("My Window Title"));
No message handlers are necessary - just call it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank You, for ur helps, but just one more think, where should i insert your code.
I'm usinf MFC.
Ok i tried to put it as follow. but no changes
void CAutoView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
if (AfxGetApp()->GetMainWnd())
AfxGetApp()->GetMainWnd()->SetWindowText(_T("BIOHAZARD"));
}
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Ok i think that i have to put it into OnPaint() Funct. and now it works
Thank you again. God bless you
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Blood_HaZaRd wrote: Ok i think that i have to put it into OnPaint() Funct. and now it works
Hence, do you update the window caption each time the window is painted?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I know that is not a well done job but it's the only funct where it works. does it exist another one. ?
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
That should have worked.
Change the window title wherever it's appropriate.
Changing it in a view class' OnInitialUpdate() might not be appropriate unless
you want the title to change every time a new view of that class is created.
OnPaint() is a bad choice since you most likely don't need to set the title
every time the window needs repainting.
If you want one title for the lifetime of the app, you could do it
when the main window is created (generally in your CWinApp-derived class'
InitInstance() override).
Also, if you're using the doc view architecture, MFC, by default, will adjust
the title when the active view changes. To avoid this behavior, change
the frame window style to exclude the FWS_ADDTOTITLE style. For info on how
to do that, see How To Change Window Attributes in an MFC Application[^].
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
although i am using .net c++, i want to run application while .net framework isn't installed on the another machine. anyone knows, is it possible?
thanks.
|
|
|
|
|
When you create the project, choose a Win32 application type.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
i tried and tested however it couldn't run. i changed framework configuration but not run agin. is it necessary to change any configuration?
|
|
|
|
|
darkonoid wrote: i tried and tested however it couldn't run. i changed framework configuration but not run agin. is it necessary to change any configuration?
You have to build a win32 unmanaged application, i.e. a native application, that doesn't need the framework at all. With C++ you can do this: On Visual Studio IDE, choose menu item File->New->Project and then, on the newly appeared window, for instance, Win32 project (or one using MFC ).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
i see what you mention, but it doesn't work, that you tell
|
|
|
|
|
In fact it works as I told. I've done a lot of programs that way.
The only caveat maybe the runtime version: you have two options, link with the static version of the runtime (/MT option) of compiler command line or deploy the runtime DLL toghether with your application.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Any app you create with the .net framework is going to need the framework runtime. No way around that.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
i think, visual studio 6 isn't capable platform, do you recommend any platform or add-ins or plugins etc.?
|
|
|
|
|
darkonoid wrote: visual studio 6
You never mentioned it before. Yes, VS 6 is not capable.
darkonoid wrote: you recommend any platform
Yes, make the move to VS 2005/2008.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
how can i run applications any other windows versions, without .net framework
|
|
|
|
|
What is it you are trying to do? Are you trying to develop .net apps to run on any version of windows?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
i want to use .net platform but my applications can be run windows that isn't installed .net framework
|
|
|
|
|
darkonoid wrote: i want to use .net platform but my applications can be run windows that isn't installed .net framework
Like I already said earlier. You will need the .net framework installed in order for the apps to work, no real way around it. There are commercial products out there that for the money, just end up encapsulating the .net framework in the .exe. It is really not worth the money. Bear in mind that the .net framework runtime will not work on windows versions older than Windows 98.
I hope this answers your question.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|