|
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.
|
|
|
|
|
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
|
|
|
|