Page 1 of 1

ActiveX and Borland C++ Builder 6

Posted: 06 May 2006 22:03
by pjamaajda
I am unable to stream video to a file.
The problem seems to be the definition of the properties parameter. Looking at the source code that C++ Builder generates, the component is looking for a VARIANT type that contains a SAFEARRAY containing BSTRs. I have created such a type but to no avail, the media plays but does not record. Searching the net, I have found articles stating problems with VARIANT data types and C++ builder 6. Has anyone succeeded like this? Or at least can someone tell me how to get the debug data out. Please.

Posted: 06 May 2006 23:32
by tonsofpcs
Can you show us the lines of code that you are using to make the call?

activex and c++ builder

Posted: 07 May 2006 12:53
by pjamaajda
The code I'm using is of the form

SAFEARRAY* psa;
SAFEARRAYBOUND rgsabound[1];
WideString w1 = ":sout=#duplicate{dst=display,dst=std{access=file,mux=ts,url=\"C:\\projects\\video\\copy.mpeg\"}}";
WideString w2 = "c:\\projects\\video\\original.mpeg";
VARIANT vOpt;
long aLong[1];

rgsabound[0].lLbound = 0;
rgsabound[0].cElements = 1;

psa = SafeArrayCreate(VT_VARIANT, 1, rgsabound);

if (psa)
{
VariantInit(&vOpt);
vOpt.vt= VT_BSTR; // set type
vOpt.bstrVal = w1.c_bstr();
aLong[0]= 0; // set index value
SafeArrayPutElement(pSA, aLong, &vOpt);
vlc_oblect->AddTarget(w2.c_bstr(), pSA, VLCPlayListReplaceAndGo, 0);
}

I get video but no copy.

Posted: 09 May 2006 15:11
by feedbee
I had no problems to run movie under Delphi, but I have a problem to run it ender Buider...

The simplest code:

Code: Select all

if ( OpenDialog->Execute() ) { WideString w2 = OpenDialog->FileName; VLCPlugin1->addTarget(w2.c_bstr(), VARIANT(), VLCPlayListReplaceAndGo, 0); }
I need just to run the movie with no any additional options. But executing this code nothing changes. A state of VLCPlugin component doesn't change and there is no movie playing. But there isn't any error messages from the application too... Can u explane me whare is my problem and what should I do?

Posted: 09 May 2006 15:25
by feedbee
Addition to previos post:

The Delphi code is working...
if OpenDialog1.Execute then begin
VLCPlugin1.addTarget(OpenDialog1.FileName, null, VLCPlayListReplace, 0);
VLCPlugin1.play;
end;
And when I put MRL in object Inspector in Builder, that MRL plays too.

Re: activex and c++ builder

Posted: 09 May 2006 23:51
by tonsofpcs
pjamaajda, try adding an empty string ( "" ) as the last element in the options you pass

Posted: 04 Jul 2006 11:15
by Guest
I had no problems to run movie under Delphi, but I have a problem to run it ender Buider...

The simplest code:

Code: Select all

if ( OpenDialog->Execute() ) { WideString w2 = OpenDialog->FileName; VLCPlugin1->addTarget(w2.c_bstr(), VARIANT(), VLCPlayListReplaceAndGo, 0); }
I need just to run the movie with no any additional options. But executing this code nothing changes. A state of VLCPlugin component doesn't change and there is no movie playing. But there isn't any error messages from the application too... Can u explane me whare is my problem and what should I do?

I have the same problem.
I would like to play a simple movie, does anyobdy succeed ???