|
i draw my icons with gdi+ because my programm has to resize the icons with good quality or draw anything over it. so i can't use an imagelist...
|
|
|
|
|
How can we set the progress bar for a situation where we dont know how much time the operation takes like Windows displays the progress when copying/Moving a file it varies depending on read data speed.
Is there any estimation method. I saw one article on this site called Timed Progress but the code is not at all documented so i cannot understand what it is doing? Can anyone suggest something?
Vikash
|
|
|
|
|
What you can set in a progress bar, is the the range, the position and the step.
Lets say the range is 0 to 100, the starting position is 0 and the step is 1.
You should do the calculation in a way that in the end you have a hundred, You dont really care about the time, what you care about is to put your StepIt function in a way that it gets called on every "iteration" of the long process so the progress bar gets updated, this shows that you need somehow to know the number of iterations needed and based on that to calculate your step.
So for a range of 100 , an iterations number of N > 0 , the step should be 100 / N.
If you cant know the iterations number, you should try to "approximate it"
Hope this helps,
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thank you. But suppose the process is spread over several loops then how do i do it.
|
|
|
|
|
Then divide by the number of loops too
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Does anybody have info on this subject ?
thanks
|
|
|
|
|
hi
I want to create a new desktop under WIN98.I may create a new desktop under win2000 with "createdesktop" API funtion ,under win98 how to do???
c++
|
|
|
|
|
|
Hello people
a newbie here. I want to display a BMP image by its path like the BMP file is located in my hard drive and i am using the file open dialog box to get the path i get the path but i dont know what to do next like the CBitmap class only takes resources string that are loaded from the exe how do i pass the path to the CBitmap class so that it opens the BMP from a location in my hard drive pleas help
Regards
Ahmed Ajmal
|
|
|
|
|
|
Hi!
I'm trying to use an ActiveX dll in my C++ program.
The dll is written in VB (not by me), so I generated a h-file from the idl.
Everything compiles, but when I run the test program I get
an error at the line with a below.
The code is really simple, but I don't know what is causing the
error. Anyone familiar with what might be wrong here? Thanks...
<br />
void TestDlg::OnOK() <br />
{<br />
HRESULT hRes;<br />
_cTheObj *pTheObj = NULL;<br />
<br />
UpdateData(TRUE);<br />
<br />
hRes = CoInitialize(0);<br />
<br />
if (SUCCEEDED(hRes))<br />
{<br />
hRes = CoCreateInstance(CLSID_cTheObj, NULL, CLSCTX_INPROC_SERVER, IID__cTheObj, (LPVOID *)&pTheObj);<br />
<br />
if (SUCCEEDED(hRes))<br />
{<br />
SHORT ret;<br />
VARIANT l1;<br />
VariantInit(&l1);<br />
l1.vt = VT_BSTR;<br />
l1.bstrVal = m_logon1.AllocSysString();<br />
<br />
hRes = pTheObj->Logon(l1, &ret); :confused:<br />
The definition of the Logon funcition in the h-file for the dll looks like:
<br />
virtual HRESULT STDMETHODCALLTYPE Logon( <br />
VARIANT arg1,<br />
VARIANT arg2,<br />
VARIANT arg3,<br />
VARIANT_BOOL __RPC_FAR *__MIDL_0014) = 0;<br />
Thanks for any help!
|
|
|
|
|
Looks like you are only passing one argument where it is expecting 3, and looks like it might not be initialized, at that.
|
|
|
|
|
Oh, I'm sorry! I only removed the other variables from the code presented to you, to make it more readable!
"Time to give a Newtonian demonstration,
of a bullet, its mass and its acceleration."
-Stephen Hawking the gangsta rapper
|
|
|
|
|
How to determine whether a nontopmost window is at the top of all nontopmost windows?
|
|
|
|
|
Anybody know how to format and print the content of a list control??
Please help me
Proper Planning is way to success
|
|
|
|
|
|
Any other simpler way to do it??
for example, by having 1 class and few functions.
Proper Planning is way to success
|
|
|
|
|
Hi, does anyone know what theme name and parts i need to draw a themed toolbar bg?
im currently making my own toolbar , and i can draw the themed buttons and separators but i dont know the name and part id's i need to draw the bg with the drawthemedbackground api..
//Roger
|
|
|
|
|
I have inherited my controller from a CListCtrl. But I want to change so the double click message is not sent. I want the OnLButtonDown message to always be sent. Don’t want any double click.
From want I understand is I need to remove the CS_DBLCLKS from window class style that is registered.
How do I do that ? or should it not be changed since it’s a standard controller.? Should I register and use a new class info? how do I do that from an inherited class ?
/Mathias
|
|
|
|
|
I'm not sure, if I understood you properly, but I guess that you should do something like this:
1. Run ClassWizard.
2. Go to Message Maps tab.
3. Choose your class (on the left-hand side).
4. Find WM_LBUTTONDBLCLK (on the right-hand side).
5. Hit Add Function and then Edit Code.
6. Remove (e.g. comment out) standard message handler and, if you want to, add your own (e.g. a message box saying that double clicks are disabled).
void CTest::OnLButtonDblClk(UINT nFlags, CPoint point)
{
AfxMessageBox("Double clicks are disabled.");
}
Let me know if this was helpful.
"Gods die, when their believers are gone." --from Sandman by Neil Gaiman
|
|
|
|
|
No. the Double click event from windows is still sent to the applications.
so when i click too fast, I only get 1 respone to OnLButtonDown() insted of 2.
the problem is that the window class has the CS_DBLCLKS flag set. and this
tell the OS that this windows should recive the double click event.
So I need to remove that.
AND i just found the solution. after searching the net for some hours.
this worked.
BOOL CMyListCtrl::Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID)
{
if( CListCtrl::Create(dwStyle, rect, pParentWnd, nID) )
{
DWORD dwStyle = GetClassLong( GetSafeHwnd(), GCL_STYLE);
SetClassLong( GetSafeHwnd(), GCL_STYLE, (dwStyle ^ CS_DBLCLKS) );
return TRUE;
}
return FALSE;
}
/Mathias
|
|
|
|
|
Try the PreTranslateMesssage event handler.
[MODIFIED]I guess you have found your solution and it even far more better. Glad it works out that way and I have learned. [/MODIFIED]
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
:|how can i get the text from CComboBox i has input?
|
|
|
|
|
int iIndex = -1;
iIndex = MyCombobox.GetCurSel();
CString strText;
MyCombobox.GetLBText(iIndex, strText);
Er zit een korstje op mijn aars.
|
|
|
|
|
hi,sorry,
MyCombobox's data is empty,the data
i has input is not belone Mycombobox,
GetLBText() will cause a error;
the data i has input is the exe run
|
|
|
|