I am trying to handle the 'Cancel' button in my property pages (wizard) and I've implemented the 'OnQueryCancel' function to catch the cancel message successfully, but unfortunately it seems that the 'OnQueryCancel' function is being called twice if the user clicked the cancel button. Any ideas on how I could address this issue? Thanks!
...
How can i stop mfc dialog application closing by pressing ESC (Escape key).
After executing my application if u press ESC key then the window is closed. how it can be stopped, i am using VC++ 6.0.
...
Hello,
I hope that I can explain my problem well enough for someone to help.
Basically, I have a horizontal scrollbar (ranged 0 to 1000) and an edit control that represents the position of the scrollbar divided by 1000, so that the user can use either the scrollbar to select a range of numbers between 0 and 1 up to a 3 decimal precisio...
I have an MFC application that creates a CDialog. I'd like this CDialog to not show up in the middle of the screen, but rather off to the side of the screen so its barely visible or even minimized would be good.
How can I do this?
...
Hello, all, I have a rather frustrating issue. The application in question has an MFC GUI that uses the classes available in the MFC Featurepack. This GUI uses an DLL that is developed in C++\CLI. Our company uses Cruise Control. NET (1.4.4 SP1) on Windows Server 2008 SP2 for continuous integration. Cruise Control is setup to use the ...
I know that GetCurrentDirectory() and SetCurrentDirectory() functions exist on the MFC framework, but I don't have a CFtpConnection object in my application. I have a simple CWinApp-derived class, and I would like to retrieve its working directory upon program startup. What's the easiest method to achieve this goal? Thanks in advance for...
I know that I can create an integer variable for a group of radio buttons, set it to an integer, and then call UpdateData(FALSE) to make the window highlight the appropriate radio button control. However, I would like to perhaps use a CButton control instead, but I don't know how to set the CButton state so that a particular radio button...
I am writing MFC application, I choose CView based application other then Dialog based application. I don't know how to remove title bar and status bar, is there any method to do this? And made a CView based application just like dialog based application ?
Many thanks!
...
If I use try/catch in WindowProc override of MFC window/view classes there is a performance hit. Why is it so and what is the alternative ?
This I caught as a result of profiling. Removing the block makes the function consume much lesser time. I am using MS VS 2008.
...
Hi,
I can't draw a pattern with a transparent background. This is my snippet :
bitmap.CreateBitmap(8, 8, 1, 1, &bits)
brush.CreatePatternBrush(&bitmap)
hbrush = pCgrCurrentDC->SelectObject(&brush);
// set text color
TextCol = pCgrCurrentDC->SetTextColor(CgrColourPalRGB);
int oldBkgrdMode = pCgrCurrentDC->SetBkMode(TRANSPARENT);
//dr...
Let's say I have a CString variable carrying the string "Bob Evans". I want to copy from position 4 until the end of the original CString to a new CString, but I am having trouble finding semantics examples for this:
CString original("Bob Evans");
// Below is what I'm trying to do
// CString newStr = original.copy(4, original.GetLength(...
App:MFC backed by oracle
Unit testing framework:googletest
I am going to unit testing the code that will be added here on to the project.Unit testing framework is googletest. I am new to unit testing. Is googletest is ok for my application how can I get started?
...
Hello,
I am trying to use ultimate grid from Code Project in a dialog box but the grid is invisible.
m_Plist.AttachGrid(this, IDC_CREDENTIALS) returns true but the static text place holder where the grid should be shown cant be seen and the grid is never displayed.
I am using sample the code from here http://www.codeproject.com/KB/M...
Hello
Can you please tell me your way or give me a reference to best dialog and property sheet validation best practices in MFC application?
I have my own way to do it but I'm interested in any other opinion.
I heard that MFC DDX_xxx and DDV_xxx macros (and UpdateData() function) are not the best solution?
What about property sheet v...
Commence V 2.0 of this question.
My VC++ MFC application compiles and runs just fine. That is, until I switch to another window. As soon as my program loses focus, it freezes; I cannot switch back to it and if I move a window that is in front of it, my app window displays white in the space that the other window was covering.
Since I f...
My CFormView-derived class is structured as follows:
class FormViewClass : public CFormView
{
...
FormViewClass();
void Initialize();
virtual void OnInitialUpdate();
...
};
Ideally, I would like to call the Initialize() function in the body of the constructor as follows:
FormViewClass::FormViewClass()
{
...
I currently have a CFolderDialog class that is used in my CDocManagerEx class for handling file operations as follows:
I don't know if I need to show the method implementation of this class (I found this from a project posted here, but here is the class definition if it helps:
class CFolderDialog
{
friend static int CALLBACK Br...
I have developed my own Report Control which is simply nothing but drawing text on a CDC of the control window's client DC. I have got the printing function to work too. The report output is sent to the printer directly. However I want to let the user know the output before the report is actually printed.
I cannot do this using MFC's p...
I have an dialog for HTTP proxy configuration with hostname and port edit boxes.
My question is how can I validate user input for correct hostname and port?
May be I have to use some regular expression for hostname validation or there is some helpful MFC or WinAPI function? What is the maximum correct number for port?
...
What is the windows socket notification sink for? I am currently working with MFC socket and I think I have done something wrong since I get this message at windows shutdown. What could cause this?
Thank you.
Edit:
I am currently working with an application that needs to communicate via sockets. When I shutdown my computer I get a mess...