Steve Austin wrote:
> 
> I can create the form, and I have created a resource database,
> but when I try to call DmAttachResource, I get a privaledge violation.  The
> problem
> is my handle is zero.  I'm trying to do it like this.
> 
> // form creation code (calling FrmNewFrm) not shown, because I think its
> working.

   Are you sure?  Have you tried displaying the form (without attaching
it as a resource as below) and does it show up?  If your form ptr valid
before you get a handle for it?  (You should probably test the handle
returned.)

> handle = MemPtrRecoverHandle((VoidPtr) formPtr);
> DmAttachResource(resourceDB, handle, tFRM, FrmGetFrmId(formPtr));
> 
> (on a side note, what are valid numbers for form IDs?  I'm just picking mine
> to be whatever I want them to be.  Is this wrong?)

   You should usually pick any number from 1000 - 9999.  Id's 10000 and
higher are reserved for system use.

Regards,
Daniel.

Reply via email to