home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:18891 comp.lang.c++:18419
- Path: sparky!uunet!mcsun!fuug!kiae!demos!newsserv
- From: yak@sms.ccas.msk.su (Alex Yakovlev)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Problem in TopSpeed DOS Extender
- Date: Mon, 21 Dec 92 14:16:13 +0300
- Distribution: world
- Organization: Computing Center of Russian Academy of Sciences
- Message-ID: <ACzTQDhCC8@sms.ccas.msk.su>
- Sender: news-service@newcom.kiae.su
- Reply-To: yak@sms.ccas.msk.su
- Lines: 48
-
-
- Dear colleagues, we have the TopSpeed C/C++ System Ver 3.02
- with TopSpeed DOS Extender - legal copy, don't worry. I use
- dynamic link libraries (DLL), created by TopSpeed in extended
- memory model (by the way, i've had to correct the system file
- TSPRJ.TXT before i could create DLL's in this model - it's
- obvious JPI's mistake!). When i attempted to use *MANUAL*
- loading/unloading DLL's, i met serious problem. I've reduced
- my program to the following pair of texts:
-
- My main text looks like as:
-
- #include <stdio.h>
- #include <conio.h>
- #include <tsxlib.h>
- typedef unsigned (* Function) (void);
- static Function func;
- static unsigned handle, res;
- void main (void)
- {
- while (getch() != 033)
- {
- handle = LOADMODULE("Drv");
- func = (Function) GETPROCADDR("_Proc", handle);
- res += func();
- UNLOADMODULE(handle);
- printf("%d\n", res);
- }
- }
-
- And DLL-text, named "Drv.c", is very simple:
-
- unsigned Proc(void) {return 1;}
-
- The main program results in General Protection Fault on the
- 15'th pass through the loop. I think, it is connected with an
- incorrect behaviour of UNLOADMODULE. May be, it is necessary
- to pass some other parameter, not a handle, into this
- function?
-
- I'm sure, there are experienced people, who use TopSpeed DOS
- Extender's DLL's in such a way. Help me, please!
- --
- Alex Yakovlev
- Computing Center of Russian Academy of Sciences
- Moscow, Russia
- Internet: yak@sms.ccas.msk.su
-
-