Jump to content

C to Delphi please? callback

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
UG4!

UG4!

    Newbie

  • Members
  • Pip
  • 1 posts
Hello, i dont know how to translate these to Delphi
its some sort of callback from dll library source



.H file
--------------------------------------------

typedef void (*lpfn_GlmfBeginGlsBlock)(void);
lpfn_GlmfBeginGlsBlock orig_GlmfBeginGlsBlock;
lmfBeginGlsBlock(void)



.C file
--------------------------------------------

void sys_GlmfBeginGlsBlock(void)
{
(*orig_GlmfBeginGlsBlock)();
}


....

orig_GlmfBeginGlsBlock = (lpfn_GlmfBeginGlsBlock)GetProcAddress(hModule, "GlmfBeginGlsBlock");

....

BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
if( dwReason == DLL_PROCESS_ATTACH )
{
DisableThreadLibraryCalls(hInstance);
return Initialize();
}

return TRUE;
}


.DEF file
--------------------------------------

LIBRARY "opengl32"
EXPORTS
GlmfBeginGlsBlock = sys_GlmfBeginGlsBlock @1

------------------------------------------

U can look source at :
pastebin.com/ff70c6cf (.c)
pastebin.com/f5c90dedf (.h)
pastebin.com/f6e631492 (.def)

[B]thanks for any info


#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
The first thing I'd do is check to see if you'll be able to link to the dll with Delphi. Pascal and C don't tend to play well together, nor do their DLLs without some work.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog