|
I do not know if this helps, but this links[^] to an article about CPropertySheets.
~RaGE();
|
|
|
|
|
Hello,
I've searched for articles, samples... in codeproject, msdn and in other web resources and I've not been able to find how to do (change the color of ONE tab while the other ones still appear as the standard ones).
The article that you link in your post is a very good article from Mr. Demirhan, but it changes the font of all the tab ctrl (not only of one tab...).
But thank you for your answer...
|
|
|
|
|
Have revisited a C++ program i wrote about 6 years ago. It used the THREED vbx controls. Am now using Visual C++ 6.0 and i can not develop with them as they need a licence. Originally got them from buying the SAMS Visual C++ 1.5 book and CD. Anyway, i decided to replace them with an ocx that is more available. When i did an 'insert activex control', the Microsoft Forms 2.0 controls were available. Had no probs replacing my command buttons and frames but the check boxes have been a nightmare. Then i thought the toggle button might look better and tried it. Still a nightmare. Where my problem lies is in seeing the state of the checkbox and/or toggle button. Thought the following line would differentiate between depressed and not depressed:
if (m_ToggleButton1Control.GetValue == false)
However, it always returns true. i use other properties that work:
{m_ToggleButton1Control.SetForeColor(olive_note);}
The 'value' is defined as a VARIANT of which i can not find any documentation.
Can anyone help???
benny
|
|
|
|
|
bennyrascal wrote:
if (m_ToggleButton1Control.GetValue == false)
Should work, if m_ToggleButton1Control is of type bool (or even BOOL ), and if you used UpdateData (or corresponding message) with parameter TRUE.
~RaGE();
|
|
|
|
|
Thanks
Can't use true as i get a compiler error:
D:\Development\C++\Source\CheckBoxes\CheckBoxesDlg.cpp(195) : warning C4805: '==' : unsafe mix of type 'struct tagVARIANT (__thiscall CMdcToggleButton::*)(void)' and type 'const bool' in operation
When using the class wizard to add a member variable the only choice i have is a category of control and a variable type of CMdcToggleButton. There are no other choices. If i use the standard checkBox then i get the categories of control and of value and the value bit works.
As far as the updatedata, Here is the actual code:
void CCheckBoxesDlg::OnClickToggleButton1()
{
UpdateData(TRUE);
m_ToggleButton1Control.UpdateData(TRUE);
m_ToggleButton1Control.GetValue();
if (m_ToggleButton1Control.GetValue == false)
{m_ToggleButton1Control.SetForeColor(olive_note);}
else
{m_ToggleButton1Control.SetForeColor(red_note);}
}
As you can see i even did the update two different ways as an experiment.
A similar function for a simple checkbox works perfectly:
void CCheckBoxesDlg::OnClickFormsCheckBox1()
{
UpdateData(TRUE);
if (m_FormsCheckBox1Control.GetValue == 0)
{
m_CommandButtonControl.SetForeColor(blue_note);
m_CommandButtonControl.SetCaption("FormsCheckBox set on");
m_FormsCheckBox1Control.SetBackColor(blue_note);
}
else
{
m_CommandButtonControl.SetForeColor(yellow_note);
m_CommandButtonControl.SetCaption("FormsCheckBox set off");
m_FormsCheckBox1Control.SetBackColor(yellow_note);
}
}
Again thanks for any help as i'm baffled.
benny
|
|
|
|
|
i really need this; i want to setup the Format of a COleCurrency.
if the number is (for example) "189.728149" the hole number will be copied to a string wenn formatting it to a string. How can i change this, so after formating the number i will only have 2 decimals("189.73").
ofcourse it also has to go the other way: "189.7" ==> "189.70"
thanks in advanced..
[]D [] []D []
|
|
|
|
|
COleCurrency::Format is returning a CString . Maybe you should change the returned CString format using CString::Format so you won't have to bother finding a COleCurrency format that matches your wishes ?
~RaGE();
|
|
|
|
|
strCurrency.Format("%.2f",nNumber);
|
|
|
|
|
where do i get nNumber? i only have the COleCurrency, the only conversion that is possible is COleCurrency => CString(or do i get this wrong)
[]D [] []D []
|
|
|
|
|
I haven't used COleCurrency, just COleTime.. if it only returns a string you could do a float nNumber = atof(string).. this would produce the number nNumber.. then you could format this number as i posted before..
Hope this helps..
Rob
|
|
|
|
|
thnx.... i already found another solution
|
|
|
|
|
I'm trying to export a template class from a DLL...
For this, I use AFX_EXT_CLASS.
I observe (with a DLL viewer) that a template class can't be export from a DLL but a simple class well... Is this normal? A solution?
Here is some of my header code:
A simple class... : the class is exported, OK
class AFX_EXT_CLASS FIFO
{
public:
enum tagBUFFER_STATUS{ FREE = 0x00, BUSY = 0x01 };
struct tagARRAY {
int _buf;
tagBUFFER_STATUS _sts;
};
DWORD In(int& value);
DWORD Out(int& value);
FIFO();
virtual ~FIFO();
private:
tagARRAY _array[10];
int _itr;
int _itw;
};
A template class... : the class is not exported, KO
template<class T, int Size>
class AFX_EXT_CLASS FIFO
{
public:
enum tagBUFFER_STATUS{ FREE = 0x00, BUSY = 0x01 };
struct tagARRAY {
int _buf;
tagBUFFER_STATUS _sts;
};
DWORD In(T& value);
DWORD Out(T& value);
FIFO();
virtual ~FIFO();
private:
tagARRAY _array[Size];
int _itr;
int _itw;
};
My question: how to export a template class from a DLL?
Thanks for your help...
Hello World!!!
from Raphaël
|
|
|
|
|
Raphaël Kindt wrote:
how to export a template class from a DLL?
It's not possible. The compiler generates code only for concrete implementations of the class. Otherwise it only does some syntax and type checking.
Look at the ATL classes' implementation, it's written entirely in the header files.
rechi
|
|
|
|
|
Bogdan Rechi wrote:
It's not possible
I'm not sur because I found this in MDSN library:
Explicit instantiation lets you create an instantiation of a templated class or function without actually using it in your code. Since this is useful when you are creating library (.LIB) files that use templates for distribution, uninstantiated template definitions are not put into object (.OBJ) files.
But I can be mistaken...
Hello World!!!
from Raphaël
|
|
|
|
|
MSDN wrote:
Explicit instantiation...
The explicit instantiation is a particularized version of the template class. You can export a finite number of versions for your class, that's true. But there are template classes that support an infinite number of versions. What about them? Do you intend to write all the versions for such a class?
rechi
|
|
|
|
|
nop... you're right...;)
Thanks for your reply...
Hello World!!!
from Raphaël
|
|
|
|
|
Hi Y'all!
How can i calculate the number of files in a folder programmatically in a
Win32 API Application???
|
|
|
|
|
I don't know if this is the best choice but: "use FindFirstFile , FindNextFile , FindClose "
Funny how the history is repeating...
rechi
|
|
|
|
|
|
My main application thread starts a auxillary UI thread in order to display a dialog and show some progress information. The main app thread updates the auxillary thread's dialog with information it processes.
The problem: What is the best way to let the main app thread know that the auxillary thread is started and that the dialog is loaded(displayed) and ready for input?
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
if the main thread is a ui tread .. you can use PostMessage function to notify it
|
|
|
|
|
|
for ms OS 95/98/00/ME/XP.../NT etc, which one do you think is best and worst?
the post is just for general knowledge.
thx
includeh10
|
|
|
|
|
depends on what you need it for.
W95 - is out of the picture W98 is improved version of it
W98 - excellent for home environment and computer-illiterate people. Bad memory management, no security, no true, multitasking, no UNICODE.
W ME - same as 98, but seems to be less stable.
Nt4 - excellent professional system (security, multitasking, stability + good memory management and native support for UNICODE), true services. Relatively difficult to configure, no hardware wizards.
W2K - significantly improved version of NT4 (with hardware wizard), there is better memory management and improved security. From developers standpoint it has much better APIs. Do not forget telnet and COM+.
Win XP - same as W2k, but seems to be less stable especially with older software and drivers (the once that rejected by wizards). The concept of the WindowStation is improved but seems to be exposing the system (security and stability wise)
|
|
|
|
|
for w2k and win XP don't forget the IO Completion Ports for network connections, they rule...
[]D [] []D []
|
|
|
|