|
Cedric Moonen wrote: (and the progress bar won't progress).
So what's the point in having a progress bar that won't progress? That just sounds counterintuitive. I suggest an unprogress bar instead. That way it won't matter if the primary thread is busy or not.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
What about documentation [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
OK I can now process LVN_ITEMCHANGED messages in my list ctrl. Thanks for that, David Crow.
I need now to make a certain column be editable in my CListCtrl-derived class, like when you click on a file name in explorer you get an edit box. There is a flag LVS_EDITLABELS which does exactly what I want. Unfortunately it works only for the first column, and I need to edit the 3rd column. Is there an easy way to do that, or should I make my own floating edit box (with MoveWindow/ShowWindow)?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
modified on Tuesday, September 29, 2009 6:37 AM
|
|
|
|
|
|
Thanks
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi to all,
Could anyone please tell me how to use setfocus (or may be any other methods) to set focus to an editbox by default. ie whenever the dialog box opens, cursor should be in the editbox.
I have variables of the edit box, but as value. not control. So I guess we can use something like
GetDlgItem(IDC_EDIT1)->SetFocus();
But its not working for me. Please help
thanks in advance
-----------------------------
I am a beginner
|
|
|
|
|
Make the edit box the first in the tab order. To do that look at Layout menu in the resource editor.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
thanks for reply,
But there should be something like setfocus() right.
-----------------------------
I am a beginner
|
|
|
|
|
In case you make the edit box first in the tab order, you don't need setfocus.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
sashoalm wrote: look at Layout menu in the resource editor
where do I find that? I am using vc++6
-----------------------------
I am a beginner
|
|
|
|
|
Layout->Tab Order
the Layout menu appears only when you are in the dialog editor.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
See here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All
I have one dll(created in c) and i have one console application(in C).Now i want to read console application variable value from dll.Is it possible please gimme ur input.
Mohan t C
|
|
|
|
|
Is the console application loading the dll ? If yes, why don't you simply export a function from the dll that returns the value ?
|
|
|
|
|
No,Dll calling console app variable value..
Mohan t working for N.I.C
|
|
|
|
|
Errr, what
I was asking if the dll was loaded by your console application (meaning that your console app uses the dll).
So, you are saying that your dll should use a variable from your application ? You can do the same as my previous suggestion: expose a function that is called by your app and which will set the value of the variable in the dll.
|
|
|
|
|
I understand,But how do we export console app function and how do we call it from dll.
I tried _declspec (dllexport),but am unable to do.
Thanks for ur help.
Mohan
|
|
|
|
|
Why would you want to do something like that ? This is really not a good practice. You have to keep in mind that your dll could be used not only by your application but by any other app. So, why don't you simply export a function in your dll that the application can call. By calling this function, your application can pass the value of the variable to your dll.
Anyway, what you are trying seems very strange and it seems you are a bit confused about the dll stuff. Can you explain what you are trying to achieve exactly ? Why do you need to retrieve this variable from your dll ? Maybe we'll be able to suggest a better approach.
Please bear in mind that we can't read your screen and we don't know anything about your application.
|
|
|
|
|
Thanks and sorry for this confusion.
Actually i want to get user input(runtime) say username and password.i couldn't do that in DLL.so i planned to use console application for getting user inputs and stored in some variable.then i will get that variable values calling from dll.
Mohan t
|
|
|
|
|
So, what prevents you to retrieve to credentials in your console application and pass them to your dll by calling an exported function of your dll (for instance checkCredentials(std:string username, std:string password) ) ?
Why do you absolutely wants your dll calling your application ?
|
|
|
|
|
Am running a tool using my Dll.Previously we were hardcoded username and password(passing parameter) now i dont want to hardcode that.so am planning to get username and password from user itself.
So i want to display input window for getting username and password(Is this possible to do in DLL).....Is there any way?
Thanks
Mohan t
|
|
|
|
|
How to keep wait cursor (AfxGetApp()->DoWaitCursor(1);) to remain wait cursor after the event handler (e.g. button click) ends?
If you start wait cursor in some button click even handler, then, when the handler ends, the cursor automatically returns to arrow.
I start some calculations in AfxThread() and I need the wait cursor to keep waiting until manualy reseted in another event handler.
Чесноков
|
|
|
|
|
Windows is constantly sending WM_SETCURSOR messages to the window under the mouse. The onlt reason CWaitCursor works is that while you're in an event handler, you're not pumping messages.
If you're doing the calculations in another thread, then your main thread is able to proceed quite happily, so the wait cursor would not be appropriate anyway!
You have a few choices.
1/ My favourite.
Provide a progress bar in your main thread, and a cancel button. As the calculate thread proceeds, post messages to the main thread, which will then update the process bar. But... if this was within your casual abilities [*], you would not be asking the question...
2/ Handle WM_SETCURSOR, and return differing values.
This is still not easy...
You need to set the view to use a window class with no default cursor:
BOOL CMyView::OnSetCursor( CWnd* pWnd, UINT nHitTest, UINT message )
{
if (m_bThreadRunning)
{
::SetCursor (::LoadCursor (NULL, IDC_WAIT));
return TRUE;
}
return FALSE;
}
How you set the m_bThreadRunning flag is another question. But you know when the thread starts, as you fire it yourself. And you must have some way of knowing when the calculations are done, or they're not much use to you!
3/
Well, there are many other ways, but a lot will depend on the nature of your application, which I can't see.
Good luck - you'll find many more problems with multithreading. It's very powerful, but hard. And pretty much expected from any modern program.
Iain.
[*] I'm not trying to be patronising. I have every confidence you will gain experience, and be able to do this stuff in your sleep.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
2) Is a good solution. And it worked.
But if the user clicked the button, and left mouse without movement during thread execution, upon termination of the thread there will be no WM_SETCURSOR events in that case.
How to return back to arrow in that case. We need to call explicitly OnSetCursor()? with which params?
I tried OnSetCursor(this, HTCLIENT, WM_MOUSEMOVE); those but the cursor still remains waiting.
Чесноков
|
|
|
|
|
Well, I set the cursor to the WAIT one, using SetCursor / LoadCursor. Look up the function for yourself, and the answer to your question will become obvious.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|