|
Project RAJA wrote: I need to know how to show the progress bar in staus bar,
Here is a simple function which does this. This function assumes both progress and status bars are created!
void CProcessViewerDlg::SetUpProgressBar()
{
if( !m_StatusBar.GetSafeHwnd() || !m_PrgCtrl.GetSafeHwnd() )
{
return;
}
CRect crPaneRect;
m_PrgCtrl.SetParent( &m_StatusBar );
m_StatusBar.GetStatusBarCtrl().GetRect( 1, &crPaneRect );
crPaneRect.DeflateRect( 0, 2, 2, 2 );
m_PrgCtrl.MoveWindow( crPaneRect );
}
This sample is taken from my ProcessViewer application -> http://www.codeproject.com/KB/cpp/processviewer.aspx[^]
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
there are so many good articles over Codeproject, why do people don't spare some little time to seek them ?
|
|
|
|
|
Lazyness? :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
indeed, my post was telling : "search, don't ask, lazy monkey !"
|
|
|
|
|
I created a workplace, in the project there were some projects. Some of the projects were librarys to be used by some other projects. In another word, there were some projects depending on other projects in the same workplace.
The problem is, how to set the projects which were dependent on other projects, so that, when I want to link or compile them, their dependencies would be linked or compiled first?
Thanks
|
|
|
|
|
For VC6 I don't remember exactly where it was but you have to look for "Project Dependencies". I think you can right-click on a project and then in the pop-up menu you'll have that option.
Once you have found it, you simply specify which other projects in the workspace your specific project depends from. Then, the build order will be automatically updated.
|
|
|
|
|
OK. I got it. In fact, I use VC2005 but VC6, I quested for one of my friends.
It's so simple, only select the "project" menu, then the "dependencies" sub-menu.
Thanks very much.
|
|
|
|
|
how can we implement CSpinButtonCtrl with float values?
|
|
|
|
|
See CNumSpinCtrl[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
|
i want to show different values to an edit bix when my program is running. right now i m generating the valuses but i am only able to show the last value that i generated.i used Updatedata(FALSE)-it only passes the last value that i generate inside my code.
i need to solve this. hopefully there are expaert gyus who can help me.
thanks,
shohel ahmed
|
|
|
|
|
What do you mean by you want to show different values in an edit box? Are you wanting to show everything together? And can you show us your code? How are you generating values and what exactly do you want to show in the edit box?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
It may be the case that the value in the edit box are updated so fast that you are only able to see the last value, did you check for this?
How and when are you updating the value in the edit box?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Most likely you are trying to do this in some kind of loop - the update won't occur until you leave the loop (or function) and that's why you only see the last.
One option is to force an update after you set each value, so in your loop, you would do something like:
for (i = 0; i < SOMEBIGNUMBER; i++)
{
...
...
UpdateData(FALSE);
GetDlgItem(IDC_MYEDIT)->UpdateWindow();
}
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
thnx a lot. its now working.
|
|
|
|
|
I used CDaoDatabase in my App.
the App is not working (database error) when I installed it in a clean PC.
If I install VC6 on the clean PC, the App works fine.
I think I need some extra files (such as DLLs) from VC6 for the App's installation.
do you know what they are?
thanks
|
|
|
|
|
includeh10 wrote: I think I need some extra files (such as DLLs) from VC6 for the App's installation.
do you know what they are?
You need to install vcredist.exe[^] on the target computer.
So, what is vcredist.exe?
Vcredist.exe is a self-extracting executable file that installs the latest version of the Microsoft Visual C++ run-time files and operating system components that are required by most projects created with Visual C++ 6.0.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks.
I downloaded vc6redistsetup_enu.exe then extracted to vcredist.exe then run vcredist.exe.
I still have same problem:
Error: CDaoException
SCODE_CODE=340
SCODE_FACILITY=4
SCODE_SEVERITY=1
ResultFromScode=-2147221164
What is that?
|
|
|
|
|
vcredist.exe has got nothing to do with this.
You have a different problem and you need to give more information to get an answer. Hint: Look at the sticky post at the top of this page, which says "How to get an answer to your question".
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Default DAO version for MFC 6.0 that comes with VC6 is 3.5 although it can support 3.0 and 3.6, too.
I think, you should install DAO 3.5 as well on target machine.
To determine its existence, look for DAO350.dll in "\Program Files\Common Files\Microsoft Shared\DAO" folder.
DAO 3.5 also comes with earlier MS Office versions (i think, Office 97).
|
|
|
|
|
Here is an interesting bit of code:
<br />
void f(const int& i)<br />
{<br />
int* ip = (int*)(&i);<br />
(*ip)++;<br />
}<br />
int main()<br />
{<br />
int i = 0;<br />
<br />
cout << "i in main before f() is: " << i << endl;<br />
f(i);<br />
cout << "i in main after f() is: " << i << endl;<br />
return 0;<br />
}<br />
and even more interesting is:
<br />
int main()<br />
{<br />
const int i = 0;<br />
<br />
int* ip = (int*)&i;<br />
(*ip) = 65418;<br />
<br />
cout << "Address of i = " << &i << endl;<br />
cout << "Address ip points to = " << ip << endl;<br />
cout << "Value of i = " << i << endl;<br />
cout << "Value ip of the address ip points to = " << *ip << endl;<br />
return 0;<br />
}<br />
<br />
The question is, what's happening? I'm still looking into this. Just thought I'd toss is out to see what others thought.
Also, this makes for an interesting security question. If you are given pre-defined function declaration such as: void f(const int& i) or a constant reference to a struct, what keeps the coders from changing information internally.
Cheers!
|
|
|
|
|
You can do anything you want to a const value, the const modifier is simply a keyword the compiler can use to optimize code, it's still just a memory address, plain and simple.
|
|
|
|
|
frozenkore wrote: f you are given pre-defined function declaration such as: void f(const int& i) or a constant reference to a struct, what keeps the coders from changing information internally.
Nothing prevents and I agree with you: that is, IMHO, a C++ weirdness. Of course it is only my personal opinion.
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
|
|
|
|
|
frozenkore wrote: The question is, what's happening?
You're using C-style casts to tell the compiler that it's safe to ignore the const qualifier of the parameters. It would be better to use the C++ const_cast operator to make your intentions clearer, or use static_cast if you actually don't want to change the constness.
|
|
|
|
|
frozenkore wrote: what keeps the coders from changing information internally
Nothing, but there's a risk of breaking the app. For example:
void f(const int& i)
{
(int&)i = 321;
}
void somefunc()
{
int i = 123;
f(ci);
static const int ci = 123;
f(ci);
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|