|
Vaclav_Sal wrote: I found lots of registry wrappers here , but I need just basic API explanations, not a wrapper class.
Despite your following comment I always find that MSDN[^] is the best place to look.
|
|
|
|
|
Hello
I want to ask information via keyboard the user. I did a dialog with edit control, this dialog let me to ask the name of the file when the user will kept information.
I made this, but not run
Code:
void CDlgResultados::OnBnClickedButton1()
{
CDlgSaveLoad dlgSL1;
if(dlgSL1.DoModal()==IDOK)
{
dlgSL1.GetDlgItemText(IDC_EDIT1, nombre);
}
SaveToFile();
}
App is in mfc.
The error appear in dlgSL1.GetDlgItemText(IDC_EDIT1, nombre);
|
|
|
|
|
(I will only give partial answer, just to get you going... look for tutorials/sample/example for more complete code and/or documentation)
You cannot access dialog control before a DoModal (the controls are not created yet) or after a DoModal (the control were destroyed).
In your dlgSL1 dialog code, add a CString variable and "attach" it to the CEdit (IDC_EDIT1) with DDX_Control with something like:
DDX_Control(pDX, IDC_EDIT1, m_YouStringVariable);
This can be done manually or with the wizard or the properies (I think); when that is working properly, you can set/get the variable from the parent dialog (in your case: CDlgResultados::OnBnClickedButton1)
if(dlgSL1.DoModal()==IDOK)
{
nombre= dlgSL1.m_YourStringVariable;
}
Another way is to override the CDialog::OnOK in the CDlgSaveLoad class and in there, you can get the string from the CEdit and put it in an intermediate variable:
void CDlgSaveLoad::OnOK()
{
m_YourEdit.GetWindowText(m_YourStringVariable);
CDialog::OnOK();
}
and the code in CDlgResultados::OnBnClickedButton1 will be similar as above.
Max.
Watched code never compiles.
|
|
|
|
|
|
Thank you very much.
+ 10 for the answer.
Here is the answer :
void CDlgSaveLoad::OnBnClickedOk()
{
CDialogEx::OnOK();
m_Edit.GetWindowText(m_strData);
}
void CDlgResultados::OnBnClickedButton1()
{
CDlgSaveLoad mDlg;
if ( mDlg.DoModal() == IDOK )
{
nombre= mDlg.getData();
}
SaveToFile();
}
|
|
|
|
|
Swap the two lines in OnBnClickedOk .
and I assume that
nombre= mDlg.getData();
will return m_strData ?
Watched code never compiles.
|
|
|
|
|
Yes, I forgot write here the method :
public:
CString getData() const { return m_strData; }
|
|
|
|
|
I'm sorry, I have another question.
When I show something in Edit control, it appear selected in hightlight blue, how can I modify it??
I'd like that only appear the text but not hightlight
|
|
|
|
|
antonio343 wrote: When I show something in Edit control, it appear selected in hightlight blue, how can I modify it??
have a look at CEdit::SetSel[^]
M.
Watched code never compiles.
|
|
|
|
|
Ok, but I didn't call this function in my code, and the text appear selected blue when I show the text.
I don't want that the text appear selected
I use to show and get the text GetDlgItemText/SetDlgItemText
Could be this the problem?
|
|
|
|
|
I think that the problen is setfocus() I call this function an it select all the text. I need that the text will be showed without higlight
|
|
|
|
|
Hello Friends
we are creating A desktop based application.And mine application is based on other 3rd application Engine or Enviorement which is having their own Activation code.
So,installation is like that first we will install 3rd application with their activation code.Now,i want to install mine application that will secure 3rd application activation also and also make sure that mine desktop application will be used only on one machine.
I want to secure 3rd application activation because If somehow I make secure mine application and then mine application gets corrupt or expire after trial then that 3rd application will remain on user system.So,I want to secure both through some user Input Activation code or through some other way.
Any Ideas??
Regards
Yogesh
|
|
|
|
|
This is the C/C++/MFC forum.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
What kind of activation code are you giving away with the 3rd party software, an "evalulation / trial license" or a "premanent license"?
|
|
|
|
|
You probably mean this and perhaps this too.
Here's a list of software license/product key articles.
|
|
|
|
|
Thanks A Lot to all of you.
Regards
Yogesh
|
|
|
|
|
Hi all,
I have made a report style list control. In that list control i have made two columns.
What i want to do is when column 2 value changes to certain number then column 1 value should change into hyperlink.
how can i do this.
Thanks in advance
|
|
|
|
|
What event causes column 2 to change? You need to monitor or capture that, and make the changes to column 1 at the appropriate time. Without knowing more about your code it is difficult to be more specific.
|
|
|
|
|
both columns have been initialized with some values
when initial value of column 2 increases then column one value should become hyperlink.
Thanks.
|
|
|
|
|
|
for static controls: here
|
|
|
|
|
|
and the question is?
0100000101101110011001000111001011101001
|
|
|
|
|
#include "stdafx.h"
#include <stdio.h>
int main()
{
/*int i, c, cp;
for(cp=c=getchar(), i = 0; c != EOF; c = getchar() ) {
if ( c == cp ) {
i++;
} else {
printf("%d%c", i, cp);
i = 1;
}
cp = c;
}
printf("%d%c", i, cp);*/
/*
int i, c, j;
while( scanf("%d%c", &i, &c) == 2 ) 1
{
for(j=0; j < i; j++)
{
printf("%c", c);
}
}
}
Failure is Success If we learn from it!!
|
|
|
|
|
hi,
how to convert LANGID to wstring?
Zo.Naderi-Iran
|
|
|
|