View Single Post
  #5   Spotlight this post!  
Unread 25-09-2002, 16:13
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Has anyone gotten this stuff to work yet? I keep getting ESP (the register, not the psychic ability) errors. Here's what I have:


typedef bool (*VerifyProc) (TModuleRec *);
struct TModuleRec {...all kinds of stuff...};


then in main I have:
VerifyProc TestRecAlignment;
HINSTANCE ret;
TModuleRec tModRec;

ret=LoadLibrary("tokenizer.dll");
TestRecAlignment=(VerifyProc)GetProcAddress(ret, "TestRecAlignment");
(TestRecAlignment) (&tModRec);

This last call always generates an esp verify error and tells me it is probably because my function pointer uses a different calling convention than the original function. However, I believe I am doing it correctly, but it is hard to verify as the people at Parallax hid the EXPORTs from QuickView.

[EDIT]
Nevermind... I just figured it out. Instead of using the normal __cdecl calling convention, it uses __stdcall. Thus, if you're trying to do something with these libraries, make sure you define your pointers as __stdcall:

typedef bool (__stdcall *TestRecAlignmentProc) (TModuleRec *);

[/EDIT]
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php

Last edited by rbayer : 25-09-2002 at 22:45.