- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
i want to call a function from a third part dll in my program.i have tried using intefaces but always end up getting a link error.Loadlibrary and getprocaddress both return success values,however the link error persists.Please let me know if there is a different way of calling the function.
--rs
i want to call a function from a third part dll in my program.i have tried using intefaces but always end up getting a link error.Loadlibrary and getprocaddress both return success values,however the link error persists.Please let me know if there is a different way of calling the function.
--rs
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you use LoadLibrary/GetProcAddress, you have to specify a Cray pointer to the dll function:
...wait, wait, what do you mean a link error? How can you get link error when calls succeed at run-time? If you mean a run-time error (Access Violation or something), it's probably mismatch in calling convention/arguments. You also have to put appropriate !DEC$ATTRIBUTES STDCALL/C for function name and appropriate !DEC$ATTRIBUTES REFERENCE for arguments if necessary into INTERFACE block.
Jugoslav
INTERFACE SUBROUTINE DllFoo(... END INTERFACE POINTER(p_DllFoo, DllFoo) ... p_DllFoo = GetProcAddress(...
...wait, wait, what do you mean a link error? How can you get link error when calls succeed at run-time? If you mean a run-time error (Access Violation or something), it's probably mismatch in calling convention/arguments. You also have to put appropriate !DEC$ATTRIBUTES STDCALL/C for function name and appropriate !DEC$ATTRIBUTES REFERENCE for arguments if necessary into INTERFACE block.
Jugoslav

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page