title
Products            Buy            Support Forum            Professional            About            Codec Central
 

Delphi help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jbjorgen

    • Jun 2004
    • 3

    Delphi help

    When I try to run this code in delphi, I get an eAccessViolation error on the AddFromFile line. Any hints as to what I'm leaving out or doing wrong?

    Code:
    uses
       ..., DMCSCRIPTINGLib_TLB;
    
    ------
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
        Converter: IConverterDisp;
    begin
    
        Converter.AddFromFile(WideString('d:\\music\\file.m4a'));        // Add a File
        Converter.GoConversion(WideString('Mp3 (Lame)'),0,0,0,0);     // Convert
    end;
  • Spoon
    Administrator
    • Apr 2002
    • 44509

    #2
    Re: Delphi help

    I am guessing (as don't use Delphi), that the Widestring is not correct, a BStr is needed (which is slightly different to a normal unicode string).
    Spoon
    www.dbpoweramp.com

    Comment

    • jbjorgen

      • Jun 2004
      • 3

      #3
      Re: Delphi help

      It specifically says in the help that WideString is compatible with the COM BSTR type. There is no BStr function. I think the problem is that the Converter is not initialized properly...

      some kind of Converter.create() or something?

      Comment

      • jbjorgen

        • Jun 2004
        • 3

        #4
        Re: Delphi help

        all I'm looking for is a quick executable that will take a command line argument and convert it to MP3 lame. It's basically three or four lines of code. If someone could compile it for me, that'd be great.

        Comment

        • donny
          dBpoweramp Guru

          • Oct 2002
          • 761

          #5
          Re: Delphi help

          you are probably right about that converter.create....

          try like this (looselly):

          converter := IConverterDisp.create();

          or something like that any way...
          in my case (for the player) I had :

          amp:= tamp.create(form1);

          then I was able to access amp.volume (for instance)

          Comment

          Working...

          ]]>