Official BS.Player forums  

Go Back   Official BS.Player forums > Main forum > General Talk And Support

General Talk And Support General talk and peer-to-peer support about BS.Player and other video and audio multimedia players.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 20th March 2003
fugi
BS.Guest
 
Posts: n/a
Default 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;
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 :(
Reply With Quote
  #2 (permalink)  
Old 21st March 2003
Junior Member
BS.Player Newbie
 
Join Date: Mar 2003
Location: Slovenia
Posts: 2
Rep Power: 0
s_bostjan is an unknown quantity at this point
Default

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
Reply With Quote
  #3 (permalink)  
Old 21st March 2003
Junior Member
BS.Player Newbie
 
Join Date: Mar 2003
Posts: 1
Rep Power: 0
fugi is an unknown quantity at this point
Default

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?
Reply With Quote
  #4 (permalink)  
Old 22nd March 2003
Junior Member
BS.Player Newbie
 
Join Date: Mar 2003
Location: Slovenia
Posts: 2
Rep Power: 0
s_bostjan is an unknown quantity at this point
Default

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;
In the calling application would you call your function like this:

Code:
begin 
  ... 
  dllFunction(Application.Handle); 
  ... 
end;
I realy haven't been using Delphi for some time now so sorry if i told you just garbage.
Reply With Quote
  #5 (permalink)  
Old 12th December 2003
Junior Member
BS.Player Newbie
 
Join Date: Oct 2003
Posts: 9
Rep Power: 0
thedisk is an unknown quantity at this point
Default 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]
Reply With Quote
Reply

Tags
delphi, filename

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules


All times are GMT +1. The time now is 06:12 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, 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