How can I have a DLL write data to my application's form? (eg. DLLs and procedural type question)
jklimek_at_gmail.com
Date: 12/30/04
- Next message: Rob Kennedy: "Re: How can I have a DLL write data to my application's form? (eg. DLLs and procedural type question)"
- Previous message: John E. Doe: "Re: Setting the Screen Resolution"
- Next in thread: Rob Kennedy: "Re: How can I have a DLL write data to my application's form? (eg. DLLs and procedural type question)"
- Reply: Rob Kennedy: "Re: How can I have a DLL write data to my application's form? (eg. DLLs and procedural type question)"
- Reply: Jamie: "Re: How can I have a DLL write data to my application's form? (eg. DLLs and procedural type question)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Dec 2004 13:14:16 -0800
I'm trying to have a DLL write to a Form from inside an application.
The way I'm trying to do this is by using a procedural type and then
passing it in as a variable to my DLL.
Here are some code snippets:
// [FROM THE APPLICATION .EXE]
type TStrProc = procedure(s : String);
type TProc = procedure(proc : TStrProc);
var DllTest : TProc;
// eg. load the library, etc, etc...
// ...
@DllTest := GetProcAddress(LibHandle, 'DllTest');
// ...
DllTest(@DisplayIt); // this should pass the address of my local
procedure (DisplayIt) to the DLL.
--------------
// [FROM THE DLL]
type TProc = Procedure(s : String);
// ...
procedure DllTest(proc : TProc); stdcall;
begin
proc('This should be displayed on my main application's form.');
end;
--------------
However, when I run this program I am getting an Access Violation
(Access Violation at address 008D1AA3. Write of address 0000000000.)
What am I doing wrong?
Thanks,
John
- Next message: Rob Kennedy: "Re: How can I have a DLL write data to my application's form? (eg. DLLs and procedural type question)"
- Previous message: John E. Doe: "Re: Setting the Screen Resolution"
- Next in thread: Rob Kennedy: "Re: How can I have a DLL write data to my application's form? (eg. DLLs and procedural type question)"
- Reply: Rob Kennedy: "Re: How can I have a DLL write data to my application's form? (eg. DLLs and procedural type question)"
- Reply: Jamie: "Re: How can I have a DLL write data to my application's form? (eg. DLLs and procedural type question)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|