|
Easiest: create your own view class that has a CSplitterWnd as child window. Saves hassle.
[edit] for nesting the splitters, it's enough to dereive a class from CSplitterWnd that is DynCreatable. or you use the MultiSplitWnd sample from http://www.cherea.de/bitbucket[^]
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
http://www.codeproject.com/dialog/visualfx.asp
from Zoran M. Todorovic
covers just about all the scenarios you might want
|
|
|
|
|
Dear All,
I have created an SDI application. On the menu when the user clicks "add", a dialog is called. On this dialog the user can add words to a list. When the user hits the insert button (which is located on the dialog), I want the list control on the SDI Form to be updated with the newly added text.
I guess my question is how i can access the control on the SDI form from a dialog that has been called
|
|
|
|
|
One solution is messages. Send a message from dialog box to main thread.
Kuphryn
|
|
|
|
|
Hello, I'm having a great deal of difficulty creating an MFC DLL with the Matlab Add in. I've seen the example where a EXE is created via the matlab add-in. Has anyone attempted creating such a project. Also how does one call and pass variables to a DLL from C. I've tried the pargma code method but to no avail. Any help would be greatly appreiciated.
Cheers
|
|
|
|
|
I designed a program and used ms datagrid control. I want to distribute software but I found it didn't work, is there anyone know how to register it??
Thanks.
|
|
|
|
|
Try creating a Visual Studio Installer[^] setup package for your app.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Copy c:\windows\system32\msdatgrd.ocx from you computer in the same directory of the other computer. Use %system% for windows 9xMe and %system32% for 2000 and XP. Then in ms-dos prompt type:
regsvr32 c:\windows\system32\msdatgrd.ocx
That should do it.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Ok here's what I got:
lvItemList.mask = LVIF_TEXT;
lvItemList.iItem = indexNumber;
lvItemList.iSubItem = 1;
lvItemList.pszText = localdate;
lvItemList.cchTextMax = strlen(localdate);
ListView_SetItem(hwnd,&lvItemList);
ListView_SetItem returns false???????? Why????? I can't find any information anywhere, and stepping through the assembly code has gotten me nowhere.
I use the exact same code in another dialog box, and it works like a charm. What am I doing wrong?????
Any help is greatly appreciated.
Thanks!
|
|
|
|
|
Just a grasp but are the other members of lvItemList "nulled" out? Something like:
LVITEM lvItemList = {0};<br />
lvItemList.mask = LVIF_TEXT;<br />
lvItemList.iItem = indexNumber;<br />
lvItemList.iSubItem = 1;<br />
lvItemList.pszText = localdate;<br />
lvItemList.cchTextMax = strlen(localdate);<br />
ListView_SetItem(hwnd,&lvItemList);
Is hwnd a valid window handle?
Also, since you are just setting the text of a subitem, why not use ListView_SetItemText() instead?
|
|
|
|
|
DavidCrow wrote:
Just a grasp but are the other members of lvItemList "nulled" out? Something like:
nope. trying that now. LOL
DavidCrow wrote:
Is hwnd a valid window handle?
Yes it is a valid handle. Wish I could say it wasn't but it is.
DavidCrow wrote:
Also, since you are just setting the text of a subitem, why not use ListView_SetItemText() instea
Yeah I tried that too, but it still doesn't set the subitem text. I have NO idea why.
|
|
|
|
|
will1383 wrote:
DavidCrow wrote:
Just a grasp but are the other members of lvItemList "nulled" out? Something like:
nope. trying that now. LOL
That's not working either. What the heck is going on? What else could I be missing? The function just retuns false with no error information returned from GetLastError or anything. This one's really got me stumped. Any more ideas?
|
|
|
|
|
Format a section of memory for the LVITEM structure.
memset(&lvItemList, 0, sizeof(lvItemList));
lvItemList.cchTextMax = 0;
Make sure the item and subitem indices are valid.
Kuphryn
|
|
|
|
|
kuphryn wrote:
Format a section of memory for the LVITEM structure.
memset(&lvItemList, 0, sizeof(lvItemList));
lvItemList.cchTextMax = 0;
Make sure the item and subitem indices are valid.
mmm.. trying away
|
|
|
|
|
ugh. Clearing out the memory isn't doing it either.
Would make sense if the handle was bad or a pointer or two was bad, but I can't find any problems with them. It would help if Microsoft would actually give more error information instead of a BOOL being returned. That's utterly useless in this case.
I'm passing in the pointer to the function that makes this call and just setting the lvItemList.pszText to it. I tried copying over the text to a local pointer thinking that might be the problem, but that ain't it either.
What else do I do?
|
|
|
|
|
Is there a way to force (or rather to ask Windows to use different fonts in certain controls?
In the actual case, I'd like to have a title or whatever with large letters in the main window area.
I changed the font size parameter definition in the dialog resource definition, but this applies of course to all controls.
I thought of overlaying the designated area with another windon containing the text, but
a) I don't see, how to make a window without any border, etc.
b) the wizzard changes the font size back again and again.
Pls don't suggest to make a bit-map image out of my text - that is the very last resort.
|
|
|
|
|
Have you looked at CWnd::SetFont?
I have never attempted to change the fonts of different controls but I have done it only with one control. I see no difference though.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
1. get the ctrl obj address
2. call SetFont function
e.g:
(if thats a CButton ctrl)
CFont m_TEFont;<br />
CButton *ptr = (CButton *)GetDlgItem(IDC_BUTTON1);<br />
ptr->CreatePointFont(100,"Courier New");<br />
ptr->SetFont(&m_TEFont,TRUE);
"Think big, think fast, think ahead. Ideas are no one's monopoly"
|
|
|
|
|
Thanks guys, I will try it.
Actually, I created a few "buttons" as bit-maps. It's a bit tiresome, but this way one can do anything - for example big letters and underneath small explanation, all in color, on the "button". However this "button" does not act as a real button, so I created overlay-bitmaps, which show a different state of the buttons (it does not show the button being clicked, i.e. pressed down, but it indicates, that this has been selected).
Anyway, I find it a bit sad to have to work so much for such trivias.
|
|
|
|
|
Hello,
I have a standard SDI project in VC6, based on the CFormView.
And I have made a set of my own Open file, save file, etc. menus.
However, I find, even I have removed the standard (which comes
when you create the project) "File" menu, but when I press "ctrl-O", "ctrl-p", etc, the corresponding default dialogs still comes up.
How can I stop them? I do not need them as I have create a set of my own.
Thansk a lot and have a nice day.
|
|
|
|
|
Sounds like you need to modify the accelerators, too.
|
|
|
|
|
I am writing a function, just suppose:
int Add(int a, int b)
{
return 3;
}
Now what i want is that this code get compiled if the compiler is Visual C++ 6.0 and not compile if the compiler is Visual C++ 7.0. With what macro i can detect that ??
Example if i want function to compile on unicode builds, i do something like:
#ifdef _UNICODE
int Add(int a, int b)
{
return 3;
}
#endif
|
|
|
|
|
I don't know what the version number for 7.0 is, but for 6.0 you can do the following
#if _MSC_VER > 1000
...
...
#endif // _MSC_VER > 1000
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"Microsoft hasn't ever enforced its patents. Apparently they keep them for defensive reasons only. Or, they could be waiting 'til they have a critical mass of patents, enforce them all at once and win the game of Risk that they're playing with the world." Chris Sells Feb 18, 2003.
|
|
|
|
|
Hello,
when I try compiling my project, the compiler says:
fatal error C1076: compiler limit: internal heap limit reached, use /Zm to set a higher limit
I looked in MSDN and have done what the compiler said: I set /Zm from 100 to 200 (100 is standard, 2000 is maximum as MSDN says).
But now I get another error:
fatal error C1002: no heap memory for compiler in 2. pass available
What could I do?????
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Dominik Reichl wrote:
I looked in MSDN and have done what the compiler said...
But have you looked at the other suggestions as well?
* Eliminate unnecessary include files, especially unneeded #defines and function prototypes.
* Eliminate some global variables. For instance, use a pointer to allocate memory dynamically, at run time, instead of declaring a large array.
* Eliminate unused declarations.
* Break up very large functions into smaller ones.
* Break up very large classes into smaller ones.
* Split the current file into two or more files and compile them separately.
|
|
|
|