|
CPallini wrote: 2. explain more clearly what do you need to do.
Why? What happened to your CPMRU?
|
|
|
|
|
Monday is the CPMRU rest day.
BTW (& first THHB attempt) You've enriched your Microsoft MVP profile (at least since last time I visited ). It's good, I like it.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks pal, I'm glad you liked it. The "Languages and Interests" and the "My recommendations" sections had been set (by me) mistakenly as viewable only by MS and other fellow MVPs earlier. I just made them viewable by public recently.
BTW (THHB attempt 2): The latest chip from Intel is so powerful that it can execute an infinite loop in less than 7 seconds.
modified on Monday, July 28, 2008 4:32 AM
|
|
|
|
|
Rajesh R Subramanian wrote: BTW (THHB attempt 2): The latest chip from Intel is so powerful that it can execute an infinite loop in less than 7 seconds.
Well, it is dependent on the choosen reference frame.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
you would need to handle the mouse click event on the list control and get the selected items. On every selection made, you can take the selected items from the list control and put the result in the next row that is empty.
I hope that I got your question correctly.
Use CListCtrl::SetItemData instead of SetWindowText or see InsertItem
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
no ,i want to display the result from row 2(col2) + row2(col3)in m_result - CEdit
and i have another problem :
i want to display the result from col 2 for ex:
col1|col2|col3|
---------------
1 | 2 | 3 |
---------------
1 | 2 | 3 |
---------------
1 | 2 | 3 |
--------------
col2 have (2,2,2) i want to sum this and put the answer in CEdit(m_result) (2+2+2 = 6)
6 i need in CEdit
|
|
|
|
|
See CListCtrl::GetItemText. You can use this function to get values of sub items and then perform operations on the value and display it elsewhere
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
ok go on getitemtext ok but how to do that ?
|
|
|
|
|
Hi,
I downloaded CComboCompletion code and used in my application.My problem is:
I have to use this class for two seperate dialogs using combobox.
For first dailog,i used this and its perfectly working.After tht i used this in another dialog in same application, when i changed memebervarialbe type as CCOmboCompletion from CComboBox,when i run it..its shows unhandled exception.
Whther i can use this CComboCompletion class to only one dialog..IF i want to use for amother dialog wat can i use?
Because this CComboCompletion is very useful for my application.
Pls help me??
Anu
|
|
|
|
|
Did you try and debug the code?
Just check the properties of the combo box in the sample and compare them to what you have set. May be there would be some uninitialized variable.
BTW did you try to understand the logic before implementing and using the class?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
When i debug..it shows unhandled in disassembly...And also in another dialog..its working.
Anu
|
|
|
|
|
Anu_Bala wrote: When i debug..it shows unhandled in disassembly...And also in another dialog..its working.
So did you check the value of the variables where the error is displayed and try to track them
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi All,
I have a new dialog based project, in which for the dialog I have set the following resizing property -
Style: Popup
Border: Resizing.
Now when I execute the application, I dont want the application icon to be displayed in the Title bar of the Dialog.
Can you tell me how to remove that icon?
Thanks.
Priya Sundar
|
|
|
|
|
Priya_Sundar wrote: Now when I execute the application, I dont want the application icon to be displayed in the Title bar of the Dialog.
Remove SetIcon calls from OnInitDialog . And at any time to remove icon from a window call SetIcon with a NULL icon handle.
SetIcon( NULL, true );
SetIcon( NULL, false );
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
This way if i set to NULL, i get a blank command icon displayed in the Title of the dialog.
However, in the taskbar still the icon is present.
I dont want the icon or even like a blank command type of icon displayed on the Dialog title.
So please suggest some other way.
Priya Sundar
|
|
|
|
|
Hello,
i did not try, but putting a transparent icon (only transparent background) which has nothing on it may solve your problem .
Bekir.
|
|
|
|
|
Good suggestion!
Thanks.
But in this case I need to allign the title bar text to the right of the dialog.
I am not sure how to do this!
Any suggestion for this?
Priya Sundar
|
|
|
|
|
Hello,
Right click on the dialog, go to Properties then Select Right Align Text in the misc. category
It does change where the title bar is located, but not sure that is exactly what you need.
Hope this helps.
Bekir.
|
|
|
|
|
How to create Win32 DLL using VC++ .Net?
There is no icon for this in the "New Project" dialog..
Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
rp_suman wrote: There is no icon for this in the "New Project" dialog..
Select "Win32 Project" option. Click "Ok" and in next dialog select "Application Settings" tab and there you have radio buttons for "Dll" and "Static library"
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
In VC++ 2008, I import some classes from excel.exe (office 2003), and include them as below:
#include "CApplication.h"
#include "CWorkbook.h"
#include "CWorkbooks.h"
#include "CWorksheet.h"
#include "CWorksheets.h"
#include "CRange.h"
When compiling, there are hundreds of errors.
Google says that there should be another file like excel8.h/excel9.h. But it isn't generated, what's the problem?
system
|
|
|
|
|
You are using the wizard to import all these classes or not? If you are using the wizard then all the headrers file will be added automaticlally. I do not know in 2008 how you will use the wizard, but exploring a little I suppose you will get it.
|
|
|
|
|
My program must place words in alphabetical order and print the lines that each word appears on. So if "a" appears twice on line 1, once on line 2, and 3 times on line 3. The output should read: a: 1 1 2 3 3 3.
So I need help in coming up w/ a sorting algorithm that does this. Can someone one please help me?
This is my code:
// Example of Binary Search of an Array
#include <iostream>
#include <cstdlib>
#include <string>
#include "queue.h"
#include <sstream> // for istringstream
using namespace std;
const int MAX = 200; // maximum number of nodes
typedef string TreeItemType;
/*
class TreeNode { // node in the tree
private:
TreeNode();
TreeNode(const TreeItemType& nodeItem,
int left, int right);
TreeItemType item; // data portion
int leftChild; // index to left child
int rightChild; // index to right child
// friend class - can access private parts
friend class BinaryTree;
}; // end class TreeNode
//int values[] = { -23, -6, 10, 15, 20, 25, 32, 40, 55, 82, 90, 100 };
TreeNode values[MAX];
*/
typedef struct dictType{
string str;
Queue line;
}dictItemType;
const string Punctuation = ",.;:?\"'!@#$%^&*[]{}|";
int main () {
//int sizeValues = sizeof(values) / sizeof (int);
istringstream strLine;
string line, word;
//dictItemType dict;
dictItemType dictionary[200];
int currentLine=0;
int j;
while (getline(cin,line)) {
++currentLine;
// clear the strstream and copy the entered line to it
strLine.clear();
strLine.str(line);
// now get each word-sequence from the strLine stream
while (strLine >> word){
//dictionary[i].str = word;
//You need tokenized.
while (word.length() > 0 && Punctuation.find(word[0]) != string::npos)
word = word.substr(1);
for( j=0; j < MAX; j++){
if(dictionary[j].str.empty()){
cout << currentLine << ": " << word << endl;
dictionary[j].str = word;
dictionary[j].line.enqueue(currentLine);
break;
}else{
if(dictionary[j].str.compare(word) == 0){
cout <<"Already there"<<endl << currentLine << ": " << word << endl;
dictionary[j].line.enqueue(currentLine);
break;
}//endif
}//endifelse
}//endfor
//j=0;
}//endwhile
}//endwhile
//SORTALGORITHM
// ********************************************************
// Header file queue.h - Pointer-based implementation.
// ********************************************************
typedef int QueueItemType;
class Queue {
public:
// constructors and destructor:
Queue(); // default constructor
~Queue(); // destructor
// Queue operations:
bool isEmpty();
// Determines whether the queue is empty.
// Precondition: None.
// Postcondition: Returns true if the queue is empty;
// otherwise returns false.
void enqueue(QueueItemType newItem);
// Inserts an item at the back of a queue.
// Precondition: newItem is the item to be inserted.
// Postcondition: If the insertion is successful, newItem
// is at the back of the queue.
bool dequeue();
// Dequeues the front of a queue.
// Precondition: None.
// Postcondition: If the queue is not empty, the item
// that was added to the queue earliest is deleted
// and returns true; if queue is empty, returns false
bool dequeue(QueueItemType& queueFront);
// Retrieves and deletes the front of a queue.
// Precondition: None.
// Postcondition: If the queue is not empty, queueFront
// contains the item that was added to the queue
// earliest, and the item is deleted and returns
// true; if queue is empty, returns false
bool getFront(QueueItemType& queueFront);
// Retrieves the item at the front of a queue.
// Precondition: None.
// Postcondition: If the queue is not empty, queueFront
// contains the item that was added to the queue
// earliest and returns true; if queue is empty,
// returns false
private:
// The queue is implemented as a linked list
// with one external pointer to the front of the queue
// and a second external pointer to the back of the
// queue.
struct QueueNode {
QueueItemType item;
QueueNode *next;
}; // end struct
QueueNode *backPtr;
QueueNode *frontPtr;
}; // end class
// *************************************************************
// Implementation file queue.cpp - Pointer-based implementation
// *************************************************************
#include "queue.h" // header file
Queue::Queue() {
backPtr = frontPtr = NULL;
} // end default constructor
Queue::~Queue() {
while (!isEmpty())
dequeue();
} // end destructor
bool Queue::isEmpty() {
return backPtr == NULL;
} // end isEmpty
void Queue::enqueue(QueueItemType newItem) {
// create a new node
QueueNode *newPtr = new QueueNode;
// set data portion of new node
newPtr->item = newItem;
newPtr->next = NULL;
// insert the new node
if (isEmpty()) // insertion into empty queue
frontPtr = newPtr;
else // insertion into nonempty queue
backPtr->next = newPtr;
backPtr = newPtr; // new node is at back
} // end enqueue
bool Queue::dequeue() {
if (isEmpty()) return false;
// queue is not empty; remove front
QueueNode *tempPtr = frontPtr;
if (frontPtr == backPtr) { // special case?
// yes, one node in queue
frontPtr = NULL;
backPtr = NULL;
}
else frontPtr = frontPtr->next;
tempPtr->next = NULL;
delete tempPtr;
return true;
} // end dequeue
bool Queue::dequeue(QueueItemType& queueFront) {
if (isEmpty()) return false;
// queue is not empty; retrieve front
queueFront = frontPtr->item;
dequeue(); // delete front
return true;
} // end dequeue
bool Queue::getFront(QueueItemType& queueFront) {
if (isEmpty()) return false;
// queue is not empty; retrieve front
queueFront = frontPtr->item;
return true;
} // end getFront
// End of queue.cpp
Princess Angel
|
|
|
|
|
Please:
1. use code block button to surround code snippets with <pre> tags.
2. elaborate, stating clearly:
- What you need.
- What you have accomplished so far with your code.
- What is the problem you're experiencing.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
if a struct is like following:
typedef struct _test_struct
{
int a;
int b;
int c;
}test_struct;
in C99 standard, if we want to define a global such struct with some initialized value(we only want to initialize b to 10), we can write this code like:
test_struct global_obj = { .b = 10};
but how to do the same thing in VC2005? Thanks
|
|
|
|