|
Hi there,
All you have to do is create a handler for trapping the EN_KILLFOCUS so that you get the message that the edit control is loosing the focus. So inside the handler put the MessageBox that you want to popup. When the user clicks on OK on the dialog box, edit control looses the focus. So to ensure that the focus is on the edit control, create a control variable for the edit control suppose(m_control) do the following after the statement following the MessageBox
CPoint set(0,0);
m_control.SetFocus();
m_control.SetCaretPos(set);
|
|
|
|
|
Validating data during a WM_KILLFOCUS message indicates a bad design. That message gets sent in too many situations so picking and choosing which one(s) you are interested in will lead to trouble. The most reliable way of validating data on a dialog box is to check the state of each control anytime a control changes. Set up a "change" handler for each control and do the validating in it. If all conditions are met, only then do you enable the OK button. I do this for each of my dialogs. It is very clean and reliable. Read here for more.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
aaaah.....if ur specifiaction demandz u to have a validation of the data entered onkillfocus,then herez ur answer.....
click thiz.....[^]
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
hiho@ll
i'm using outport (outport.sourceforge.net) to extract contacts from outlook
outport uses an COleDispatchDriver Wrapper and the InvokeHelper method to get the data it needs
the invokehelper function gets a DISPID parameter, which identifies the methode which should be called
my problem is how can i write some contacts back to outlook
and anybody knows where i get a list of available methods for invokehelper!?
i think i could use invokehelper, to add new contacts to outlook, but how?
thx@ll
|
|
|
|
|
Hi Community,
how can i implement a Email functions in my MFC Program, i have to create a function that allows a sending Emails from Program! Not a MAPI i thing something like SMTP? Problem is that i dont have any experience with WinSock or something litke this!!!
thanx!
Mirsad
|
|
|
|
|
|
Hi,
thanx for the link, but author says that i need VS7(.Net) and i have a Visual Studio 6 (MFC), is there any problems?
mirsad
|
|
|
|
|
Yeah, the author uses CSMTPConnection declared in atlsmtpconnection.h which comes with ATL 7. Here is another link[^] but this will require you to specify a smtp server address.To get the smtp server address depending on the email address you check this link [^]
suhredayan There is no spoon.
|
|
|
|
|
Hi i am building an application which consists of 2 projects, ie. my main app which is the main project, and a second projet which is essentially a bunch or libraries for the first/main app to use. - in a single "solution".
Strict visual studio.net 2003 terminaology here.
I am trying to use a dialog from the library type project, in my main project. everytime i compile the solution i get
c:\Code\vision\CustomNameDlg.h(24) : error C2065: 'IDD_DIALOG_CUSTOMNAME' : undeclared identifier
Now when i call this dialog from a clas within the same project everything works fine? Is there some trick to calling a dialog from a different project, but part of the same "solution"??
Thanks for any help,
James
|
|
|
|
|
jammin PPP wrote:
c:\Code\vision\CustomNameDlg.h(24) : error C2065: 'IDD_DIALOG_CUSTOMNAME' : undeclared identifier
Currently your main application and library project has separate resource.h and .rc files. The error is because IDD_DIALOG_CUSTOMNAME is not there in the resource.h file of main project. Refer this TN [^] article for using multiple resource files within same project.
suhredayan There is no spoon.
|
|
|
|
|
add macro #include "resouce.h"
|
|
|
|
|
Hi,
This is sundar...
I had a problem with connecting the Ms-Access database through VC++ with an security protection.
I had create a table in Ms-Access with a security password. Then i gone to control pannel and created an DSN name.
After that, i open my VC++ application, there i created a new class by inheriting CRecordset. Its ask for Connection. I select my DSN in ODBC connection, then it ask for a password, where i given the password, which i created in access. After that i select my req table.
Then i try to run my application . I faced that, when ever i am trying to open my database through VC++ code. its asking me a password frequently.. This should not be occur. So, where i have to set my password in VC++ code..
This is urgent....
If any one knew. pls revert back soon
Shanmuga Sundar.V
|
|
|
|
|
DBConn.OpenEx(_T("DSN=urDSN;UID=urUserID;PWD=urPwd"),CDatabase::noOdbcDialog);
//"CDatabase::noOdbcDialog" says that database should not ask for a login at runtime.
suhredayan There is no spoon.
|
|
|
|
|
iam using spin control .
i HAVE also set edit control as its buddy control.
So i need to i ncrement the value in the buddy edit control when i hit the up arrow and decrement the value when i hit the lower arrow.
How do i know if i hit the up arrow / down arrow of the spin control.
laiju
|
|
|
|
|
You can set the UDS_SETBUDDYINT style and the spin control will update the edit control for you. Or else you can handle the WM_VSCROLL message that the spin control generates when it's buttons are clicked. (or WM_HSCROLL if the UDS_HORZ style is used)
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
if you have already set your edit box as buddy of the spin ctrl , then add variable to your edit box i.e CEdit m_edit
then add then in class wizard in the WM_VSCROLL message handler add following code :
void CYourDialogDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if( pScrollBar->GetDlgCtrlID() == IDC_SPIN1 )
{
CString str;
str.Format("%d",nPos);
m_edit.SetWindowText( str );
}
CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}
m0n0
|
|
|
|
|
(VC6.0, Excel 2000)
Range range;
Borders borders;
range = sheet.GetRange(COleVariant("A1"), COleVariant("L6"));
borders = range.GetBorders();
borders.SetLineStyle(COleVariant((short)1));
This sample is applied to all cells ..
but I want only outline
plese help me.... I want reference source...
reply to: lgs99@dreamwiz.com
|
|
|
|
|
Can you please advise how can we find the CPU utizilation of a particuar process or application running in WIN 98/ME OS..
Thanks in advance..
|
|
|
|
|
I was wondering if anyone had it coded or if someone could get me started
|
|
|
|
|
I'm sure this has been plenty of people's homework before it was yours. We tend to prefer that you start yourself ( thinking about it first is the most important step in coding ), and then we'll help if you get stuck.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
thats the problem, I need help getting started.
|
|
|
|
|
We are using DAO in our application for db support. One of our customers is looking for a server based deployment WITHOUT client installation of DAO, MDAC or whatever.
Is there a way to do this? It's ok, if we have to recode into something more modern than DAO.
Thanks,
-- Harald
|
|
|
|
|
I've looked around trying to find this information, but there's nothing I can find that fits my situation.
I have two separate classes: Print and PropertySheet that are part of a larger program. I didn't write the code for either one and making any radical changes is out.
All I need to do is add a function to the PropertySheet class that will access the Print class and print out certain information obtained from PropertySheet.
Here's the problem: All of the print functions in Print (such as starting a new document, starting a new page, etc) are virtual functions and I can't access them from the PropertySheet class. I've never cared for vf's and haven't worked with them or used them before, so I'm lost on how to do this.
Here's the question: How can I access those virtual functions in Print from PropertySheet without re-writing the program (I just want to add the code to print in the PropertySheet class)?
I apologize if this has been addressed before, but, as I said, I couldn't find anything for this situation.
I appreciate any help and say thank you in advance anyone that responds.
|
|
|
|
|
If you can't access them, that probably means they are protected or private, not virtual, necessarily.
If they are protected, derive a class from Print to gain access. Make sure this is the right thing to do, they are probably protected for a reason.
bcemick wrote:
I've never cared for vf's
Why - do you hate object orientation ?
Is it possible to put code that defines the interaction between these two objects into a third class, so that they don't become tightly coupled ?
Christian Graus - Microsoft MVP - C++
|
|
|
|