I just want to print a text with the real HEIGHT points. For example, in word when I print a text with font arial 12 points, in the papper the font height is @3mm, but when I use textout function (with Cfont object selected by HDC) the height in papper is @1mm and change with the printer type.
There has to be a way to force IE to let go of the dll.
Your object will probably stay untill next CoFreeUnusedLibraries() will be called.
You may ask yourself however, why do you need your ActiveX dll to unload?
Maybe there is other way to perform what you need?
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
There is a file you can modify in Visual Studio which allows you to specify things not to step into when F11 stepping but I don't remember where it is or how to set it up. I know you can just step right back out (Shift F11) of code block, but since there is a way to bypass it in the first place, I'd rather do that.
MyFn(cs); // I want to step into MyFn() without
// stepping into the CString constructor
Does anyone know how to do this?
Thanks in advance!
That does work but it's much nicer to just continue F11-ing to the code I want rather than playing with the mouse. Like I said there is a way to do it, I just need to remember what file needs to be changed and how...
Create a rich edit area on the screen. Using CScrollView as the canvas. I allow the creation of a CRichEditCtrl by dragging an area on the screen. I then use the screen coordinates and create the control.
Setup the control so it emulates the printer in the word wrapping and font emulation. I use the SetTargetDevice with the width (in TWIPS)and a HDC to the printer. I calculate the width by getting a handle to the DC for the client window, setting the mapping mode to MM_TWIPS, and converting the display points from screen into TWIPs. Calculate the width and call SetTargetDevice.
Print the contents of the CRichEditCtrl to a printer. I do this by using the same rectangle that I used to create the width for the SetTargetDevice in the FORMATRANGE structure. Fill in the rest and call FormatRange. (Three times, first with (null, false), second (format, true ), and the third (null,false).
Here is what I'm seeing. I draw a box around the control that is +5 screen units bigger (each direction) on the screen and printer. When I type text in the box then do a print preview/print, the characters to the right side of the box, the space seems to be smaller when I print it than when I displayed it. I think the printed version is using a different size font than what is on the display. What this should look like is a text box in word. As an example, create a text box in word, draw a line some where over it (like the middle). Notice what characters it intercets and print. The print output looks like the screen. I would like to do the same thing!
So: How do I create the control so it will appear on the screen as it will when I print?
Once I get this beast whipped, all is well with the world. At least in my world!
BTW, there is not much information on how to do this. Either on the MSDN or anywhere else.
I figured out how to use it..but i don't know the problem
I am getting ctlreg.cpp line 502 assertion error. seemslike
it won't let me trace that deep. If I am getting this error,
where should I look at. any help is appreciated!
probaly the easiest approach is before saving your data, you transform the data into a CStringArray. That is for every data you need report you transform this data into a textual representation (CString) and add it to the array.
Then you may store the array into a file. If you take care that a line is not too long, then you may also print that array line by line. Do a heighth calualtion and divide the paper length by this height to get the number of pages to print.
Your application framework should alredy have the appropriate Print(Preview) functions installed.
Hi guys. Can anyone tell me how I can restrict certain users from having access to certain buttons on my dialog? Since this is a one-off, I'd simply like to have the button in question require a password to activate?
What I would do is, say you have a button that performs some functionality that requires a password. In yoru button handler, it might go something like this:
Pop up a dialog asking for username/passwordd.<br/>
AfxMessageBox("Nice try, buddy!");<br/>
bool DoSomeFunction(username, password)<br/>
check username and password<br/>
If incorrect, return false<br/>
Else do the forbidden function and return true<br/>
You can tweak this as necessary. Somebody else suggested just using EnableWindow(FALSE) on the button. That isn't good because somebody who really wants that functionality (and who can resist trying to hack into something, just because it is password protected?) can use an external program to send Windows messages to enable and click the button. If you have the password check in the function doing the restricted functionality, you can't crack it except by knowing the password or disassembling the code.
If your nose runs and your feet smell, then you're built upside down.
Last Visit: 31-Dec-99 18:00 Last Update: 26-Apr-17 18:19