[Lazarus] help with bulletin board software...

dennis martin visionstaff at yahoo.com
Mon Mar 15 00:41:40 CET 2010


Justin Smyth wrote:

> Ok guys i have a really hairy one for you , i'm working on directshow
> player that i'm porting from Delphi to Lazarus x64 , in Lazarus in
> DirectShow when i call the RenderFile Function out of DirectShow it
> gives me a nasty exception error - Run Error 58632 ( is this a stub
> to say not supported yet ? )
> 
> Yet if i manually create the direct show filter and add them to the
> filter graph and conect them together the graph works
> 
> The RenderFile Function in DirectShow is defined as
> 
> RenderFile(lpcwstrFile, lpcwstrPlayList: pWideChar): HResult; stdcall;
> 
> I'm using this function to change my ansistring into a pWideChar -
> 
> MultiByteToWideChar(CP_ACP, 0, PChar(FileName), -1, wstrFileName,
> MAX_PATH);

I can only suggest to double-check the file name encoding. If FileName
is coming from some UI control like TEdit then it is in UTF-8 and you
would need something like

uses ..., lclproc;

var
 s: widestring;

s := UTF8ToUTF16(FileName)

RenderFile(PWideChar(S), nil);

Please note I have almost no experience with widestrings, 
so the code above may be wrong.

It could be helpful to dump original and converted string to 
some file before calling RenderFile to see their actual encoding.

-- 
Vladimir




More information about the Lazarus mailing list