Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2005-07

Re: getprocaddress

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to L505: I have a menu plug-in system working for lazarus and just need a tip to get it running…
L505 wrote 11 lines
I have a menu plug-in system working for lazarus and just need a tip to get it running ;-). What is the syntax to load a library dynamically? In delphi, you go @MyProcedure := GetProcAddress(MyProcedure, 'MyProcedure'); In objfpc you go: .................. ................?

The same, just add dynlibs to your uses clause.

This is documented.

Michael.

Reply by email

L505
to Marc Perkel

I have a menu plug-in system working for lazarus and just need a tip to get it running ;-).

What is the syntax to load a library dynamically? In delphi, you go

@MyProcedure := GetProcAddress(MyProcedure, 'MyProcedure');

In objfpc you go:
..................
................?

Reply by email

L505
to Michael Van Canneyt: The same, just add dynlibs to your uses clause. This is documented. Michael.

| The same, just add dynlibs to your uses clause.
|
| This is documented.
|
| Michael.

Actually, I have dynlibs in uses, I just need education on the rules of objfpc

I will create an example for the docs though. I don't think it shows an example, and I love examples.

An example:

var
 myprocedure: procedure;stdcall;
@myprocedure:=

Error: Can't assign values to an address

However I figured something out.. this works:

    MyProcedure:=TMyProcedure(GetProcAddress(handle,'MyProcedure'));

So @ doesn't work.. because objfpc assumes assigning to an address is just not right?

Reply by email