Problem with COM objetcs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • robot

    #1

    Problem with COM objetcs

    Hi, I'm trying to list all videos of my object, but i have no response:

    $myVideos = new COM("VideoObjec ts.Videos");
    $strTitle="Matr ix";
    $strStudio="war ner";
    $myVideos->Load($strTitle , $strStudio);

    while($obj = $myVideos->Next()) {
    echo $myVideos->title;
    }

    $myVideos->Release();
    $myVideos = null;
    ?>

    If I do the same thing with ASP: I have a list with three movies... :-)

    Set myVideos = Server.CreateOb ject("VideoObje cts.Videos")
    strTitle = "Matrix"
    strStudio = "Warner"
    myVideos.Load CStr(strTitle), CStr(strStudio)

    For Each Video In myVideos
    Response.Write Video.Title
    Next

    Set myVideos = Nothing

    What am I doing wrong ?

    TIA



  • Erwin Moller

    #2
    Re: Problem with COM objetcs

    robot wrote:
    [color=blue]
    > Hi, I'm trying to list all videos of my object, but i have no response:
    >
    > $myVideos = new COM("VideoObjec ts.Videos");
    > $strTitle="Matr ix";
    > $strStudio="war ner";
    > $myVideos->Load($strTitle , $strStudio);
    >
    > while($obj = $myVideos->Next()) {
    > echo $myVideos->title;[/color]

    Hi not sure, I never coded with COM under PHP before, but:

    Shouldn't this be:
    echo $obj->title;

    [color=blue]
    > }
    >
    > $myVideos->Release();
    > $myVideos = null;
    > ?>
    >
    > If I do the same thing with ASP: I have a list with three movies... :-)
    >
    > Set myVideos = Server.CreateOb ject("VideoObje cts.Videos")
    > strTitle = "Matrix"
    > strStudio = "Warner"
    > myVideos.Load CStr(strTitle), CStr(strStudio)
    >
    > For Each Video In myVideos
    > Response.Write Video.Title
    > Next
    >
    > Set myVideos = Nothing
    >
    > What am I doing wrong ?
    >
    > TIA[/color]

    Comment

    Working...