|
I know it's going to be simple, but can anyone please tell me how can I get current tab position or ID in a dialog box?
|
|
|
|
|
send TCM_GETCURSEL message to the control
int nIndex = static_cast<int>(::SendMessage(GetDlgItem(hMyDlg, ID_MYTABCTL), TCM_GETCURSEL, 0, 0));
|
|
|
|
|
If you're talking about the currently activated tab in a tab control, then the message above is correct.
If you want to find which control is active, then use GetFocus() .
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Thanks for your help, Alex and Ryan. Send TCM_GETCURSEL message is all I needed.
|
|
|
|
|
skinnyreptile wrote:
Thanks for your help
You're welcome
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
I am trying to pass a vector to a function, but something is wrong.
I think I am declairing the prototype and function incorrectly
this is what I have
in my *.h file
int static parseData(vector<double> v);
in my *.cpp file
<br />
RFMAccess::someFunction(){<br />
<br />
\\do some stuff here and pass the vector<br />
parseData(data);<br />
}<br />
<br />
<br />
int RFMAccess::parseData(vector<double> v){<br />
<br />
\\do some stuff with the vector here<br />
<br />
return 0;<br />
}<br />
I actually need to pass the vector to another function in another class, but this is the idea I am trying to do.
I would pass-by-reference but, as mentioned the function is in another class.
thanks,
Steven
|
|
|
|
|
vector is not a type, it is a template.
|
|
|
|
|
I didn't realize that the code left off the <double>
The function looked more like
RFMAccess::parseData(vector<double> v)
does this look corret?
steven
|
|
|
|
|
I think you meant to do something like
RFMAccess::parseData(vector<int>& v)
|
|
|
|
|
or
RFMAccess::parseData(const vector<int>& v)
|
|
|
|
|
I tried 2x to get the greater than and less than symbols in the message but they kept getting left off.
I just realized that they were at the bottom
RFMAccess::parseData(vector<int> &v)
is this the correct notation?
steven
|
|
|
|
|
I understood that. What I was implying is that you might want to pass your vector by reference(or constant reference). You might not want to create a copy of the array/vector every time you call the function(unless it was your intent;)).
|
|
|
|
|
|
I didn't realize that the code left off the <double>
The function looked more like
RFMAccess::parseData(vector<double> v)
does this look corret?
steven
|
|
|
|
|
I got my hands on a Xerox copy of some notes, which says that AfxWinTerm() is called *after* ExitInstance() in an MFC application.
MSDN doesn't even have an entry for AfxWinTerm() . MSDN search and Google weren't very helpful.
I'm beginning to suspect these notes I have are very old and refer to outdated content. Am I right?
Vikram.
-----------------------------
KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames.
pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext, adEven adWhen vSpeaking.
|
|
|
|
|
Was just poking around CP and found this article..
http://www.codeproject.com/cpp/mfcprogflow.asp
Quote from the article..
Once WM_QUIT is received Run returns and control returns to AfxWinMain which performs clean-up and lastly calls AfxWinTerm which deletes all the global application structures that were created.
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I wanted to know how Could i Send email in an Visual C++ App. Is there any API to do that ?
|
|
|
|
|
Several. Look at:
CDocument::OnFileSendMail()
(Extended) MAPI
SMTP
CDO
|
|
|
|
|
|
|
Hi All,
I would like to iterate through every item in a list control and change each item's icon based on a time criteria. I have tried GetItem() but I haven't been able to use it correctly (the documentation is very vague) as I only get an empty structure back even though I put the index I am after in iItem. Could someone please help me out here?
Cheers,
Clint
|
|
|
|
|
Before calling GetItem(), you need to set the mask member of your structure with the flags (or'ed together) for the element values that you want to retrieve.
struct LVITEM sItem;
sItem.mask = LVIF_IMAGE | LVIF_PARAM | ... whatever else you want...
m_oMyListCtrl.GetItem(&sItem);
onwards and upwards...
|
|
|
|
|
Guys,
How can I get text info into the systray? Something like the clock. All the examples I see are to put icons there but I need to put a small amount of text there (and it would be great if I could change the color of it too - maybe even make it scroll.)
Thanks!
|
|
|
|
|
There's no support for this in the API. If your text can fit on a 16x16 icon, then you can create an icon dynamically with the text on it. Otherwise, you'll have to be extremely creative, possibly finding the system tray window, and creating a child window inside it. It's not that simple either. You might even have to subclass the taskbar so that you can stop the taskbar's default tray positioning, which means writing a DLL and using either SHLoadInProc() or a system-wide hook to get into explorer's address space...
If you manage it, write an article . You might want to find another way of showing the information though. It's probably not worth the effort of reprogramming Windows.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hi all,
I have an an application that is a Popup Dialog box in a dll. I'm using MFC 6.0.
my problem is I'm trying to load a menu bar icon on the sucker, and I just can't get it to load. I thought I do this:
SetIcon(::LoadIcon(NULL,MAKEINTRESOURCE(IDR_MAINFRAME)),FALSE);
in the OnCreate Overrideable in my CDialog-derived class. Doesn't work though. It always returns 0x000000 for the HICON.
any suggestions on how to do this? I'm sure I'm just putting it in the wrong place or performing the operation wrong.
Any insight, comments or suggestions are greatly appreciated.
Thanks!
|
|
|
|