Official BS.Player forums

Official BS.Player forums (
-   General Talk And Support (
-   -   trying to get the filename in delphi but... (

fugi 20th March 2003 04:06 PM

trying to get the filename in delphi but...
hi everybody...

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;
buf:array[0..MAX_PATH-1] of char;
FILENAME : string;
cds.dwData:=SendMessage(FindBsplayer,WM_COPYDATA,a ppHWND,lParam(@cds));

Borland Delphi Version 15.0
Copyright (c) 1983,2002 Borland Software Corporation
avl.bsplayer.dpr(315) Error: Undeclared identifier: 'appHWND'

since i`m not that advanced in delphi that gets me crazy hehe.
maybe someone is here who knows how to do this.



p.s.: i know that filename is empty, i just had no chance to try to get that out of the buf :(

s_bostjan 20th March 2003 11:06 PM

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

fugi 21st March 2003 01:53 AM

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?

s_bostjan 21st March 2003 11:24 PM

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:


procedure dllFunction(AHandle: THandle);
  OldHandle: THandle;
  // 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

  // Restore the DLL's old handle, otherwise when freeing the DLL
  // the application will close at the same time.
  Application.Handle := OldHandle;

In the calling application would you call your function like this:



I realy haven't been using Delphi for some time now so sorry if i told you just garbage.

thedisk 12th December 2003 10:22 PM

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 if you would like the dll and the code.
example: Now Watching: [De.Grote.Vriendelijke.Reus.AC3.INTERNAL.XVID-TheDisk.avi]-[01:27:34]

All times are GMT +1. The time now is 08:33 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
Ad Management plugin by RedTyger

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20