Hi all,

i have a basic plugin system using DLL's with certain procedures in them, ie:

function cxHeader: TcxPluginHeader; stdcall;
..
procedure cxInitialize; stdcall;
..
procedure cxRender; stdcall;
..
procedure cxFinalize; stdcall;
..

and these are exported, then i created a class structor to use to call these plugins:

class
cxHeader: function: TcxPluginHeader;
cxInitialize: procedure;
cxRender: procedure;
cxFinalize: procedure;
hPlugin: Integer;

and in the constructor i have the following code:
// cxg is a dll
hPlugin := LoadLibrary('plugin.cxg');
if hPlugin = 0 Then
begin
FreeLibrary(hPlugin);
Exit;
end;
@cxHeader := GetProcAddress(hPlugin, 'cxHeader');
@cxInitialize := GetProcAddress(hPlugin, 'cxInitialize');
@cxRender := GetProcAddress(hPlugin, 'cxRender');
@cxFinalize := GetProcAddress(hPlugin, 'cxFinalize');

try
Header := cxHeader;
excpet
showmessage('failed');
end;

this all seems to work and it is all created, but once everything has been created i get a
Debugger fault notification
saying:
Project H:\cxgViewer.exe faulted with message: 'access violation at 0x004638fd: Read of address 0x00000028' Process stopped. Use step or run to continue.

i don't seem to be getting any information back from the dll, is their some thing that i am doing wrong?

i have tried looking around on the internet and they mention the same method that im using or using the external command.
This is really confusing me :?

thanks for any help