|
how do we use a debugger????
u mean gdb ???
for debugging we have to put debugging symbols in the program??? like ifdef DEBUG ???
|
|
|
|
|
shrims4u wrote: u mean gdb ???
I guess so, I never developped under linux a lot. The debugger let you set breakpoints in your code, inspect the different variables, inspect the call stack. I think you'll need to search a good tutorial on how to use gdb on the web. Without using your debugger you won't be able to good very far. It's not only for your current problem but also for the future. Learn to use your debugger properly and you'll see that it will save you a lot of hassles.
|
|
|
|
|
I am using the below tool tip code for showing a tooltip when mouse is moved over a row in CListBox.
Row in CListBox has a file name, I am showing the path of the file as a tool tip.
m_ExistingMap.Lookup(strText,strTipText);
int nLen = strTipText.GetLength(); // nLen is 120 characters
#ifndef _UNICODE
if (pNMHDR->code == TTN_NEEDTEXTA)
lstrcpyn(pTTTA->szText, strTipText, nLen+1 );
else
_mbstowcsz(pTTTW->szText, strTipText, nLen+1 );
#else
if (pNMHDR->code == TTN_NEEDTEXTA)
_wcstombsz(pTTTA->szText, strTipText, nLen+1 );
else
lstrcpyn(pTTTW->szText, strTipText, nLen+1 );
#endif
I am not observing a crash when nLen =80
|
|
|
|
|
If you check out the documentation for the TOOLTIPTEXT[^] structure you will see that szText is defined as 80 chars long, you can't copy the 120 chars long string into the 80 char long buffer.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
VKupunaram wrote: I am not observing a crash when nLen =80
So then what's the problem?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
i need convert tiff to pdf using pdflib ?. I wish your help. thanks very much.
nothing
|
|
|
|
|
Do you mean this pdflib[^], the commercial product, for which you've paid money, which should entitle you to some level of support...from that company?
Well, they do have a developer center with samples and a cookbook. A quick search of that[^] highlights this page[^]. It might be in Java, but it tells you how to drive the API to produce a PDF from a TIFF file...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Write a class Namelist that serves as a list of names. Each name is
up to 20 characters long. An object of the type Namelist can hold
up to 10 names. You work with a 2-dim array of char.
Member data and methods:
The class has an array of 10 arrays of 21 char:
char list[10][21];
(Because a name can be 20 char long).
It has a data member that keeps track of how many names are in the
list. You can add more data members to the class if you want.
* The class has a constructor that initializes the object to empty.
* It has a method void add(char name[]) that adds name to the list
? if name is not already in the list, otherwise it does nothing.
? Also,if the list as already full, it does nothing.
* It has a method int contain(char name[]) that checks if the name
? is in the list. If yes the method returns 1, otherwise 0.
* It has a method int numNames() that tells how many names are in
? the list.
* It has a method void input() that reads one name from stdin, then
? if the name is not in the list, it adds it, otherwise does nothing.
* It has a method void output(), that prints the whole list to stdout.
All data members must be private, all methods public.
You have to #include <string.h> and work with the function strcmp(),
to find if two strings are equal.
In main() declare a Namelist object, read several names from a
file using redirection and then print out the list. Make your own
input file so that some names in the input file occur more than once,
so that you can test if such names are read in only once. Also, make
the input file so long that the add() method will not add any more
names to Namelist.
Input through redirection:
The program code is written like reading from the keyboard. But
when you run the program you type after the executable: < "file",
"file" is the name of your data file. This replaces the keyboard
input with your file.
Turn in online of your program source
code, and your input file of names and a sample run with that file.
|
|
|
|
|
"hi i need this program immediately in c++"
Sure. My usual fee for doing someone else's homework for them is $500 US per hour with a 4 hour minimum.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
sonuchill wrote: Write a class...
I'm pretty sure that means you, not us.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
But your teacher didnt say anything to us for write this program?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Maybe he did - maybe progressive colleges are now teaching "How to get answers from CodeProject"...the OP's failed that course as well
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
sonuchill wrote: hi i need this program immediately in c++
Sorry, time is up.
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]
|
|
|
|
|
No man. *New* is always *New* as long as it is tagged.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
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]
|
|
|
|
|
I meant immediately is always immediately no matter when you read it.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Use of Add time.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
sonuchill, this is your professor writing.
See me before the start of the next class.
|
|
|
|
|
Pressure sometimes really helps!!!
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi everyone. I have a rather simple(or so i thought) problem. I cant seem to pass, and recieve a pointer to a list.I need access to this list so i can add a newly created object(of the class sphere) into it!
I am calling a method of a class Sphere like this:
class sphere{
int id, promjer, x, y;
sphere(int idd, int ppromj, int xx, int yy, std::list<sphere> *llist_of_classes)
: id(idd), promjer(ppromj), x(xx), y(yy){
llist_of_classes.push_back(this);
}
std::list<sphere> list_of_classes;
void main(){
...
sphere Ball(1,2,3, &list_of_classes);
}
I get the 'cannot convert paramater 5 from..to..' error msg. Does anyone have any idea how to solve this problem?
Or more generally, how do i pass and recieve pointers to std::list?!
thx!
|
|
|
|
|
Isn't std::list a template, doesn't it need template arguments (type of list elements and such)? What is the exact error message you get?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Yes it does, the code i supplied was not actual! for which i am sorry. Check out the code in an answer to a poster below!
thx!
|
|
|
|
|
Ok, sorry for the nitpicking. I believe your problem is that you should use llist_of_classes->push_back(this); instead of llist_of_classes.push_back(this); in the constructor of your sphere since it is a pointer not the object (or a reference to the object) itself.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
i've tried before, and this is what i've got:
error C2664: 'std::list<_Ty>::push_back' : cannot convert parameter 1 from 'sphere *const ' to 'const sphere &'
but it does make sense what you are saying, the solution will probably have the '->'
thanks!
|
|
|
|
|
Do you want to put pointers in that list? If your answer is yes then you probably need to change the template parameter for the std::list (something like std::list<my_class*> instead of std::list<my_class> i guess), if no, then you probably need to use ...pushback(*this); instead of pushback(this).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|