|
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.
|
|
|
|
|
Friends ! I need help !
I have to write a programme in Visual C++ 6 which can listen or sniff the serial port, but without opening the port. The sniffer and the programme which communicates through the serial port has to be on the same PC, I have to write a program which can read ( or listen ) the data that goes out and comes in from the serial port, BUT NOT TO OPEN THE PORT, to let communication programmes communicate through serial ports.
If anyone has an idea how to write this sniffer programme, please send me a advise.
Many thanks !
Szilard
SZ
|
|
|
|
|
You cannot do that (or from what I know you cannot do). When I need to do such a thing, I make a 'harware' sniffer . That is, I connect another connector on the wire so I can plug it into another serial port (if you have two on your computer) and I can sniff the data on the port.
Hope this helps
|
|
|
|
|
Thank you for your reply Cedric .
I don't know if you have heard about the HHD Free Serial Port Monitor. That would be a good model for the programme I have to write. I don't know what tehnique they use. This HHD software monitors in a passive mode al the communication done by other software through the serial port, I don't think it opens the port otherwise it could block the communication for other software.
I also have another question, what if I use assembler code, embedded C or something like that, and integrate in my visual C++ code?
I think there has to be a possibility to read the memory location through which the serial communication is done.
Thanks in advance !
Szilard
Szilard
|
|
|
|