🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.multimedia
Article #650

Using DirectX9 with C++Builder

#650
From: rob conklin
Date: Sat, 15 Mar 2003 18:55
26 lines
2866 bytes
Hi!

I've got a DLL that encapsulates some routines for DirectShow (essentially, the routines needed to display videos).  I've reworked the DLL to be accessable to a C++ Builder (v5) program.  The Builder program is able to initialize (HRESULTs returned S_OK through call to DirectShow RenderFile), but when I call the IMediaControl->Run() method, the Form Window flashes briefly, and then the Run method immedeately returns.  No video.  (the DLL works fine in C#.NET, MFC, and VB 6.0)  There seems to be something a little "different" about the way a Builder Form is implemented internally that makes it a no-go situation.  Here is the code:

    // calls to XLib are located in DLL and encapsulate 
    // DirectShow functionality
    hr = XLibInit();
    XLibSetMediaWindowHandle(Handle);
    XLibSetMainWindowHandle(Handle);
    hr = XLibPrepareMedia("D:\\MyMovie.avi");
    XLibFixMediaPlacement();

    // calls the Run() method of IMediaControl interface
    hr = XLibShowFile();  // RETURNS after flashing screen, 
                          // NO playback

Unfortunately, the DLL is currently configured such that the hr variable is not a real HRESULT, but simply a BOOL variable, so the result I get back from XLibShowFile is not very diagnostic, it returns TRUE.  

In any case, I am hoping that this is just one of those little snags that somebody will recognize and be able to say, "oh, you dummy, you just need to do such and such to make your borland form act more like an MS style form, and then it will run..."

A long shot perhaps, but any help greatly appreciated.  If you would consider emailing me directly, that would be very helpful, as this newgroup does not seem extremely active and it is hard for me to monitor it... (robconklin@worldnet.att.net)

TIA

RC
Technical Details
Message-ID: <3e737736$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!zen.net.uk!fu-berlin.de!news.boerde.de!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d0fc,4ed703dd778e17b0,start
X-Google-Attributes: gid10d0fc,public
X-Google-ArrivalTime: 2003-03-15 11:05:53 PST
From: "rob conklin" <robconklin@worldnet.att.net>
Sender: "rob conklin" <robconklin@worldnet.att.net>
Reply-To: "rob conklin" <robconklin@worldnet.att.net>
Subject: Using DirectX9 with C++Builder
Newsgroups: borland.public.cppbuilder.multimedia
X-User-Info: 12.84.243.240 12.84.243.240    
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3e737736$1@newsgroups.borland.com>
Date: 15 Mar 2003 10:55:50 -0800
X-Trace: newsgroups.borland.com 1047754550 207.105.83.65 (15 Mar 2003 10:55:50 -0800)
Lines: 28
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!zen.net.uk!fu-berlin.de!news.boerde.de!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail