Welcome Guest ( Log In | Register )

> foobar2000 Development Forum Rules

This forum is for developer discussions only. If you have a problem / bug report / idea / feature request that isn't related to foobar2000 SDK, post it in an appropiate forum instead - tech support questions go to support forum, everything else goes to general forum.
All non-developer posts on this forum will be removed. Continued abuse of this forum will result in admin actions (warnings, account suspension).

how to access the instantiation of my component?
post Jan 17 2012, 08:51
Post #1

Group: Members
Posts: 6
Joined: 15-June 11
Member No.: 91531

Hi all,

Please bear with me while I ask a possibly dumb question. How do I access the instantiated object of my component? Let's say I'm creating two ui_elements, A and B. I would like A to be able to call B's public functions, without making B's public functions static. In order to do this, A would need access to B's instantiation but I'm unable to figure out how.

For example, taking the SDK's foo_sample's ui_element.cpp:

class CMyElemWindow : public ui_element_instance, public CWindowImpl<CMyElemWindow> {

// ui_element_impl_withpopup autogenerates standalone version of our component and proper menu commands. Use ui_element_impl instead if you don't want that.
class ui_element_myimpl : public ui_element_impl_withpopup<CMyElemWindow> {};

static service_factory_single_t<ui_element_myimpl> g_ui_element_myimpl_factory;

It seems that the last two lines have to do with the instantiation of my class, but I'm unable to figure out how to get access to this instantiation.

I realize I could (or should) just create a single ui_element instead of two, but having two separate ui_elements allows me to arrange them in different spots within foobar.
Any ideas?

Many thanks in advance..
Go to the top of the page
+Quote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 1st December 2015 - 19:43