|
Thanks.... a lot....
Giulio
|
|
|
|
|
Di nulla.
Carlo
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Ing.Raiz82 wrote: ...the canc button in list box?
What exactly do you mean by this?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi All,
I have a Dialog with a listBox, Now i want to give the user an option of deleting an entry from list by selecting it and hitting the delete key in the key board? Can Any one help me on this?
Thanks.
|
|
|
|
|
You need to handle the key press - you can override OnVKeyToItem in your dialog
afx_msg int OnVKeyToItem(UINT nKey, CListBox* pListBox, UINT nIndex);
Something like
int CMyDlg::OnVKeyToItem(UINT nKey, CListBox* pListBox, UINT nIndex)
{
if( nKey == VK_DELETE )
{
pListBox->DeleteString( nIndex );
}
return CDialog::OnVKeyToItem(nKey, pListBox, nIndex);
}
(You'll also have to set "Want Key Input" to true in the properties for your list box in the resources editor)
|
|
|
|
|
Thank you some much...
in fact the message WM_KEYDOWN don't work... i think for the focus on the listbox...
now i try OnVKeyToItem...
thanks..
|
|
|
|
|
Hi all,
I'm trying the following without success and I have no idea why
Could someone please help.
Many thanx ...
Sorry about that - miss type....
<code>
char string[100];
struct
{
char fileStr[100];
}gList[100];
for loop
{
strcpy((char*)string,(char*)gList[x].fileStr);
strcat((char*)string," OK");
...
}
OUTPUT EXAMPLE: testFile.txt OK
</code>
-- modified at 9:19 Monday 27th November, 2006
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
can you include the declaration (and perhaps the definition...) of responseBirstring ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I have corrected the code snippet above,
But not even this wants to work....
gBirList[x].BirfileNames would have the following in it...
ex:
file1.txt
file2.txt
file3.txt
file4.txt
file5.txt
file6.txt
<code>
loop...
strcpy(gBirList[x].BirfileNames," OK");
</code>
OUTPUT EXAMPLE:
file1.txt OK
file2.txt OK
file3.txt OK
file4.txt OK
file5.txt OK
file6.txt OK
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Sorry but I cannot see the declaration (and maybe the definition) of your target string yet, you are a little bit vague...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
You should be able to sort it out by using the debugger.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
LOL ... Now that is a KAK answer ... Obviously not...
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Well, what does string look like after this statement:
strcpy((char*)string,(char*)gList[x].fileStr);
And if you step into strcat, what happens in this statement:
strcat((char*)string," OK");
?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I receive the following:
First-chance exception at 0x00437842 in CompServerApp.exe: 0xC0000005: Access violation writing location 0x005c0bf8.
Unhandled exception at 0x00437842 in CompServerApp.exe: 0xC0000005: Access violation writing location 0x005c0bf8.
When I step into strcpy...
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
This works for me, I just tested it.
char string[103];
struct{
char fileStr[100];
}gList[100];
strcpy(gList[0].fileStr, "FileAtIndex0");
strcpy(gList[1].fileStr, "FileAtIndex1");
strcpy(gList[2].fileStr, "FileAtIndex2");
strcpy(gList[3].fileStr, "FileAtIndex3");
strcpy(gList[4].fileStr, "FileAtIndex4");
strcpy(gList[5].fileStr, "FileAtIndex5");
strcpy(gList[6].fileStr, "FileAtIndex6");
for (int i = 0; i < 5; i++) {
strcpy((char*)string,(char*)gList[i].fileStr);
strcat((char*)string," OK");
}
Are you sure your x doesn't get oout of bounds (is less than 100) ?
(Your debugger will tell you... )
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Check that none of your filenames are longer than 97 characters - any longer and your string will overflow, and random badness can happen
it'd be better if you changed your code to be
char string[MAX_PATH+4]; // space for a filename, plus " OK" plus null terminator
..
char fileStr[MAX_PATH];
MAX_PATH is defined to be the length of the longest legal filename+path in Windows
|
|
|
|
|
Programm3r wrote: strcpy((char*)string,(char*)gList[x].fileStr); strcat((char*)string," OK"); // Unhandled Exception
You only have room for 99 characters, plus a nul character, in string .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thank you all, found the problem...
Many thanx
Regards
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
|
Something that could be found easily by using the debugger, i guess...
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Hi to all,
How to change the font of some Menu Items using VC6?
I want to make some menu items Bold. How to do it?
Thanks & Best Regards,
Aniket Salunkhe
|
|
|
|
|
Visit this site...
http://www.codeproject.com/menu/
bye...
Giulio
|
|
|
|
|
I have search there. But I didn't found anything regarding Changing font of Menu Item OR Making a Menu Item Bold!
|
|
|
|
|
Hi, I've got some Problems with CPropertySheet in the development of a C++ application in emVC++.
Problem is:
I have a PropertySheet width 4 pages (all same size 260*92); but they all get cut of at the right side.
So I startet do derive a class from CPropertySheet and overwrite the OnInit Method like in this project: Free size and extended styles in CPropertySheets
This brought me a few Problems:
- the CPropertyPage* pppg = GetActivePage(); causes access violation so I changed it into CPropertyPage* pppg = GetPage(0);
(curious from outside, in the dialog class i can use GetActivePage(), inside I only get a 0x0 pointer)
- also the pppg->MapDialogRect(rcOriginal); causes access violation and all other Methods that later on uses pppg too.
This brings me down to the problem that I cannot read out the PropertyPage size on runtime and have to use fixed values to resize.
so only these lines had been left from all the code:
<br />
BOOL bResult = CPropertySheet::OnInitDialog();<br />
<br />
ModifyStyleEx(0, WS_EX_TOOLWINDOW);<br />
CRect rcModified;<br />
<br />
GetTabControl()->GetWindowRect(rcModified);<br />
ScreenToClient(&rcModified);<br />
rcModified.right +=50;<br />
GetTabControl()->SetWindowPos( NULL, 0,0, <br />
rcModified.Width(),<br />
rcModified.Height(), <br />
SWP_NOMOVE | SWP_NOOWNERZORDER | <br />
SWP_NOZORDER | SWP_NOACTIVATE );<br />
<br />
<br />
<br />
GetWindowRect(rcModified);<br />
ScreenToClient(&rcModified);<br />
rcModified.right +=50;<br />
SetWindowPos( NULL, 0,0, <br />
rcModified.Width(),<br />
rcModified.Height(), <br />
SWP_NOMOVE | SWP_NOOWNERZORDER | <br />
SWP_NOZORDER | SWP_NOACTIVATE );<br />
Anyone has an idea why I cannot acces the ActivePage() or also the work with the PropertyPage reference loaded by GetPage(0) causes access violations?
|
|
|
|
|
Hi,
The Create() call of CImageList class takes a parameter for color mask (COLORREF crMask). Is it possible to change this mask after creating it?
Thanks,
AJ
|
|
|
|