|
Use the right mouse button or from the debug menu (when debugging) select "step into specific function".
Example:
=======
CString strText = "abc";
MyPrintFunction(strText); // Beak point here
When clicking on "MyPrintFunction" with the right mouse buttion, a popup menu will appear and just below QuickWatch you will see "step into MyPrintFunction"
I hope this makes sense, it has been a long day.
|
|
|
|
|
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...
|
|
|
|
|
From the tools menu select
Customize...
Click on the Keyboard tab
From the Category Combo Box select
Debug
From the commands list box select
DebugStepIntoSpecificFunction
Click on "Press New Shortcut Key" edit box and select you new key combination.
CTRL+SHIFT+F11
Click on the [ASSIGN] button.
No you cannot reassign F11 but you can try reassigning F2.
Go to the Edit Category and delete F2 from BookMarkNext
|
|
|
|
|
A question that I didn't find answer to on MSDN or
via Google.
In Visual-C 6+ compiling with "cl /Gr" i.e. __fastcall, how do I detect this at compile time?
I need to use something like this:
#if defined(_MSC_VER)
#include <fastcall.h>
#if defined(__fastcall) || defined(FASTCALL_IN_STORE)
#error Don't even think about compiling this as fastcall (cl /Gr)
#endif
#endif
Unfortunately it doesn't work. Any hints?
Where is FASTCALL_IN_STORE set and what does it mean?
I'm not sure it's related to option /Gr (since it's not prefixed
with '__').
BTW. Watcom sets the symbols __SW_3R in this case.
Gisle V.
"If you feel paranoid it doesn't mean they're not after you!" -- Woody Allen
|
|
|
|
|
visible spaces of a Tab ('\t') character equal to 8 or 6 space (' ') characters in CRichEditCtrl by default.
now i need to change its visible spaces to 4 space characters, but i can't find idea to do that.
in visual c++ ide (not RichEdit), there is a setting which can change visible spaces of a Tab character to any space characters, i want to create a similar setting for our users.
thanks in advance for any hints and help.
includeh10
|
|
|
|
|
|
thx.
i think this is right point.
i will do a test to get it work.
includeh10
|
|
|
|
|
OK, here is what I want to do.
- 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?
Thanks
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.
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
I hae problem registering my ocx. So I am trying
to debug it using regsvr32 sample program available
at microsoft.com. Does anyone know how to debug using
this regsvr32 program?
Shin
|
|
|
|
|
I just figured out!!
Thanks
|
|
|
|
|
Sorry..
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!
shin
|
|
|
|
|
Obviously, Look at MFC\SRC\CTLREG.CPP line 502...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
Thanks for your posting. Is there anyway that
I can put the break point here?
Shin
|
|
|
|
|
This time it's real. I figure out all!!
No problem registrying the ocx.
Thank you very much!!!!!
|
|
|
|
|
I have a Windows VC++ SDI Application that gathers and process data.
All I want to do is generate a report from data I have collected!!!.
I want to be able to generate a report when I select ‘Generate Report’. (And NOT File -> New)
I also want to be able to Print the report.
I have now idea how to do it.
Please help me.
|
|
|
|
|
Hi,
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.
If you do NOT want to select File New, rename it.
Regards
G. Steudtel
|
|
|
|
|
No it's worse that that, I don't understand how I can get the code to write text to the screen.
I think you need to pretend that I don't understand VC++!!!
|
|
|
|
|
|
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?
Thanks
Paul
Paul
|
|
|
|
|
If the button in question is on a dialog, then you can simply call the button's EnableWindow() method in the dialog's OnInitDialog() method.
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
m_SomeButton.EnableWindow(...);
return TRUE;
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
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:
void SomeWindow::Button1Click()
{
Pop up a dialog asking for username/passwordd.
if(!DoSomeFunction(username, password))
{
AfxMessageBox("Nice try, buddy!");
}
}
..
bool DoSomeFunction(username, password)
{
check username and password
If incorrect, return false
Else do the forbidden function and return true
}
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.
|
|
|
|
|
I hadn't thought of that, thanks.
|
|
|
|
|
I have a question regarding the closing of a CView during a paint message.
I want to send a close message to a view during its OnDraw(CDC*) method. Is it guaranteed that the OnDraw method will finish before the view processes the close message if I send it using PostMessage in my OnDraw code?
Thanks in advance.
|
|
|
|
|
Yes. PostMessage appends the message to the queue of posted messages. SendMessage waits for a response (turns into a recursive call on the same thread).
|
|
|
|
|
OK, thank you. That was what I have expected.
|
|
|
|