|
antonaras_marcou wrote: the debuger i don't know how to use it effectively
set a breakpoint when you want the program to pause while executing to let you debug (F9).
then, use the Watch view to see your variables contents (or hover the variable in the code), and use the "Step-by-step" toolbar buttons to go next code line...
|
|
|
|
|
Thanks again V2.0
I used the debuger thanks to u i set the breakpoint where i assign my values to the string and i see the characters getting in memory one by one that's a cool tool
very helpful thanks.
I'm not sure if u read the rest of the replies i used printf("%s",Plain_Text.c_str());
and it works fine.
one more question v2.0 what are iterators? (u mentioned them in ur first reply)
|
|
|
|
|
iterators are STL classes that allow you to iterate through the linked-lists items.
for instance :
std::string strText;
std::vector<std::string> PlainText;
std::vector<std::string>::iterator iterStrings;
for (iterStrings = PlainText.begin();
iterStrings != PlainText.end();
iterStrings++) {
strText += *iterStrings;
}
-- modified at 6:32 Thursday 9th March, 2006
|
|
|
|
|
Thanks v2.0 this looks helpful for my project i'll try to use it because u have some points in that example that will make my life much easier
Thanks a lot appriciate the help talk to u again on the next post
Thanks again
|
|
|
|
|
STL containers are very powerful and can be very useful when one know how to use them.
unfortunately, they are sometimes hard to start with, and they frighten the beginners...
if you have time to learn at stl containers, it will always be a personal investment.
|
|
|
|
|
This will not work - std::queue doesn't have any iterators. I posted a similarly flawed example before I realized (so I deleted it)
Steve
|
|
|
|
|
didn't know that...
i changed it into vectors
thanks for the info
|
|
|
|
|
Should be #include <string> not #include <string.h> - STL header files don't end in ".h". Another issue is the printf ("%s", Plain_Text); . If you must use printf it should look like this: printf ("%s", Plain_Text.c_str()); . But using printf is a bad idea. Instead do this: cout << Plain_Text; . You may need to add an #include <iostream> for cout .
Steve
|
|
|
|
|
Hey Stephen Hewitt you are right:: printf ("%s", Plain_Text.c_str()); with include <string> works fine thanks
but cout<<plain_text gives="" error="" in="" compiling
the="" error:::
c:\documents="" and="" settings\antonis\my="" documents\parser\otinane.cpp(80)="" :="" c2679:="" binary="" '<<'="" no="" operator="" defined="" which="" takes="" a="" right-hand="" operand="" of="" type="" 'class="" std::basic_string<char,struct="" std::char_traits<char="">,class std::allocator<char> >'
(or there is no acceptable conversion)
I thought i was allowed to cout<< strings because i see it everywhere used
any ideas why i get error?
Thanks again for solving my problem
|
|
|
|
|
Have you included <iostream> ? Get rid of any ".h" CRT headers you're including. printf isn't type safe, as you've found the hard way - God knows how much wasted time has been spent in the programming world tracking down obscure bugs caused by, for example, a mismatch in the format string and the parameters.
Steve
|
|
|
|
|
God u are so right again i have to loose the .h from the include
Thanks man ur the best.
I wonder why they teach us wrong things in college u should become a teacher
thanks
so u sugest i use cout instead of prinf?
|
|
|
|
|
Yeah, I'd use cout instead of printf - Try as you will you won't get cout to crash as printf did. It will either work or not compile.
Steve
|
|
|
|
|
Hey thanks a lot i'll use cout as well
Thanks for helping me again
Talk to u again on the next post
|
|
|
|
|
when you remove the .h and use the stl form,
always use using namespace std;
VuNic
|
|
|
|
|
I tried to include atlimage.h in my project but i failed (i have VC++ 6)
and i didn't found where to download this lib .
slouma
|
|
|
|
|
|
when building
ERROR: enable to include altimage.h
slouma
|
|
|
|
|
elabed.slim wrote: enable to include altimage.h
you meant "unable", didn't you ?! :->
|
|
|
|
|
atlimage.h comes with visual studio .NET not VC6
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
I use atlImgae.h and it's not problem
in the visual studio .NET
But if you want to read jpg or bmp files use OleLoadPicture
|
|
|
|
|
Hi,
I have developed a program in which i intall a WH_CBT. But as soon as the code for installing the hook executes, the taskbar of my computer disappears and my computer halts.
Please give me any idea why this is so...
|
|
|
|
|
You must call CallNextHookEx after you finish processing the hook information.
From MSDN:
Calling CallNextHookEx is optional, but it is highly recommended; otherwise, other applications that have installed hooks will not receive hook notifications and may behave incorrectly as a result. You should call CallNextHookEx unless you absolutely need to prevent the notification from being seen by other applications.
Nibu thomas
Software Developer
|
|
|
|
|
Here's my theory:
You are installing a global hook; that is you called SetWindowsHookEx with the hMod non NULL and the dwThreadId parameter equal to zero. This causes the dll identified by hMod to be injected in all processes with message pumps; this is how global hooks work. Your DLL contains a bug and this buggy code has been injected into explorer via the global hook. Do you really need a global hook?
Steve
|
|
|
|
|
I have put this code in button click event;
but notting happens as the button is pressed.
it should display the string on desktop.
CWnd wnd;
char str[] = "Test String";
wnd.m_hWnd = (GetDesktopWindow())->m_hWnd;
CDC* dc = wnd.GetDC();
dc->TextOut(100,100,str);
An alternate which I have also tried is
CString str = "Test String";
((GetDesktopWindow())->GetDC())->TextOut(100,100,str);
but no result.
Thanks in advance.
|
|
|
|
|
Use GetWindowDC();
Nibu thomas
Software Developer
|
|
|
|