|
Member 3869682 wrote: ...executes a command over command prompt using system() API.
What command are you executing?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi david,
i m going to execute a "exe" file along with the parameters to be passed to the application. It would be better if i identify a routine which can perform this command line execution and also works on unix and windows as well.
Regards
kathir
|
|
|
|
|
Woundering what books anyone would recomend for learning c++ such as winsock and other protocols for
conecting to servers and clients the books ive read only go thro program control thanks for any suggestions.
|
|
|
|
|
for c++ you should get Stroustrup & everything by Scott Myers & an STL book
Winsock its not a protocol its a library and there are plenty of sources of info on the web
For most protocols the doco will be language neutral. There is heaps and heaps of really good stuff on this site for windows socket programming and many many other thigns
|
|
|
|
|
For C++ I think www.cplusplus.com is good for you and for protocols I have this book and its good (Teach YourSelf MCSES TCP/IP in 14 days).
|
|
|
|
|
I have a device context handle HDC some thing drawing on it .
can i same the image that is drawing on device context using HDC handle only
Trioum
|
|
|
|
|
Do you want to show image with other draws?
|
|
|
|
|
Are you asking...
"I have an HDC that some other part of my program (eg a library) is drawing on.
With just that HDC information, can I save the picture?"
?
I can see a few barriers to saying Yes.
1/ I can't find any function called GetHDCSize (or equivalent), so you would have to select in a new BITMAP, and examine the old BITMAP for information, then select it back. But you have to do this in the same thread as the Thing that is drawing to the HDC.
2/ HDC's are normally temporary objects, given to a program from a central pool. How you got this HDC is important. If you simply stored a HDC returned from BeginPaint, then the HDC will be recycled by EndPaint, and it will no longer be valid. If you get GetDC (hWnd) yourself, then you will be working on a different HDC to the Thing you talked about earlier.
3/ I'm now running out of ideas, as any more answers depend on details you haven't told us (yet).
Good luck,
Iain.
Iain Clarke appearing by Special Request of CPallini.
|
|
|
|
|
May be this screencapture[^] + use of CImage Class is useful
if
trioum wrote: can i save the image that is drawing on device context using HDC handle only
|
|
|
|
|
I changed a collection from a vector to a map
ie
std::vector<mytype>
is now
std::map<std::string, mytype>
now my question is how do I modify the following so that it will still work?
std::copy(collection.begin(), collection.end(), std::ostream_iterator<mytype>(anOStream));
Obviously I need to some how pass the pair::second to the third param but I dont know how. I realise I could just make it a loop but Im interested to know the answer
Thanks
Josh
modified on Tuesday, February 05, 2008 11:08:16 PM
|
|
|
|
|
Is it possible to have a child window with a title bar, and have the title bar active (i.e. highlighted just as a normal active window's title bar is)? I have tried to do this, even forcing focus for the child window, but the parent window remains the one whose title bar is highlighted. I realize that I could make an MDI application in which the childs of the MDI child window can have active title bars, but my application is not an MDI app.
Basically, I wish to have several windows constrained within one parent window. I have everything in place with the exception that the title bars of these child windows will not highlight. Any help is appreciated.
|
|
|
|
|
What window styles are you using when you create the child?
What happens if you include the WS_OVERLAPPED style?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
here's a piece of code
HWND hWndChild;
hWndChild = CreateWindowEx(0, _T("EDIT"), _T("Test Window"),
WS_CHILDWINDOW | WS_CAPTION | WS_MAXIMIZE,
0, 100, 340, 220, hWnd, NULL, hInst, NULL);
ShowWindow(hWndChild, SW_SHOWDEFAULT);
Please click here to show sample parent/child window.
|
|
|
|
|
I have a program that allows the user to input variables into a program, perform some math on the variables, and then spit out the answer. However, if the user enters a string, rather than a number, the program skips the rest of the input sequence and goes straight to the math. I'm trying to avoid this using a try...catch statement. However, I cannot run any code to check the error, because as soon as the user presses enter, the rest of the input code is skipped, without allowing me to run any code to test it. Is there any way around this whithout simply telling the user to be careful and only enter numbers?
|
|
|
|
|
Klazen wrote: Is there any way around this
Several options come to mind.
1) Re-read the material provided for your course
2) Ask your instructor for some guidance
3) Network with other students in your class
4) Drop the course and change your Major
led mike
|
|
|
|
|
Thanks for the sarcasm, but it's not an assignment. I'm simply trying to learn more about C++.
Also, just FYI, I'm still in high school. Haven't even chosen a major.
|
|
|
|
|
Klazen wrote: but it's not an assignment. I'm simply trying to learn more about C++.
Also, just FYI, I'm still in high school.
How stupid of me not to know that!
led mike
|
|
|
|
|
Klazen wrote: Is there any way around this whithout simply telling the user to be careful and only enter numbers?
int x;
std::cin >> x;
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
That's what I am doing (well actually, I've got "using namespace std" and the top of the file, so I don't have to write that all over the place.) But when I type "s", for instance, it skips the rest of the "cin" statements and moves on to the code after it.
|
|
|
|
|
Did you see this?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'd recommend Stroustrup's book on C++ (title "The C++ Programming Language"), one of his first examples is a calculator which reads numbers and expressions from the input and shows one way to parse it and extract numbers, symbols, labels etc..
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
have a look at boost's lexical cast[^]
The underlying implementation uses string streams (which is pretty slow) so you could do something similar yourself if you dont want to use their library
something along the lines of this...
<br />
stringstream ss;<br />
string input;<br />
int value;<br />
<br />
try<br />
{<br />
ss << input;<br />
ss >> value;<br />
}<br />
catch(cant remember exactly what is thrown)<br />
{<br />
}
|
|
|
|
|
start everything out using a char varable
char number[100]
then us a static_cast<int>
to turn it in to a int if the user enters a charcter they going to get sumthing crazy but other then that you could use if or catch statements
|
|
|
|
|
Gregory Bryant wrote: start everything out using a char varable
char number[100]
then us a static_cast
to turn it in to a int if the user enters a charcter they going to get sumthing crazy but other then that you could use if or catch statements
What ?? Are you kidding ? You mean you want to use a static_cast on the char array to convert it to an integer ? Oh man, that is just plain wrong.
|
|
|
|
|
Please don't answer questions until you know the answers. This is just plain wrong on so many levels.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|