` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Windows API: Using LoadLibrary and FreeLibary to dynamically call external procedures
2004-03-04 -- Andy Ireland
 
Newsgroups: softvelocity.public.clarion6 Hi Robert, > Can you help me do that, or point me to the right direction on how to do > that? Yeah load the DLL using LoadLibrary / FreeLibrary Get the addresses to the functions using GetProcAddress Bind to functions like so.... map module('typedefs') ! This would be the API declarion for each function TestFunc::type(),long,type,pascal end module('aliases') ! a long ptr alias over the Func type decl below TestFunc(long pf, ),long,name('__TestFunc'),pascal end module('mymodule') TestFunc(TestFunc::type pf, ),long,name('__TestFunc'),pascal end end TestFunc procedure(TestFunc::type pfTestFunc, ) code return pfTestFunc() compile('Unicode', _Unicode_) pf = __GetProcAddress(hModule, szFuncW) Unicode omit('Ansi', _Unicode_) pf = __GetProcAddress(hModule, szFuncA) Ansi ? assert(pf) if ~pf return 0. fSuccessful = true return TestFunc(pf, ) The two overloaded defs allow you to pass the function address instead of a clartion function type to the stub that makes the actual call to the function in the Mapi32 DLL. Regards Andy


Today is May 12, 2024, 10:27 am
This article has been viewed 35117 times.
Google search has resulted in 159 hits on this article since January 25, 2004.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: