|
Hey,
I am working on this existing project and my job is to make some certain action occur when a particular tab in a dialog is selected. With this in mind, I am trying to use CTabCtrl::GetCurSel() but I am not having much success. I am aware that this function returns the zero-based index of the selected tab, which is the problem for me. At first, I used the nPageID value that was used in AddSSLPage() for the tab to see if the GetCurSel() return that particular tab but nothing happens.
At this point, I would like to know how can you find out the index of a tab? Any help will be greatly appreciated!!!
|
|
|
|
|
What do you mean with 'nothing happens'? Maybe you could show us your code, comparing nPageID with GetCurSel() is not a bad approach in itself.
'I would like to know how can you find out the index of a tab'. What do you use to identify a certain tab? Perhaps the CTabCtrl::GetItem[^] function can help you, it links a position to the label.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
Thanks so much!!!
This is what I have
int selectedtab = m_tabcontrol.GetCurSel();
if(selectedtab == 2)
{
do some action
}
So are you saying if the second tab has nPageID is 2 and it is selected GetCurSel() should return 2?
|
|
|
|
|
nPageID is 0-based as well, so it should work nicely with GetCurSel().
The second tab, when you mean second when counting from left to right, would have an nPageID of 1 though; the leftmost tab has nPageID = 0 and then it goes up 1 for each tab to the right.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
Hi,
I have a jpg image on a IPicture* interface and I wish to save it to a file. Looking on MSDN it appears that I can use the IPicture::SaveAsFile() method but I don't relly understand what I need to do to get from a filename to being able to call SaveAsFile().
Could anyone please explain, or better still give me a few pointer (sorry for the pun ) to some code frags?
Thanks
Tony
|
|
|
|
|
I suppose you've to use SHCreateStreamOnFile [^], see, for instance, http://www.ureader.com/msg/1478976.aspx[^] (first reply).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks,
That works great!
|
|
|
|
|
You are welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
i m using access with odbc connection and use CRecordset class,
some time the table item have value like "#Error".and if i want to try read this record than exception is generate here.
please tell me how can i remove this record or tell me anything else to handle this.
thanks in advance.
|
|
|
|
|
Le@rner wrote: some time the table item have value like "#Error".
This is information that you should use to diagnose and fix a problem. Rather than just getting rid of the offending record you should try to discover why it is giving the error.
I must get a clever new signature for 2011.
|
|
|
|
|
C language program
Project launched three stepper motor uln2803, parallel port
modified on Sunday, January 30, 2011 6:43 AM
|
|
|
|
|
I want a yacht crewed by blonde nymphets.
I must get a clever new signature for 2011.
|
|
|
|
|
|
While I don't need the yacht.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
A Windows PC is no good at driving stepper motors. What you need is a micro-controller to handle real-time generation of steps.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
|
While I usually try to avoid any message boxes that do not stem from my own code, I now am facing a box that comes from MFC, but the weird thing is that it is empty... which is not that helpful. I stumbled upon this a few times during testing, but never cared since I removed the various DDV_XXX functions later that caused those boxes. This only happens in Release build, which uses statically linked MFC, so I suppose it has something to do with that...
Is there any way to get some more meaningful message boxes with statically linked MFC?
http://www.renderpal.com
http://www.shoran.de
|
|
|
|
|
Do you use custom DDV processing? Can you post the DDV code that causes this? What VS version?
|
|
|
|
|
No and no; the VS version is 2005. If I knew where exactly this errors pops ups, I'd be much further... I am also not sure if it is a DDV call, since I barely use them.
http://www.renderpal.com
http://www.shoran.de
|
|
|
|
|
Daniel 'Tak' M. wrote: I now am facing a box that comes from MFC
What do you mean by this? I don't think you will get random message boxes without writing some code.
Daniel 'Tak' M. wrote: I stumbled upon this a few times during testing, but never cared
Big mistake.
I must get a clever new signature for 2011.
|
|
|
|
|
I suggest you follow the tried and true and procudure of getting a stack trace when the problem occurs. You may want to alter the settings for the release build so that a pdb file is built (so you get a more meaningful stack).
Steve
|
|
|
|
|
My main problem is not to find out where it occurs, the main problem is why all warnings and errors from MFC are empty... It doesn't happen only this one time, it happens for every DDV call as well, for example, and I'd really prefer some more meaningful message boxes (crazy, I know). Is there, for example, a resource DLL that has to be shipped with my program so that MFC can load its error messages properly? Something like that...
http://www.renderpal.com
http://www.shoran.de
|
|
|
|
|
Daniel 'Tak' M. wrote: Is there, for example, a resource DLL
If you create a standard MFC app and choose the defaults, you will see that "afxres.rc" is included in the project's .rc file.
|
|
|
|
|
- Consider a class that is used as a utility by many of your classes.
- The classes that can use it (I'm calling it the host or parent class for now) must, derive from some abstract base class .
- When you instantiate the utility class, the constructor takes a reference to the host or parent class so it can call the base class methods the hosts are required to implement. This reference is stored as a member in the utility class object instance.
(NOTE: lifetime issues are taken care of properly since the utility class object is a member of the host but that is unrelated)
What do you refer to this member variable (reference) for the hosting class as?
I've been using...
m_parent
m_host
However, I'm wondering if these don't convey the relationship properly.
What terms do some of you use for such a relationship?
|
|
|
|
|
How about m_container or maybe m_utilizer ?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|