TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Gerard Gerritsen
from: Jonathan de Boyne Pollard
date: 1997-02-17 01:39:52
subject: Resources ?? Aargh

GG>
  > So I rewrote SBPM/2 to work as a dll ( took about 20 minutes ).
  >
  > The problem is, that if I compile PlayPM/2 to include the
  > code of SBPM/2 ( and it's resources ) everything works fine.
  >
  > As soon as I recompile PlayPM/2 to import the functionality
  > from a DLL, OS/2 is only able to display it's main dialog (
  > -> it can read resources from the dll )
GG>

It looks like when you converted SBPM.EXE to SBPM.DLL you forgot to
convert all of the module parameters to the WinLoadDlg and suchlike calls
in the code itself from `(HMODULE)0', referencing the current EXE, to the
DLL module handle saved from _DLL_InitTerm.

When the SBPM code and resources are statically linked into PLAYPM.EXE,
the WinLoadDlg calls containing `(HMODULE)0' succeed, since the resources
_are_ in the current EXE.  When the SBPM code and resources are compiled
into a DLL, the WinLoadDlg calls fail, since the resources are no longer
in the current EXE but in the DLL instead.

`(HMODULE)0' always references the module of the current EXE, even if the
code that uses it is in a DLL.  From PM's point of view, it cannot tell
whether the code calling WinLoadDlg was in an EXE or in a DLL.  Such
distinctions vanish at runtime.  Code is just code.

  > JdeBP <
___
 X MegaMail 2.10 #0:

--- Maximus/2 3.01
* Origin: DoNoR/2,Woking UK (44-1483-725167) (2:440/4)
SEEN-BY: 50/99 54/99 270/101 620/243 625/160 711/401 413 430 934 712/311 407
SEEN-BY: 712/505 506 517 623 624 704 713/317 800/1
@PATH: 440/4 141/209 270/101 712/624 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.