Go to Post Realizing your DON'T want to be an engineer is every bit as important as realizing you do - Lil' Lavery [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to learn PBASIC...Where Should I Go? IMDWalrus Programming 5 29-04-2003 16:43
Obscure PBASIC for RoboEmu rbayer Programming 1 28-03-2003 23:57
PBasic 2.5 vs. 2.0 Anthony Kesich Programming 6 09-02-2003 22:06
How to use the PBASIC tokenizer rbayer Programming 0 12-12-2002 12:56
Simplifying PBasic IDiggles General Forum 16 06-11-2001 01:36


All times are GMT -5. The time now is 18:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi