|
Ok, Thanks for your help. Would you happen to know how to access this event? I wouldn't mind writing a program that cleans up the file right after each save.
-Jack
There are 10 types of people in this world, those that understand binary and those who don't.
|
|
|
|
|
Check out the add-in documentation. You probably could also do this as a macro, but I don't remember how (the last Visual Studio macro I wrote was three years ago.)
|
|
|
|
|
If you are working with Unix and Windows at the same time, I recommend you installing Cygwin[^].
One of their utilities is u2d and d2u (Unix to Dos/Dos to Unix), which make the conversion you need.
I know that installing Cygwin just for this is overkill, but I think you should give it a try, since it can really ease when you are working with multiplatform code.
It's not the fall that kills you: it's the sudden stop - Down by Law, Jim Jamursch (1986)
|
|
|
|
|
I'm trying to find a way to programatically turn on/off the "Show Web Content" from the active desktop. Essentially seting the check in the system menu under Active Desktop.
|
|
|
|
|
|
A little confusion.
We can override OnOk(), or PreTranslateMessage(), but not SetWIndowText() right? What makes a function overridable? Is it that only event handlers are overridable? I'm reading about the word "virtual" but dont see it in the members of say CWnd...like GetWindowTExt etc. I looked in "Input Message Hanfdlers" which has functions like OnHScroll, OnKeyDOwn etdc which are ones that I've seen overridden yet they dont say "virtual" in the declaration (in MSDN)
Appreciate your help,
ns
|
|
|
|
|
|
Thanks for the link....
Actually I looked up OnChar in afxwin.h and its not got a "virtual" but its
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
and I believe its a function we can override. SO having the keyword "virtual" isnt necessary to make a function overridable it seems.
Appreciate your help,
ns
|
|
|
|
|
ns wrote:
and I believe its a function we can override. SO having the keyword "virtual" isnt necessary to make a function overridable it seems.
No, you can't override the function, what you can do is have an handler for it in the CWnd derived class you have.
you can only override virtual methods.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Providing a handler is not the same as overriding. Thats also a place I wasnt clear about. Thanks for this info!
Appreciate your help,
ns
|
|
|
|
|
ns wrote:
SO having the keyword "virtual" isnt necessary to make a function overridable it seems.
true, sortof.
the virtual option affects who calls your override. if you override a non-virtual function, your function will not be called if the caller thinks he's using a base-class object. ie. if the caller only has a CWnd pointer and calls a non-virtual function on your CMyWnd object, he will end up in the base class function, not your override. the effect of the virtual keyword is to allow callers without knowledge of derived classes to call function in the derived class.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
virtual only applies when the object is being passed as a reference to it's base class.
Say you have a base class foobase, and a derived class fooderived,
and you have a virtual override of OnOk() in your fooderived.
The virtual means that the virtual function will be selected if the fooderived is passed to a function that needs foobase as a param.
The fooderived is casted to foobase, but all virtual functions in fooderived will take precedence even though your fooderived is being cast as a foobase.
hey
|
|
|
|
|
Remember that MFC is a thin wrapper over the Win32 API. MFC's CWnd class provides virtual functions that can be overridden in your derived class, as you already know. Some of these virtual functions are actually callback handlers, such as OnSize() , OnGetMinMaxInfo() , etc. They are what get called when a WM_SIZE , WM_GETMINMAXINFO , etc. message is sent/posted to the window.
Now to the interesting part...
MFC provides a back door to allow you to handler *any* Windows message, not just one that's handled by a provided overridable. This is done by the virtual function OnWndMsg() . You can provide custom handling for WM_SETTEXT here. Just be sure to call the base class method for all other messages, or else you could have some seriously weird windowing behavior on your hands!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
All the responses were really informative and helpful. I think lightbulbs are going on in me mind....
ns
|
|
|
|
|
My program is a small GIS and I was using GDI to display maps and informations. Now I would like to use GDI+ and I didn't find any function to draw a pixel ? Do I have to use GDI to draw pixels and GDI+ to draw the other stuff ?
Thanks !
|
|
|
|
|
You can use Graphics.SetPixel, but it is quite slow. You can also use Bitmap.GetData, which returns a BitmapData object, whose Scan0 property is a pointer to the bitmap's data (in BGR format, not RGB format).
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
can't seem to add an about dialog to the system menu. (all I have is MOVE and CLOSE.
This is what I have done:
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
|
|
|
|
|
In .NET if I want my class to inherit from theinterface IDisposable, and also to be derived from a base class MyBaseCLass
Separately if I only were deriving from one I know it would be:
myDerivedClass:public MyBaseClass
and
myDerivedClass: public IDisposable
But how would I have both together (syntax)?
Appreciate your help,
ns
|
|
|
|
|
myDerivedClass : public MyBaseClass, public IDisposable
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
|
I just installed VC 6.0 (SP 5.) on a Win2000 PC and the compiler will not execute. Error says something about vcspawn.
NE1 have this problem or know of a solution?
|
|
|
|
|
[EDIT]oops, I forgot the correct directory is MSDEV98, not MSDEV.[/EDIT]
The installation probably failed to install VCSPAWN.EXE, which is the program used to control the compiler and linker. Just copy it directly off your CD into the "\Program Files\Microsoft Visual Studio\Common\MSDEV98\BIN\" directory.
Or, if you don't feel like that is a good solution (or the installation is more messed up than just that one file), just reinstall VC6.
Chris Richardson
You can stash and you can seize
In dreams begin, responsibilities U2 - Acrobat[^]
Stop being PC and accounting for everyone and his momma's timeframe. Just enjoy your - Rohit Sinha in the content-challenged thread
|
|
|
|
|
I am a C++ programmer trying to get familiar with VS 7.0 (I have previously been working in 6.0). I cannot seem to get any macro to work in VS 7.0. I had some from 6.0 that I tried to use and I have also tried using samples macros and nothing happens. I get an hour glass for a second or two and then nothing. Is there something I'm not aware of?
|
|
|
|
|
The object models changed dramatically between VC6 and VS.NET. I had to rewrite my macros from scratch.
This was less painful than you might think. A number of my macros were no longer necessary. For example, I had one that did a 'find and replace' in all of the open documents. That functionality is builtin now.
Software Zen: delete this;
|
|
|
|
|
I second that ... I had to rewrite most of mine from scratch too. Again, it wasn't too difficult and there were a few that were thrown out because the editor supported the functionality.
Good luck
Give me one more medicated peaceful moment
|
|
|
|