|
Hi All,
I need to implement Drag and drop of files between my namespace extension and windows desktop folders. When the user drags a file from a desktop folder and drops it on a folder in my namespace, I need to show the user a dialog box for user I/P. On the drop event when I do DoModal(), the dialog box just appears momentarily and disappears.
Can anyone please indicate where the problem could be?
Thanks and Regards,
Anil
-- modified at 7:10 Tuesday 14th March, 2006
|
|
|
|
|
A drag-drop operation is run by a modal message loop (possibly cross-process) inside OLE32. I imagine that trying to start another modal UI loop is causing the problem.
In your OnDrop() handler, collect whatever data is necessary and store it somewhere. Post yourself a window message and do your UI in the message handler.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hi Michael,
I tried this approach.... but its crashing there too.
Any other suggestions?
Thanks and Regards,
Anil
|
|
|
|
|
i am using SQL Server.
may i know how to acess data base In LAN?
can i acess data base from a public IP of remote system?
if so how to do?
thanks in advance.
JAYARAJ
|
|
|
|
|
In MFC wizard I have created a dialog form with two EditBoxs(IDC_EDIT1 and IDC_EDIT2). m_var1 and m_var2 are type unsigned integer. The type of the two edit boxes are of unsigned integer data type . The names of the member variables are m_var1 and m_var2. Their is a Button on the Dialog form
Kindly observe the code given
void CMFC_7Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
UINT abc = m_var1;
m_var2 = abc;
UpdateData(FALSE);
}
the problem is that when click the button1, the value entered in IDC_EDIT1 is not assigned to the temporary variable abc. When I debug the code, the value assigned to abc is zero. For example if enter a unsigned value 23 , the value is not assinged to the variable abc.
Kindly observe the code which is given below
void CMFC_7Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_var2 = m_var1;
UpdateData(TRUE);
}
In the above code, the value enter in IDC_EDIT1 is not transferred to IDC_EDIT2 even though m_var1 and m_var2 are both unsigned integer data type.
Kindly observe the code which is given below
void CMFC_7Dlg::OnButton1()
{
m_var2 = m_var1;
}
In the above given code, the direct assinged of m_var1 to m_var2 is not possible. When I debug the program , only zero is assinged to m_var2.
My question is why the value enter the IDC_EDIT1 is not shown in IDC_EDIT2?
Can any one please help me in this matter.
-- modified at 6:01 Tuesday 14th March, 2006
|
|
|
|
|
Actual way is
void CMFC_7Dlg::OnButton1()
{
UpdateData(TRUE);
m_var2 = m_var1;
UpdateData(FALSE);
}
nave
|
|
|
|
|
phijophlip wrote: void CMFC_7Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
UINT abc = m_var1;
m_var2 = abc;
UpdateData(FALSE);
}
UpdateData(TRUE);
UINT abc = m_var1;
m_var2 = abc; phijophlip wrote: void CMFC_7Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_var2 = m_var1;
UpdateData(TRUE);
}
UpdateData(TRUE);
m_var2 = m_var1;
UpdateData(FALSE); Nibu thomas
Software Developer
|
|
|
|
|
If I understand you correctly, you would like the value contained in the EDIT_1 to be shown in the EDIT_2 control, on pressing BUTTON_1 ?
try the following...
void CMFC_7Dlg::OnButton1(){
// Force DDX- DDV to do it´s stuff
// Save and Validate (TRUE) parameter
// **********************************
UpdateData(TRUE);
// Set the values as required
// **************************
m_var2 = m_var1;
// Force DDX - DDV to do it´s stuff
// Read values from member variables,
// and display them (FALSE) parameter
// **********************************
UpdateData(FALSE);
}
alternativly you could do the following
void CMFC_7Dlg::OnButton1(){
// Force DDX- DDV to do it´s stuff
// Save and Validate (TRUE) parameter
// **********************************
UpdateData(TRUE);
// Set the values as required
// **************************
m_var2 = m_var1;
// Update the UI to show the change
// ********************************
SetDlgItemInt(IDC_EDIT_2, m_var2, FALSE);
}
regards
Phil
bum... and I thought I´d got rid of all the bugs
|
|
|
|
|
If I understand you correctly you need to eneter Edit1 value to Edit2 value
void CAnswerView::OnBnClickedButton2()
{
CString str;
m_Edit.GetWindowText(str);
m_Edit2.SetWindowText(str);
//int Index=atoi(str);
}
I tesed this code and work Now this code is good or bad?
|
|
|
|
|
WhiteSky wrote: I tesed this code and work Now this code is good or bad?
It is the only way that will not end in blood, sweat and tears, IMHO.
NEVER EVER call UpdateData() yourself, but use control-variables and Get/SetWindowText.
The value-variables are for shielding the inner workings of a dialog from the outside.
INSIDE a dialog they only spread confusion.
So far my personal, very dogmatic views.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
-- modified at 9:42 Tuesday 14th March, 2006
UpdateWindow -> UpdateData
|
|
|
|
|
jhwurmbach wrote: NEVER EVER call UpdateWindow()...
Perhaps you meant UpdateData() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yet another example of why UpdateData() should be avoided. It's just too easy to mess up. You'd be better off using GetWindowText() instead.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I do not think that UpdateData(x) should be avoided. If used correctly, it is a lot eaiser then GetWindowText/SetWindowText. From the code snippet provided, It is not really clear what the purpose of two variables si, for one value to be retrieved...
just my tuppence..
Phil
bum... and I thought I´d got rid of all the bugs
|
|
|
|
|
Phil.Benson wrote: If used correctly...
That's a mighty big if there. The problem is that most beginners do not use it correctly and end up butchering their code just to get around its caveats. I find it best to avoid altogether. GetWindowText() and SetWindowText are a lot cleaner and you can tell exactly what is going to happen. Using UpdateData() is an all-or-nothing operation.
Consider the situation where you set some member variables, call a dialog's DoModal() method, call UpdateData() , then click the Cancel button. Now the member variables are potentially not in the same state they were prior to calling DoModal() . You should be able to assume that member variables retain their same value before and after if the Cancel button has been clicked. Use of UpdateData() makes this a bad assumption.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
David wrote
"That's a mighty big if there. The problem is that most beginners do not use it correctly..."
Nobody said programming is easy. If it was, we would not get paid as much
As for choosing Cancel, do you manipulate application data directly within the dialog? Or do you wait for the result (IDOK or IDCANCEL) before making any changes resulting from the data being changed within the dialog?
again, just my tuppence
Phil
bum... and I thought I´d got rid of all the bugs
-- modified at 9:43 Tuesday 14th March, 2006
Here on code project, If I can remember correctly it was PJ Ahrens, has written an interesting article about DDX-DDV in the MFC
|
|
|
|
|
I need to integrate Activex control(OCX) object into ATL COM Server DLL project. I created a dialog in my the project and added activex control. After adding the ActiveX control my other parts of the program are not working properly. The COM DLL calls CoCreateInstance() to connect to another component. At this point it hangs. If I remove the ActiveX object from the project everything works fine. Do you guys have any idea?
kars82
|
|
|
|
|
Hi again
i have another simple question
i'm doing the following
string text;
int lenght=text.lenght;
compilation error::
error C2440: 'initializing' : cannot convert from 'unsigned int (__thiscall std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >::*' to 'int'
Conversion is a valid standard conversion, which can be performed implicitly or by use of static_cast, C-style cast or function-style cast
Error executing cl.exe.
What is the problem i've seen this in many codes what is wrong with mine
Thanks in advance
|
|
|
|
|
antonaras_marcou wrote: string text;
int lenght=text.lenght;
string text;
int nLength = text.length();
Nibu thomas
Software Developer
|
|
|
|
|
Thanks Nibu thomas
appriciate the help
it's working fine now
|
|
|
|
|
They didn't do the beginners any good with this stupid property-notation in the Hype-languages.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
To Whom it may concer:
I have a serious issue with the development under MS Exchange Database using unmanaged C++. I would really appreciate ( for a bootle of BEAR if you live in Kyiv, Ukraine) if someone can provide me with the documentation and/or samples of such code.
Thank you in advance!
For more info please advice
|
|
|
|
|
hi!! is any1 familiar wiz openGl? I want to integrate terrain codes which r in openGL in MFC n am having sm problem.. cud any1 plz help me
|
|
|
|
|
You could go to the website nehe.gamedev.net/ you will find some good tutorials on opengl at this site.
|
|
|
|
|
adiilah wrote: I want to integrate terrain codes which r in openGL
as mentioned go to Nehe.... if the issue is how to do terrains in OpenGL, go here: http://www.vterrain.org/LOD/Implementations/index.html[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
What do you exactly mean by "terrain codes in OpenGL" ?
SkyWalker
-- modified at 14:48 Tuesday 14th March, 2006
|
|
|
|