|
Ok, Sorry that i did not explain.
The "Draw" can be lines on the text , or some circle around the text or something like that.
How/ can i do it ?
|
|
|
|
|
|
So this will draw the text ( or the background of the text ).
I could not do catch the DCD to draw on it in this method.
Is there some other solution ?
|
|
|
|
|
|
Hello,
Could you please tell how to implement ActiveX BEGIN_EVENTSINK_MAP in a CView derived class?
I know that it is done automatically from the event handler wizard when the ActiveX is added into a dialog box but I have no clue with views.
Should I do it manually?
many thanks for your help.
|
|
|
|
|
Hi all:
I have been writing a FIFO structure, but ran into a problem, it seems to me that my FIFO structure is not properly built at all.
Below is my code: (it complies with no errors or warning.)
struct _wordTable *first = NULL, *end = NULL, *current = NULL;
int number_of_word = 0; /*A global variable to indicate how many words 'addWord' function
has been added to the table.*/
void addWord(char *wordPtr)
{
/*wordSize is declared to store the length of a word.*/
int wordSize = 0, loop = 0;
struct _wordTable *working_ptr = NULL;
/*Allocate memory for new pointers.*/
working_ptr = malloc(sizeof(struct _wordTable));
if (working_ptr == NULL){
fprintf(stderr, "Out of memory.\n");
free(working_ptr);
return;
}
working_ptr->word = malloc(1);
if (working_ptr->word == NULL){
fprintf(stderr, "Out of memory.\n");
free(working_ptr->word);
free(working_ptr);
return;
}
/*Measure the length of the input string.*/
wordSize = strlen(wordPtr);
/*Trying to find a match by linearly going through the list, if one is found,
return to the caller funciton after increasing the count by 1.*/
/*If the word is already on the FIFO structure, increases the word count by 1 and return to main().*/
if (number_of_word > 0)
for (working_ptr = first; working_ptr != end; working_ptr = working_ptr->next) {
if (strcmp(wordPtr, working_ptr->word) == 0) {
/*Here is where my program will crush.*/
working_ptr->count++;
return;
}
}
}
/*If the word is a new one, add it to the FIFO structure.*/
working_ptr->count = 1; /*Add one to the count after its initialzation.*/
realloc(working_ptr->word, wordSize);
strncpy(working_ptr->word, wordPtr, wordSize);
working_ptr->word[wordSize] = '\0';
number_of_word++; /*A new word.*/
/*Now link them together in a FIFO fashion.*/
if (first == NULL) {
first = working_ptr;
current = first;
}
current->next = working_ptr;
working_ptr->next = end;
}
Any help is appreciated.
|
|
|
|
|
C_Zealot wrote: /*Here is where my program will crush.*/
working_ptr->count++;
Which doesn't mean a whole lot without any supporting data? What does "crash" mean? What is the value of working_ptr->count at the time of the crassh. What does the call stack look like?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm seeing this, but I could be wrong...
struct _wordTable *first = NULL...
...
for (working_ptr = first;...
if (strcmp(wordPtr, working_ptr->word) == 0) {
That should crash because "first" is NULL, right?
Mark
Indentation is our friend!
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
what's the problem with peoples on this forum today ?
can't you ask a question properly ?
i mean, format your code samples when you post some (using the <pre></pre> tags around it), and by giving better precisions than what you do. saying "there's a problem in my code" is not a question in my opinion, and nobody here is paid to fix one's code. you should first use your brains, and your debugger, spot the code piece that's the origin of your problem, and ask a specific question.
|
|
|
|
|
Give him some points... I thought he posted really good compared to other people:
- use of English language (+1 point)
- not writing "urgent" and "help mii" (+1 point)
- subject was not completely (!) off track (+1 point)
- able to miss a managed code forum (+1 point)
- generally friendly without cluttering text with roses and "sirs" (+1 point)
On the other side...
- code is C not C++ (-1 point)
- lazy in debugging own code (-1 point)
- not used to Code Project's formating (0 points)
--------------------------------
Overall 3 points = OKAY
|
|
|
|
|
i agree that he's not aggressive, and that's particularly appreciated. but open your eyes. should newbies pull the quality of this forum down, or shouldn't everybody here enforce hiwself to produce good quality question ?
moreover, when you say "not used to Code Project's formating (0 points)", i strongly don't agree. the forum provides a tag to format code samples. not using them not only lowers the readability of the post, but violates the codeproject stylesheet... the only reason for a pre tag not to be used is when the "Ignore HTML tags in this message" checkbox is checked.
so, i maintain the points given in my post
|
|
|
|
|
And doesn't anybody INDENT code anymore?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
indent ? crap, what the hell for ?!
|
|
|
|
|
toxcct wrote: what the hell for ?!
For me?
My head hurts trying to decipher matching curly brackets
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
oh, so you did try
|
|
|
|
|
yeah
wait, does that say "Sucker" or "Stupid" on my forehead?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
lol, no no, just "you're too good", or maybe "you need sleep"
|
|
|
|
|
|
Mark Salsbery wrote: LOL! No, really, I shouldn't have looked
I spare my 5 voting for another post from you
|
|
|
|
|
C_Zealot wrote: Any help is appreciated.
What problem are you having specifically?
|
|
|
|
|
Hello,
I am accessing Excel through Automation and want to find how many rows are there in excel that is no of records in excel
Which function should I use
Prithaa
|
|
|
|
|
prithaa wrote: Which function should I use
You should use the sheet's GetUsedRange() method. From there, you can use the range's GetRows() and GetColumns() methods.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi there, is there an explanation for the different possible variants of a control?
So far I am mostly guessing from the names in the file TmSchema.h or use a viewer like xpvisualstyle_demo. However, in the case of a tab control (pTheme->OpenThemeData(hWnd, L"TAB") ) I don't know what's the difference between TABP_TABITEM and TABP_TABITEMBOTHEDGE (there is no visual difference in the default XP theme). Thanks for feedback.
PS: It is NOT urgent
|
|
|
|
|
Guys,
I am trying to make a call to retrieve the bitmap information from a drawing context. When calling GetDIBits, it returns NULL and when I call GetLastError() it gives me ERROR_FILE_NOT_FOUND. Could anybody shed some light on what exactly it is that Windows is trying to tell me?
|
|
|
|
|
According to MSDN [^] this could also mean that your call was successful and "the return value is the number of scan lines copied from the bitmap". Perhaps you can post a code snippet?
|
|
|
|