|
I'm a beginner of VC++/MFC, but I still don't get some C++ basics, like working with 'friend' and 'operator' and arrays, especially when they're declared to be a class member (this isn't good English, is it?).
But if I understand it well, max_element is a macro (or function, whatever) in <algorithm.h>. Is that correct? If it is, it'd really help me.
|
|
|
|
|
Hi all,
usually when i try to handle EN_CHANGE i catch it in my dialog.....
now, i have a class that inherits from CEdit. i want to handle the EN_CHANGE with in that class....
what can i do??
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Have an ON_REFLECT_COMMAND handler in your derived class.
Steve S
|
|
|
|
|
How do I determine if a slider is changed? There is no message for that.
(So, if I fiddle around with a CSliderCtrl, what message or whatever is sent/whatevert?)
|
|
|
|
|
Spin button controls send you a WM_HSCROLL or WM_VSCROLL message. Not sure what a slider does
Roger Allen
Sonork 100.10016
Death come early, death come late,
It takes us all, there is no reason.
For every purpose under heaven,
To each a turn, to each a season.
A time to weep and a time to sigh,
A time to laugh and a time to cry,
A time to be born and a time to die.
Dust to dust and ashes to ashes,
And so I end my song.
|
|
|
|
|
As already said, spin controls send WM_H/VSCROLL messages.
Sliders = Trackbar controls send TB_LINEUP etc.
Look in the Platform SDK under User Interface Services > Windows Common Controls.
OK?
|
|
|
|
|
A spinbutton control sends UDN_DELTAPOS to its parent window when it's spun. lParam is the address of "an NMUPDOWN structure that contains information about the position change" (to quote MSDN).
Sliders send WM_HSCROLL and WM_VSCROLL messages.
|
|
|
|
|
How can I receive those messages? ClassWizard doesn't show them. Should I add them to the message map manually?
|
|
|
|
|
You can get ClassWizard to add handlers for UDN_DELTAPOS messages , but I can't remember how I think you just select the spinner control and add a message handler for it. Have a look at my article at http://www.codeproject.com/dialog/CRHChildDialog.asp . Although it's not specifically about spinner controls, it does use them. So if you search the source files for DELTAPOS you'll see what happens.
|
|
|
|
|
DaFrawg wrote:
ClassWizard doesn't show them
Right-click on the Dialog class that contains the spin control. In the window that appears, select the IDC of the control you want to receive notifications about, in the "Class or object to handle" listbox.
UDN_DELTAPOS should appear, along with NM_OUTOFMEMORY, in the "New Windows messages/events" listbox on the left hand side.
There you go!
Sliders receive both the WM_HSCROLL and WM_VSCROLL messages. You can either handle them in the control itself, or through the parent dialog.
The kindest thing you can do for a stupid person, and for the gene pool, is to let him expire of his own dumb choices.
[Roger Wright on stupid people]
We're like private member functions
[John Theal on R&D]
We're figuring out the parent thing as we go though. Kinda like setting up Linux for the first time ya' know...
[Nitron]
|
|
|
|
|
hi,
my application is using mysql as backend. for database connection i am using mysql files from mysql site.i try to build exe in release mode. i got linker error "unresolved external symbol" for mysql class member. in debug mode i got warning only.
thanks in advance.
|
|
|
|
|
Have you added a .LIB file to the build, and only added it in the debug build?
Steve S
|
|
|
|
|
Hi,
Thanks For Ur Help.
Murali.M
|
|
|
|
|
Hi,
I want to create 4 radio buttons of which two form one group and other two form another group on a dialog.I should be able to select one button from each group(i..e two buttons in total).How can I do this?
Karteek
|
|
|
|
|
You need to set the windows style WS_GROUP on the first radio button in each group, and make sure that the tab order has each pair together.
Steve S
|
|
|
|
|
Lay out your dialog.
Select every control on the dialog.
Set the WS_GROUP flag.
Set the tab order so that the buttons in each grouping follow each other.
Select all the buttons in one group, except the first.
Clear their WS_GROUP style.
Repeat for second grouping.
Test, Enjoy, read up on WS_GROUP.
Iain.
|
|
|
|
|
Hallo!
I have to export analysis-data from a MFC-application to an Excel-Sheet. I use Excel 2000 (Version 9) and have created several classes to make data-exchange within C++. To write the data into the sheet is not the problem, I´ve got the problem to send an Excel-formula from the application to the Excel-Sheet in several ranges. I tried to send a simple formula with the code below. The result ist that the string appears in the cells in Excel but isn´t executed automatically. I tried other ways, too but nothing happened or errors were given. Has someone experience in sending and executing formulas from MFC/C++ to an Excel-sheet? I would be very happy! Thank you.
VARIANT vVar;
long index[2];
DWORD numFields[2];
COleSafeArray saCell;
m_oBooks=m_oExcel.get_Workbooks();
m_oBook=m_oBooks.get_Item(COleVariant((short)1));
m_oSheets=m_oBook.get_Worksheets();
m_oSheet=m_oSheets.get_Item(COleVariant((short)1));
...
m_oRange=m_oSheet.get_Range(COleVariant("A3"),COleVariant("D3"));
m_oRange=m_oRange. get_Resize(COleVariant((short)1),COleVariant((shor
t)(4)));
numFields[0]=1;
numFields[1]=4;
saCell.Create(VT_BSTR,2,numFields);
index[0]=0;
index[1]=0;
vVar.vt=VT_BSTR;
csStr.Format("=WENN(A2=0;1;99)");
vVar.bstrVal=csStr.AllocSysString();
saCell.PutElement(index,vVar.bstrVal);
m_oRange.put_Formula(COleVariant(saCell));
|
|
|
|
|
When I'm using a class derived from CSocket in a class derived from CWinThread
the CMyClass::OnReceive(nErrorCode); does not triger.
Can someone explain the reason in some other projects it trigers.
Thank you in andvance
Seval YILMAZ
|
|
|
|
|
|
Hi,
I just want to know how to change the font size and color of the fonts in an edit box.
Thanks
Deepak Samuel
|
|
|
|
|
WM_SETFONT, WM_CTLCOLOREDIT
Steve S
|
|
|
|
|
Hello,
I want to save a Message(such as an EMail or maybe it must be an EMail) in the Inbox(or in a folder that is under the inbox) of Outlook whithout sending it as an EMail.
I have to do it in C++.
I have created wrapper-classes by using the typlibraries from outlook 2000...
Please send me help.
Thanks a lot,
JohnX
|
|
|
|
|
Since you've created a wrapping, I'm assuming you have looked through what's available. Basically, just create a new item of the appropriate type (any type of item, be it standard or custom with the correct form associated). Get a reference to the Inbox folder (several ways are possible using the namespaces). Then just add the item. This is possible with any folder.
I don't have any code samples since I haven't done this in a long time but the idea is still the same and it works. The Inbox is still just a folder, so just add the item to it.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
To create an new item is not the problem.
My problem is who can I get a reference to the inbox folder.
There are no documentations ! How can I do this ?
|
|
|
|
|
Using Outlook's type library:
COleVariant vtOptional((long) DISP_E_PARAMNOTFOUND, VT_ERROR),
vtTrue((short) TRUE);
_Application app;
_NameSpace ns;
MAPIFolder folderInbox;
if (app.CreateDispatch("Outlook.Application") == TRUE)
{
ns = app.GetNamespace("MAPI");
ns.Logon(vtOptional, vtOptional, vtOptional, vtTrue);
folderInbox = ns.GetDefaultFolder(6);
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|