I do this in one of my shared libraries. I copied the code from the OS
sources for ResLoadForm so that I can pull the form from the shared library
pdb file, The set an event handler (if you need one) and call FrmDoDialog.
If the event handler needs to access shared library variables, you will need
the shared library reference number to get the pointer to them. You can
stick this in a feature that the event handler knows about or you can put a
gadget in the form (not usable) whose data element has the feature number. I
have used both of these techniques to hold 'global' data for UI elements in
the shared library

-----Original Message-----
From:   Kevin O'Keefe [mailto:[EMAIL PROTECTED]]
Sent:   Thursday, July 22, 1999 11:55
To:     '[EMAIL PROTECTED]'
Subject:        UI From Shared Library

I want to put up a fairly simple form from a shared library.  The form is
simple enough to be drawn dynamically if need be, but I'm lazy and want to
use resources if it is at all possible.  Though I was pretty certain I would
not be able to do it, I tried some experiments to see how far I could get.

Here is what I tried:
I created the resource and put it into my shared library project.  It builds
and links in just fine.  Then in the library I did a FrmGotoForm giving it
the id of my form in the shared library resource.  Well, a form came up, but
it wasn't the right one (I had mistakenly given the form in the library the
same id as a form in the application, so that form was loaded but associated
with the wrong form handler and init code).  I quickly realized my error and
gave the form a unique ID, and tried the FrmGotoForm again.  This time it
completely fails because it does not find the resource.

I am guessing that the library's resources do not get linked into the
application resource chain, so it doesn't find it.  My question is: Is there
a way to get the library's resources linked into the application's resource
chain.  Will it work if I can get that resource loaded?

Thanks in advance,
Kevin

____________________________
 Kevin O'Keefe
 The Windward Group
  A Metamor Software Solutions Company
   TEL:   (408) 399-8577
   FAX:  (408) 395-9642


Reply via email to