|
Close everything and manually delete these files from the project's folder: *.NCB, *.PLG, *.OPT. Reopen and see if you notice a difference.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Hello,
INTRODUCTION:
I'm using a normal CListCtrl in a dialog based app.
When I update/edit a value in the ListCtrl (REPORT MODE) I validate it versus all the other values (they must follow some rules) and if some are not as they should have to be, I modify the variables that are linked to those parameters and then I re-populate ALL the ListCtrl reading those variables...
NOTE:
I know that this is not the best method... but it works and I have no time to improve it... moreover there are only 8 elements in the ListCtrl.
QUESTION:
In order not to fool the user I want to be able to place the selection where it was (over the last edited item). The fact is that I can see the selection mark over the desired element, but when I press the down arrow the selection gets placed over the first element.
After the edition I'm using this code now:
<br />
if (iElement == -1) iElement = this->m_ElementModificatAct.m_iItemActual;<br />
this->SetItemState(iElement, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);<br />
this->EnsureVisible(iElement, FALSE);<br />
this->SetSelectionMark(iElement);<br />
OK, the selection mark is drawn where it should be, but when I press the down arrow I get the selection not in the next element... I get it over the first element...
Could I do anything?
Thank you in advance.
|
|
|
|
|
Funny I just solved this after posting a similar question.
change
this->SetItemState(iElement, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);
to
this->SetItemState(iElement, LVIS_SELECTED| LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
Dave Huff
Igor would you give me a hand with the bags?
Certainly - you take the blonde and I'll take the one in the turban!
|
|
|
|
|
|
Do you think I can use that trick in order for my list control not to deselect all items one it loses the focus ? When I press a button it deselects all items from the list... I have to select them again...
JM
Earth > Europe > France > Lyon
|
|
|
|
|
I use DirectShow for playing AVI. How to play AVI in the reverse direction?
|
|
|
|
|
Hello to all,
I have an embedded CPropertySheet inside a dialog and this sheet contains 4 pages. The user can't access the second page unless he has entered and saved a record inside the first one. So in the SecondPage::OnSetActive() I query some data members and if nothing has been entered I call the parent PropertySheet and ask it to SetActive the first page. UI wise the first page is selected but the controls displayed are still those of the second page. What call(s) do I have to make in order to display what the first page has to offer in terms of controls ????
Thanks in advance for any help !
Luc
|
|
|
|
|
Override the OnKillActive() for the 1st propertypage and return false in no record has been written. This stops the 2nd page being activated at all.
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
Cool. Your suggestion work fine !!!
|
|
|
|
|
I need a non-MFC function that takes a filename, and returns a MD5 of the file. I'd prefer a non-RSA implementation, because of limited space for the copyright stuff. Anyone know of such a function?
Thanks!
|
|
|
|
|
Is there an easy way to write TRACES to a log? If not should I just use CFile or something similar?
Thanks in advance for your advice
Rob
|
|
|
|
|
Either create your own logging class (something derived from CFile), or re-define TRACE to add the text to a text file
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
One thing to make sure you do if you log to a file - make sure you CLOSE the file after each TRACE (or whatever) statement. That way if you crash, you don't lose the whole file.
Even a broken clock is right twice a day.
|
|
|
|
|
Not really, all you really need is the equivalent of a "flush" to ensure each message gets written. Continously opening, seeking to the end, and closing for each write operation sounds to me like a serious performance killer.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Thanks to everyone.. I went ahead and created a function with in my thread instead of doing a TRACE I run my function OnLog(strMessage) then in that function I do my logging.. everything is working great.. I found the problem after 5 mins of logging..
I'm sure its a huge performance hit but it was needed to debug, I'll disable the code once the problem is resolved.....
Thanks again..
Rob
|
|
|
|
|
Glad to have helped. A logging mechanism is essential for debugging applications such as yours.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
hi,
i want to know how costly is it to create fonts,pens etc and u know, selecting and destroying every time, say in ondraw.
My problem is this(with font only)
I have to adjust the font size for the names of somethings which will be displayed in resiable boxes.the names should be appropriately sized according the box size.
any help
Raja Huus
|
|
|
|
|
hi,
i want to know how exactly are the ui stuff like tabs(especiallY) or comboboxes etc are drawn by windows.is the code accessible.I want this because i want to draw these on my own especially tabs to get the flattish look like the output window in the IDE.
(i suppose one should know how to draw if these are owner drawn. right?)
Krujic
|
|
|
|
|
Malcom Krujic wrote:
is the code accessible
You can step right into most of the MFC-code (but not in anything of WIN32 or (most?, all?) of the common controls).
You will find the MFC source files below your MSVC++ installation directory in MFC/SRC and MFC/include.
I hope this helps a little.
--
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
Talking about MFC...
Controls ( Tabs, Buttons, ... ) are usually derived from CWnd, and handle message via the message routing.
WM_PAINT is one of those message, the message is send to each CWnd, and if the CWnd handles it ( added an ON_WM_PAINT to the MessageMap section of the class, and OnPaint member function ) it will be drawn there.
Some UI objects like buttons, menu, listbox, offer a style OWNERDRAW, that can be set in the resource editor, or at creation time, when this flag is set, the DrawItem member function is called; in which you can also draw.
The CTabCtrl offer the OWNERDRAW style, search here, at codeproject, maybe there's already something like that, and there's a HOWTO on MSDN with DrawItem and CTabCtrl that can help.
Max.
|
|
|
|
|
what about the tab buttons
|
|
|
|
|
Is there any standardized format for time span values? There are a number of standards for time and date values, ISO 8601 to name one, but I haven't found any standard for time span values. Do you know of such a standard?
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Hello everyone....Hope everyone is ready for the holidays and had a great Thanksgiving. I working on a new program to balance a check book.....There is just acouple of things I am stumped on. I need to put a bool varible in but I just don't know where to put it by the way I have ti set up. It's supposed to charge the person a 5.00 fee if the account balance falls below 500.00 at anytime during the month....and only charged once. And my other problem is how am I supposed to keep track of all of my charges for the month and I have to but the final amount of charges on my final screen...... Forexample of output screens....
Deposit Trans.
Deposit Amount: 100.00
current Balance: 600.00
deposit charge: .10 (for every depost made)
total charges : .45 (just the added sum of all charges so far that month....just not taken from balance until end of the month)
Check Trans.
Check amount: 600.00
Current Balance: 425.00
check charge: .15 ( for every deposit)
One Time Below 500.00 Charge: 5.00
total charges: 5.60
Any help would be appreciated... Here is my program...hopefully it isn't too hard to read
#include <iomanip>
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
void PrintInstructions (float&, string&);
void GetSingleTransInfo(char&, float&);
void ProcessDeposit (float, float, float&);
void ProcessCheck (float, float, float&);
void PrintFinalTotals ();
void PrintBlankLines (int);
const float CHECK_CHARGE = .15f;
const float DEPOSIT_CHARGE = .10f;
const float ONE_TIME_CHARGE = 5.00f;
int main ()
{
string month;
float balance;
float transAmount;
char transCode;
bool below500;
float currentBalance;
PrintInstructions (balance, month);
GetSingleTransInfo (transCode, transAmount);
if (transCode == 'C')
{ ProcessCheck(transAmount, balance, currentBalance);
}
else if (transCode == 'D')
ProcessDeposit(transAmount, balance, currentBalance);
else
cout <<" This is the end of the month\n";
return 0;
}
//************************************************************************************************************
void PrintInstructions(/*out*/ float& beginBalance, /*out*/ string& month)
// Purpose: Prints general instructions about how to use the program and will ask the user to enter the
// month and the beginning balance for the month.
// Pre:
// Post: None
{
cout <<"\n \"Balancing Your Checkbook\"\n";
PrintBlankLines (3);
cout << "This is a program to help you balance your checkbook for the month. The\n";
cout << "program will ask you to input the month name and the beginning balance\n";
cout << "for the month. The program will then ask you to input a transaction code.\n";
cout << "The transaction codes are as follows:\n\n";
cout << " C or c - for a check\n";
cout << " D or d - for a depsoit\n";
cout << " E or e - for the end of the month\n\n";
cout << "For each transaction code (except for E/e) the user needs to input the\n";
cout << "transaction amount. For each transaction any charges towards the account\n";
cout << "will be listed but will not be applied to your balance until the end of\n";
cout << " the month.\n\n";
cout << "The following charges will be accumulated and applied to your balance\n";
cout << " at the end of the month:\n\n";
cout << " * 10 cents for each deposit and 15 cents for each check processed.\n";
cout << " * A one time charge of 5.00 if the account balance falls below \n";
cout << " 500.00 at anytime during the month.\n";
cout << " * A service charge of 10.00 for each check that either puts the\n";
cout << " balance below zero or keeps the balance below zero.\n";
PrintBlankLines (3);
cout << "Please enter the month to be balanced: ";
cin >> month;
cout << endl;
cout << "Please enter the beginning balance for the month: ";
cin >> beginBalance;
PrintBlankLines (3);
system ("pause");
system ("cls");
}
//***************************************************************************************************************
void GetSingleTransInfo (/*out*/ char& code, /*out*/ float& amount)
// Purpose: This function should get the transaction code and the amount of the transaction
// from the user (if the transaction code is not an E or E).
// Pre: None
// Post: Code has a value of C, D, or E.
{
PrintBlankLines (4);
cout << " Select form the following transactions:\n\n";
cout << " C / c - for a check\n";
cout << " D / d - for a deposit\n";
cout << " E / e - for end of the month\n\n";
PrintBlankLines (3);
cout << "Enter you transaction choice: ";
cin >> code;
code = toupper (code);
cout << endl;
while (code != 'C' && code != 'D' && code != 'E')
{
cout << "\nError.....you must select a code from above\n\n";
cout << "Please enter a new transaction code: ";
cin >> code;
cout << endl;
code = toupper (code);
}
if (code == 'C' )
{
cout << "Please enter transaction amount: ";
cin >> amount;
cout << endl;
}
if (code == 'D')
{
cout << "Please enter transaction amount: ";
cin >> amount;
cout << endl;
}
system ("pause");
system ("cls");
}
//***************************************************************************************************************
void ProcessCheck(/*in*/ float amount, /*in*/ float balance,
/*out*/ float& currBalance)
// Purpose: Deduct amount of check from balance....apply charges if balance falls below zero by
// cause of check. Apply charge if balance falls below $500.00.
// Pre:
// Post:
{
currBalance = balance - amount;
cout << " Check Transaction\n\n\n";
cout << fixed << setprecision (2) << endl;
cout << "Check Amount: " << amount << endl;
cout << "Current Balance: " << currBalance << endl;
cout << "Check Charge: " << CHECK_CHARGE << endl;
system ("pause");
system ("cls");
}
//***************************************************************************************************************
void ProcessDeposit (/*in*/ float amount, /*in*/ float balance,
/*out*/ float& currBalance)
{
currBalance = balance + amount;
cout << " Deposit Transaction\n\n\n";
cout << fixed << setprecision (2) << endl;
cout << "Deposit Amount: " << amount << endl;
cout << "Current Balance: " << currBalance << endl;
cout << "Deposit Charge: " << DEPOSIT_CHARGE << endl;
}
Thanks for you time once again!!
Autumn
"Hitting her head against a brick wall"
|
|
|
|
|
does anyone know how to add a new zone to a Windows 2000 DNS server with c/c++?
i've tried the dnsapi.lib from Microsoft's latest SDK, it seems only handling with resource records, but i'm still not sure about how to connect to the DNS server and create zone files or modify zone files. anyone has some idea about it? thanks a lot!
programming+soccer = my current life
|
|
|
|
|
Hi,
My column in the Listcontrol don't fit on the screen, how can i make the last column visible for the user?
I know the method EnsureVisible(..) but this works only for the row's.
Thanks
|
|
|
|