Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Nov : Transfer data from and back to DLL's
| Subject: | Transfer data from and back to DLL's |
| Posted by: | "anithegregorian" (anithegregori..@gmail.com) |
| Date: | Sat, 25 Nov 2006 19:41:53 +0530 |
First of all Im a novice Delphi programmer. Just migrated from the dull and
illcooked VB6 so, pardon me if Im not talking to the point!
Im trying to make a DLL which ill use in my project. It contains Audio Tools
Library classes and functions and one main Unit from where i'll declare and
define the exported procedures and functions. All it will be doing is get
and set multimedia tags on a given MM file. For now ive just begun with the
basics like this:
library MMTagInfo;
.....Uses FastMM4,...,....,....
.....
//:::: Functions and procedures
function ReadID3(sFile: string): string; register;
var
Taginf: TID3v2;
begin
Taginf := TID3v2.Create;
try
Taginf.ReadFromFile(sFile);
if Taginf.Exists = false then exit;
Result := Taginf.Title;
finally
Taginf.Free;
end;
end;
//:::: Exports
exports ReadID3;
I can successfully call the above DLL function and it works fine, Ill be
using this DLL only in Delphi so I dont need to declare stdcall. Ive used
FastMM4 memory manager as required for DLL's which use wide string datatypes
insted of borlands memory manager. For now its returning a string data type
but how can I make it return a complete record type in the calling
application, and how do I get to the record type returned containing the
file information tags in the calling application. There's also another side
to this lets say a VICE A VERSA how can I pass a record type to a
function/procedure in the DLL (to set the file tags of a given file with a
tag info record serving as a parameter)? Ive read almost every article that
I could find on the net regarding this sorts. So, pls dont give me links to
any articles unless it has an example showing what im trying to achieve. One
more thing -> I dont want to achive this by using a freeware Plugin
component like psvPlugin...
I wud also like to know if this is possible only for record data types or
with Objects as well ie. can we create a bridge between the DLL and the
calling application to use delphi objects of any data type or class and use
them in the code as if they are one.
Any help wud be great....