|
well my limitation is I can not modify the date_t structure code.
|
|
|
|
|
so why not creating two overloads of the function ? one with no parameters, the other getting a date_t ?
moreover, even without changing the date_t structure, using function(date_t t = date_t()) { } should work if the structure don't define any constructor (the compiler defines one by default).
|
|
|
|
|
Hello v2.0,
Is the fact that the default constructor sets all struct field values to 0 a C++ Standard or is it compiler-dependent ?
Thanks, v2.0,
Bio.
|
|
|
|
|
in C++, structures are actually classes.
when a compiler (whatever the plateform) sees no constructor defined in a class, it creates implicitely an empty one for that class...
there, i cannot be sure that the fields will be filled with 0, but i think so.
to be verified.
|
|
|
|
|
You could derive from it:
struct my_date_type : date_t
{
my_date_type()
{
}
my_date_type(short y, byte m, byte d): year(y), month(m), day(d)
{}
};
Now you can use it as follows:
my_date_type d1 = my_date_type(2006, 1, 1);
my_date_type d2 = my_date_type();
void function(my_date_type t = my_date_type())
{
}
Steve
|
|
|
|
|
You can do like this...
date_t t = {12,12,12};
<font color=blue>void</font> function(date_t arg = t);
....
<font color=blue>void</font> function(date_t arg)
{
....
}
Nibu thomas
Software Developer
|
|
|
|
|
I think this is probably the best technique so far.
Steve
|
|
|
|
|
i have to gif image on picture box if anybody know please give me answer ASAP
Bankey Khandelwal
Software Engineer
|
|
|
|
|
|
i am trying like this but this give reference error please reply ASAP
CBitmap *bitmap1=(CBitmap *)GetDlgItem(IDC_STATIC1);
bitmap1->LoadBitmap(IDB_BITMAP1);
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Bankey Khandelwal wrote: CBitmap *bitmap1=(CBitmap *)GetDlgItem(IDC_STATIC1);
bitmap1->LoadBitmap(IDB_BITMAP1);
GetDlgItem(...) returns a CWnd* . You are trying to cast it to a bitmap. This is wrong.
You should do it like this...
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
CStatic *pStatic = (CStatic*)GetDlgItem(IDC_STATIC1);
pStatic->SetBitmap(bmp);
Nibu thomas
Software Developer
|
|
|
|
|
thanks you,
it is loading but not show on button where is i wrong please reply
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Bankey Khandelwal wrote: not show on button
Is it a button! or Is it a Static!
Nibu thomas
Software Developer
|
|
|
|
|
it is static
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Your static control must have the style SS_BITMAP (for bitmap) or SS_ICON (for icon).
Nibu thomas
Software Developer
|
|
|
|
|
ya there is type bitmap but there is no style property like bitmap etc.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Bankey Khandelwal wrote: ya there is type bitmap
Yes that is the one.
Nibu thomas
Software Developer
|
|
|
|
|
You said it is loading but not show on button,the reason is u have to check the button properites as ownerdraw.
It works now
Kiranmaye
|
|
|
|
|
U can directly load on picture control by changing the control properties
Right click on picture control and change type to bitmap and select bitmap id in Image.
|
|
|
|
|
Set the type of button as bitmap and perform the following :
(here m_bit is an object of CBitmap , m_btnStart is the variable for CBitmapButton)
m_bit1.LoadBitmap(IDB_BMPSTART);
HBITMAP hBit1 = (HBITMAP) m_bit1.GetSafeHandle();
m_btnStart.SetBitmap(hBit1);
// Use m_btnStart.SizeToContent() if you want to set the size of the button to that of the image being displayed on it
(open the resource editor and copy the .gif image to the bitmap image in the resource editor)
*******and yes on the picture control you have to set the type as bitmap and pass the image name of the bitmap in the IMAGE option of resource editor
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
-- modified at 5:31 Thursday 2nd March, 2006
|
|
|
|
|
Hello everyone. I would like to know how to launch an application (.exe) when clicking a button on an MFC dialog. Thanks in advance
Aman
|
|
|
|
|
|
Use ShellExecute()
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
Hi,
use ShellExecute()
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
hello members
please help me how to use the runreportwizard method in VC++ 6.0 using crystal reports 11. i have developed a simple mfc which can design, preview, open and save reports. but now i want to add the reportwizard. please help me out.
|
|
|
|