|
Given that monitors have knobs on them to stretch / shrink the width & height of a picture, I can't imagine you can totally trust any dpis given to you by the OS (or graphics driver).
While that is less of an issue with flat screens, it's not completely gone.
It get's even worse on some CRTs, with the picture bulging at the sides, etc.
Have you tried drawing a ruler on the screen in X & Y, and getting the user to drag it with the mouse until it matches some real world measurements done by them on the screeen?
Iain.
|
|
|
|
|
Hi. I have an image file located in a directory. How can I send it to the default printer and print it from my VC++ code? I tried different ways but doesn't work. Please help!!!
|
|
|
|
|
Go to the Articles section on this site under "General C++" you will a category for "Printing"
|
|
|
|
|
Thanks. I'll do that. I hope it's not too hard. I tried system("print filepath"). It hangs. Is there any dos command that I can sent from dos command prompt to print a file? Thanks a lot!
|
|
|
|
|
ShilpaPotnis wrote: Is there any dos command
Perhaps using the Shell interface would suffice. There are ShellExecute(...) or ShellExecuteEx(...) and there is a Shell Library[^]
|
|
|
|
|
Thanks! I'll try this too.
|
|
|
|
|
How do you set the text color for a static label?
Why doesn't the following work?
CDC* dcMyLabel = GetDlgItem(IDC_MYLABEL)->GetDC();<br />
dcMyLabel->SetTextColor(RGB(255,0,0));
|
|
|
|
|
Have you looked into the WM_CTLCOLORSTATIC message?
"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
|
|
|
|
|
Is there some config option some place that I need to check?
I have OnCtlColor, but no OnCtlColorStatic.
|
|
|
|
|
littleGreenDude wrote: I have OnCtlColor...
In that method, check the second parameter (it's a CWnd* ) against the static control you are interested in. If they match, set the text color (using the DC's SetTextColor() method) and return a handle to the brush.
"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
|
|
|
|
|
Do you happen to have, or could you point me to a code sample of this?
|
|
|
|
|
See here and here for starters.
"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 want to read a .txt file by my program, how can i do this? I have columns in my notepad file for e.g.
CUST. NO. X Y
0 71 69
1 53 57
3 69 12
4 58 12
5 63 45
6 25 109
7 100 81
8 .. ..
9 .. ..
10 .. ..
11
these are the 3 columns i have i.e. CUST. NO., X, and Y in my notepad file and i want my program to read it. The Cust No might go to thousands, means i dunno how much will it be. Also tell me what should i use to store these values or colums? simple arrays or linked lists or anything else?
Kindly help me in this regard by helping me in source code, ill be very thankful to u. Take care.
nOmI
|
|
|
|
|
nomi khan wrote: Kindly help me in this regard by helping me in source code,
What source code? What have you tried so far (that doesn't work)?
"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
|
|
|
|
|
Open the file as a std::ifstream .
When the ifstream is good, you can use getline to read the file line by line, and normal std::string function to parse each line.
Evilgrin
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
You can use of CFile class.
|
|
|
|
|
you can use CStdiofile for reading line by line. and can read the column values by space separator( as u shown here )
Define ur columns in a structure and use CArray for storing these values.
Ajay
|
|
|
|
|
aks. wrote: Define ur columns in a structure and use CArray for storing these values
tThe solution is fine. but i have little doubt over usage of CArray. i like stl class much then MFC colection class. cince data coming is in form of string. we could use more specialized container i.e. CStringArray!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
u want to use stl? then u can use list
if u want to use CStringArray , then u have to store whole strings on a line to the array as one entry. on getting the values from CStringArray , u have to parse it for getting each vales of the column.
Ajay
|
|
|
|
|
Hi - I'm lost in an IO Network stream error -
because of something wrong in the socket -
and I can't figure out how to get the
WSA socket error associated with the IO error.
Is the error in the socket structure or
is there a function that will help me ????
Please help,,,,,,,,
|
|
|
|
|
Something like WSAGetLastError()
|
|
|
|
|
yes, I need something like that -
but - not running on server -
don't have all the right libs & dll's,
and header files - so - I was thinking
that there could be a function, perhaps
in the socket that would get that last
error ????????????????????
or somewhere ??????????
or should I just try & get ahold of
all the DLL, LIBs, & h files /?????/
|
|
|
|
|
There's no functions "in the socket".
What DO you have to work with? How are you debugging
without DLL, Libs, and h files?
You think an error is occurring on the server and you're debugging
from a client?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote:
You need more than one of these, Mark, as I've no clue what he wants either.
"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 didn't want to waste them....it's looking like I may need a lot of
them elsewhere
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|