From: "H.Vidal, Jr." on
Vadim Zeitlin wrote:
> On Wed, 07 Feb 2007 14:55:53 -0500 "H.Vidal, Jr." <hvidal(a)tesseract-tech.com> wrote:
>
> HJ> > `wx-config --libs` doesn't include media lib (which is a relatively new
> HJ> > one and so not subject to backwards compatible behaviour of --libs option),
> HJ> > you need to use `wx-config --libs std,media` to get it.
> HJ>
> HJ> Does either of 'std' or 'media' lib, in above noted syntax,
> HJ> force availability or flags of library containing built wxActiveXContainer
> HJ> class?
>
> Yes, wxActiveXContainer is currently included in the media lib. It doesn't
> make much sense to me to be honest, although it is only used by wxMediaCtrl
> currently it doesn't mean it can't be used by user code which is not
> interested in wxMediaCtrl, as it seems to be the case for you. OTOH I don't
> know what library does this belong to, not really core so adv probably.
>
> HJ> Incidentally, the same syndrome as discussed before (ISO C++ forbids no type
> HJ> declaration, or whatever, for class xxxx...) applies to wxMediaCtrl, whether one builds
> HJ> with --enable-mediactrl or not....
> HJ>
> HJ> Same problem in ./configure???
>
> This is strange, it should compile the media library if you give
> --enable-mediactrl. Do notice that it is turned off by default, so you need
> to rerun configure with this option.

OK, in the build/ directory, one issues:

make clean

To get rid of existing build.

Then one issues:

../configure --with-msw --enable-debug --enable-debug_gdb --disable-shared --enable-mediactrl

Then one issues:

find . -name "setup.h" -print

Then one edits this file so that this:

wxUSE_ACTIVEX 0

changes to this:

wxUSE_ACTIVEX 1

Then one issues a 'make' in build

THEN one needs this in link step:

`wx-config --libs std,media`

(This is part of makefile for final binary target)

and Voila! It builds and runs!

So far, so good.

Now, how does one get and set properties for an wxAutomationObject?

Once the code is running, you can instance (via CoCreateInstance)
the ActiveX control (in this case, flash8.ocx) and get things started.
When you right click on the client area where the flash player lives,
you get the 'About Macromedia Flash' menu/dialog.

However, you can't set any properties. It just segfaults.

Here is the key snip of code:

// following lines live in header file
wxAutomationObject m_autoObjFlash;
wxActiveXContainer m_pActiveXFlash;

// this is in header too; wxFrame derived class
// instances this from heap with no constructor args
// so it DOES exist in context below...
wxControl *m_pActiveControl;

// this is from .cpp implementation file
hr = ::CoCreateInstance(CLSID_Flash,
NULL,
CLSCTX_INPROC_SERVER,
DIID_DFlash,
(void **)&pDispatch);

/* this returns peachy with hr result OK */
m_autoObjFlash.SetDispatchPtr(pDispatch);
// 'this' is the wxFrame derived class
if(!m_pActiveControl->Create(this, wxID_ANY))
{
return(false);
}

m_pActiveXFlash = new wxActiveXContainer(m_pActiveControl,
DIID_DFlash,
pDispatch);

and life goes on. The code runs just fine, and, as noted,
you can right click on client area of wxFrame, where the wxControl
lives, and get the Macromedia menu.

So far, so good.

But if you do *anything* like this:

m_autoObjFlash.getProperty(_T("Movie"));

you definitely segfault. Any PutProperty, any CallMethod, anything on
the AutomationObject and , poof, you're dead.

Any obvious suggestions? This would be appreciated.

hv

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: "Ryan Norton" on
> Yes, wxActiveXContainer is currently included in the media lib. It
> doesn't
> make much sense to me to be honest, although it is only used by
> wxMediaCtrl
> currently it doesn't mean it can't be used by user code which is not
> interested in wxMediaCtrl, as it seems to be the case for you. OTOH I
> don't
> know what library does this belong to, not really core so adv probably.

Yeah, mainly a class for wxMediaCtrl initially - planned on discussing it
for inclusion into one of the others but never got around to it :\;

Well that and Kevin's points about it not emulating as much as the old
wxActiveX as it could thus being incompatible with stuff like wxIE and so
on.

> The code runs just fine, and, as noted,
> you can right click on client area of wxFrame, where the wxControl
> lives, and get the Macromedia menu.

SWEET! I've never tried it before with the flash control so that is exciting
to me :D.

> But if you do *anything* like this:
>
> m_autoObjFlash.getProperty(_T("Movie"));
>
> you definitely segfault. Any PutProperty, any CallMethod, anything on
> the AutomationObject and , poof, you're dead.

Hmmm, id really need to see more im afraid... for one where in the
said method does it crash in wxAutomationObject??


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: "H.Vidal, Jr." on
Ryan Norton wrote:
>> Yes, wxActiveXContainer is currently included in the media lib. It
>> doesn't
>> make much sense to me to be honest, although it is only used by
>> wxMediaCtrl
>> currently it doesn't mean it can't be used by user code which is not
>> interested in wxMediaCtrl, as it seems to be the case for you. OTOH I
>> don't
>> know what library does this belong to, not really core so adv probably.

I cannot imagine a class that is more platform specific....so I think
that instead of thinking of this as a media-related class, it really
should be in the domain of a win-specific class.

So if you busted out a library (as in there is a std and media
library, I suppose) simply called win-specific (perhaps with
a better moniker...) that would make a lot of sense, no?

> Yeah, mainly a class for wxMediaCtrl initially - planned on discussing it
> for inclusion into one of the others but never got around to it :\;
>
> Well that and Kevin's points about it not emulating as much as the old
> wxActiveX as it could thus being incompatible with stuff like wxIE and
> so on.
>
>> The code runs just fine, and, as noted,
>> you can right click on client area of wxFrame, where the wxControl
>> lives, and get the Macromedia menu.
>
>
> SWEET! I've never tried it before with the flash control so that is
> exciting
> to me :D.

Well, as I develop this a bit more, I would be happy to put up a web
page with full documentation on this aspect of the project.

>> But if you do *anything* like this:
>>
>> m_autoObjFlash.getProperty(_T("Movie"));
>>
>> you definitely segfault. Any PutProperty, any CallMethod, anything on
>> the AutomationObject and , poof, you're dead.
>
>
> Hmmm, id really need to see more im afraid... for one where in the
> said method does it crash in wxAutomationObject??

I am not sure I (clearly) understand what you are asking.

To gross granularity, it crashes on (essentially) just about any method
called on the m_autoObjFlash object, GetProperty, PutProperty,
CallMethod, etc.

Now, as to where in this method, the way I had this setup I was doing
this call inside of a handler that was calling the Win file open dialog,
and (oddly, guess it's a gdb issue), a debug run under gdb would exit
just as the dialog came up....the call on the automation object was just
after the open dialog, so gdb never got to see it.

I will re-arrange the code today to obviate this little hiccup and try
to get a better target on the crash with a 'where' inside of gdb.

But the gross issue is that the class seems to instantiate on the ActiveX
just fine, you just can't do anything with the control.

First q: based on my previous post, do you see anything really obvious I am
doing wrong? (I guess the author of these ActiveX controls would be handy
now.... is that Ryan?)

Second q: does anybody have a bit of test code on these classes so we can
verify whether 2.8.0 stable release has working or broken code? I would
be glad to verify a test case here, but I am concerned that my code
is perhaps 'wrong' and so not a suitable test case.

Please advise. Many thanks!

hv


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org