|
General Talk And Support General talk and peer-to-peer support about BS.Player and other video and audio multimedia players. |
| LinkBack | Thread Tools | Search this Thread | Display Modes |
| |||
trying to get the filename in delphi but... i`m trying to build a dll for mirc wich gives me some information about bsplayer. everything works pretty fine but the filename gets me ill :( my source for that part: function avl_BSP_GET_FILE_NAME(mWnd: hWnd; aWnd: hWnd; Data: PChar; Parms: PChar; Show: Boolean; NoPause: Boolean ):integer; export; stdcall; var cds:TCOPYDATASTRUCT; buf:array[0..MAX_PATH-1] of char; adr:pointer; FILENAME : string; begin adr:=@buf; cds.dwData:=SendMessage(FindBsplayer,WM_COPYDATA,a ppHWND,lParam(@cds)); cds.lpData:=@adr; cds.cbData:=4; strcopy(data,PChar(FILENAME)); result:=3; end; Borland Delphi Version 15.0 Copyright (c) 1983,2002 Borland Software Corporation avl.bsplayer.dpr(315) Error: Undeclared identifier: 'appHWND' avl.bsplayer.dpr(332) since i`m not that advanced in delphi that gets me crazy hehe. maybe someone is here who knows how to do this. thanks fugi p.s.: i know that filename is empty, i just had no chance to try to get that out of the buf :( |
| |||
I don't know the BSPlayer header files but i have been using Delphi some time. The compiler tells you that you didn't declared your variable appHWND. This is a handle and i guess that it should be declared as THandle (check BSPlayer API doc). BTW: i think you use Delphi 5 and not 15 Hope this helps |
| |||
done via: DCC32 avl.bsplayer.dpr its delphi 7 i guess and 15 is the compiler verion i think *g* the handle of bsplayer is done afaik via FindBsplayer (a pretty small function). 'appHWND' might be the handle of my app or something else, but what to do if it`s a dll? |
| |||
Try it with the handle of the dll. cds.dwData:=SendMessage(FindBsplayer,WM_COPYDATA,A pplication.Handle,lParam(@cds)); If you get an Error with 'Application' add the Forms and Windows units to the DLL unit. I don't remember if a dll project adds this two units for you. (the Application object is declared in the Forms unit, while the THandle data type is stored in the Windows unit) Another way would be that you use the handle of the application that calls your dll: Code: procedure dllFunction(AHandle: THandle); var OldHandle: THandle; begin // Store the DLLs handle OldHandle := Application.Handle; // Assign the handle of the main application to the DLL's handle Application.Handle := AHandle; // now do what you want SendMessage(F..... // Restore the DLL's old handle, otherwise when freeing the DLL // the application will close at the same time. Application.Handle := OldHandle; end; Code: begin ... dllFunction(Application.Handle); ... end; |
| |||
mirc script
if it´s done can you send it to me? i have a code and dll for bsplay, but it doesn´t reply the size and frames p/s. my e-mail is thedisk@home.nl if you would like the dll and the code. example: Now Watching: [De.Grote.Vriendelijke.Reus.AC3.INTERNAL.XVID-TheDisk.avi]-[01:27:34] |
Tags |
delphi, filename |
| |