|
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.
|
|
|
|
|
what is the non MFC equivalent of AfxOleInit() ?
|
|
|
|
|
CoInitialize(Ex) for all the standard COM functionality, OleInitialize for "additional" OLE helpers.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Hi All
i have a list control, which contains a list of ID's which are numeric
i have this function below which i use to remove any duplicates from
the list, however its not working, does any one have any ideas
cos im being a bit thick today and its not always working
thanks in advance
simon
void CSelectStudents::remove_dups(void)
{
int count = 1;
bool bIdExists = false;
for (int f=0; f
|
|
|
|
|
Is this better?
void CSelectStudents::remove_dups(void)
{
for (int f=0; f<= m_studentlist.GetItemCount(); f++)
{
CString ID_DupStr = m_studentlist.GetItemText(f,3);
for(int i = f+1; i<= m_studentlist.GetItemCount(); i++)
{
CString ID = m_studentlist.GetItemText(i,3);
if(ID == ID_DupStr)
{
m_studentlist.DeleteItem(i);
}
}
}
}
Should be a bit more efficient.
James
|
|
|
|
|
Sorry, just realised that that doesnt work.
You need to take do the second loop in reverse otherwise you can lose position if stuff is deleted.
James
|
|
|
|
|
Thanks James
works a treat if u was a woman id marry ya
|
|
|
|
|
While you obviously know the overall project better than us, wouldn't it be a lot better to not allow duplicates in the first place?
|
|
|
|
|
I just installed VS.NET 2003 and am trying to compile an ATL/WTL project. But the compiler complains that it cannot find _resetstkoflw() which gets called in atlalloc.h. However, I have included malloc.h, and the compiler still complains. Has anyone had similar problems?
Best regards,
Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Never mind, the #include <malloc.h> must of course be above the line that includes atlalloc.h
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
For a standard MFC application, in the upper left corner
there is an icon. I know how to change the icon. How can
I make it not appear and move the text which describes the
program over to the left alittle more?
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
Remove WS_SYSMENU from the window style. But you will also lose the minimize and maximize boxes. Dont know if there is a way to remove the sysmenu and keep minimize and maximize. If some one else has that answer it would be interesting to know.
|
|
|
|
|
in
this msdn link
WS_MAXIMIZEBOX
Creates a window that has a maximize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.
WS_SYSMENU must also be applied.... So I guess theres no straightforward way . Though, I bet there's someone who can....
In here is where it could have been applied
Best of luck...
d.
|
|
|
|
|
I don't know any direct way of doing that.
But my idea is to just make the icon invisible.
In the icon eidtor, erase the icon (make it transparent).
But that way can not move the text. See if this fits your need.
|
|
|
|