|
A good general practice...! Except when dealing with poorly designed hand-off code (e.g. a function that returns allocated memory, and requires you to clean it up, like strdup(...) ).
Code that does that continues to be a problem even today (ever see someone forget to call SysFreeString(...) on an [out] BSTR pointer...?
Peace!
-=- James.
"Fat people are hard to kidnap."
(Try Check Favorites Sometime!)
|
|
|
|
|
Thanks.
I think it no cool that there is code that mishandles pointers.
Kuphryn
|
|
|
|
|
Is there a way for me to set a minimum size that a window can be resized to? I don't want the user to be able to resize the screen smaller than a certain size. Is there a way to set that to a fixed size that the user cannot pass?
|
|
|
|
|
handle the OnGetMinMaxInfo() message
"... and so i said to him ... if it can't dance and you can't eat it either f**k it or throw it away" 8028finder.com
|
|
|
|
|
I tried handling that but am unsure as to how to code for handling the message. I just called the OnGetMinMaxInfo() function and that didn't work. There is no WM_MINMAXINFO message or anything in the class wizard that I can use. Can you tell me how I might code for handling the message?
|
|
|
|
|
The message is called WM_GETMINMAXINFO.
You do not need to call that function, you will create a handler for that message, if you are using MFC that is what it would be called.
When you handle this message, there is a structure called <cod>MINMAXINFO. If you want to set a minimum size for the window, then you would change the value of the ptMinTrackSize parameters to the minimum height and width for your window. Then if the user tries to resize a window, it will not let them go any smaller than the size that you set.
This structure will also allow you to restrict the size and postion of the window.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I have put CListCtrl(report style) over the CTabCtrl, added a few pages
to CTabCtrl and tried to use it as a kind of dictionary (every page in tabctrl is a one letter). But there is a problem: I drag listctrl
header to the left, then back to the right (but I left the header a bit
further to the right ) and then the listctrl doesn't refresh properly.
I don't have the faintest idea what it's wrong. Thanks for any help and
sorry for my terrible English.
|
|
|
|
|
Does anyone know of any good (preferably online) references for developing Visual Studio Add-ins?
I have a specific add-in I want to develop, for VC6, but I'm not sure how to go about it. My Pre .NET MSDN doesn't seem to be too useful and the post .NET edition seems to be all about automation in Visual Studio .NET
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
Derek, have a look at WorkspaceWhiz http://workspacewhiz.com/WWhizInterface.html and WndTabs + Add-In Communication Library at http://www.wndtabs.com
I think you'll find some Add-Ins here at CP as well.
Hope that helps. What's your add-in do?
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Thanks for the links. I have looked at them already and I don't think they would help.
Basically there are a few areas that I need to deal with:
1. Detect when a dialog resource is being edited and show my add-in's toolbar.
2. Find the source file associated with the current dialog resource.
3. Edit the source file according to user actions in the resource editor.
In a nutshell I am developing an approach for adding automatic size/position updating and would like to develop an add-in to go with it that circumvents the developer having to add any code themselves.
I want some add-in development resources so that I can find out if what I want to do is even possible under VC6 and then find out how to do it if it is.
Any more ideas?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
The only other links I have are:
http://zmanagers.virtualave.net/
http://www.codeproject.com/macro/wwhizinterface.asp#xx25689xx
I haven't written any add-ins myself. You could also do a Google Search. I don't know if MS have ever documented this stuff very well, if at all. I wonder if it has changed in VS7!!
I don't see why you need an add-in to provide the capabilities you are refering to. Their are several article on CP and CG which address this issue. I've also written code in ED to do this automatically. My code works with any dialog and does not require any coding for specific dialogs. It uses a set of simple rules which dictate what controls should move when the user resizes a dialog.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Thanks for the links; they may turn out to be useful for another idea I have if nothing else
I'm well aware that the idea has been done several times before, I just have a slightly different spin on it
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
I have a wizard page created with the CPropertyPage class. I place a bitmap with the dialog editor at position (0,0). When running the dialog, the class places a border around the entire dialog, part of which contains the wizard pushbuttons. Thus my bitmap does not start at the upper left corner, but is offset by about 10 pixels X & Y.
- Does anyone know how I can load a bitmap starting at (0,0) on a CPropertyPage?
- Does anyone know how I can change the text of the Cancel pushbutton on a CPropertyPage?
Thanks in advance,
Bob
|
|
|
|
|
The bitmap is appearing in the correct place: location 0,0 of the Page. If you want the bitmap to appear at location 0,0 on the Sheet (the containing window that holds the buttons and the tab control), I believe you need to draw it manually from within the CPropertySheet -derived class. This is likely to cause problems, however, because the Sheet is not going to know that you are drawing things there.
You can obtain a temporary CWnd pointer for [Cancel] by calling GetDlgItem( IDCANCEL ) from within the CPropertySheet -derived class, after the Sheet proper has been created. Using that pointer, you can move, size, enable, change the text, etc. of [Cancel].
Peace!
-=- James.
"Fat people are hard to kidnap."
(Try Check Favorites Sometime!)
|
|
|
|
|
James,
Thanks for your response. I was able to place the bitmap on the property sheet. The problem is that when the pages get added, they overlay the bitmap. Is there anyway to have the pages added at some offset so they don't overlay the bitmap on the sheet?
Thanks,
Bob
|
|
|
|
|
Not that I know of, but you could place the bitmap/icon at the same location on each of the property pages. That is what I do...
Peace!
-=- James.
"Fat people are hard to kidnap."
(Try Check Favorites Sometime!)
|
|
|
|
|
We use MAKEFOURCC(c1,c2,c3,c4) to create a fourcc.
How can we get the four characters back from the FOURCC?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Use reference parameters or pointers
frisco wrote:
MAKEFOURCC(&c1,&c2,&c3,&c4)
|
|
|
|
|
How did you know to answer frisco's question before he even asked it
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
That's not what I mean.
FOURCC fourcc; (in fourcc there are four characters)
this gives something like this: 880175460
how can i retrieve the four characters from var fourcc?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
I guess Prem Kamur needs to refine his psycic abilities
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
char *strFourCC = reinterpret_cast<char*>(&fourcc);
Then you could index the four characters. It will not be a valid null terminated string because there is no NULL, but you could still do strFourCC[0] and so on.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I get syntax error on '('.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Sorry I forgot about the HTML formatting, here you go!
char *strFourCC = reinterpret_cast<char*>(&fourcc);
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
tnx
that's it allright
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|