>Any COM experts out there?
>
>I've created a very simple VFP 6.0 .dll component. I can call my .dll from VB or Excel, but I can't display a form or issue the READ EVENTS command without generating the following error:
>
>Run-time error '1031':
>User interface operation not allowed at tis time.
>
>Interestingly, I have searched the entire Visual Studio 6.0/MSDN library for this error, and there is no reference to an Error code 1031 anywhere within the several megabytes of help.
>
>HOWEVER, a search for the text string portion of today's error retrieved Visual FoxPro Error 2031, which occurs, allegedly, when a modal process (such as form, or READ EVENTS command) is issued from an .EXE-based COM component. According to the VFP online help, .dll-based COM objects ALWAYS allow modal events.
>
>What am I doing wrong?
VFP COM Object aren't ActiveX controls; an in-process COM server can't have any UI code in it; while an out-of-process server can, it won't participate in the event loop of the application that references it.
>Why can't I display a form from within a .dll based VFP com component?
Because it's an in-process OLE Automation server and not an ActiveX control.
>Why doesn't the help file discuss error code 1031?
I have no idea.
>
>Extra credit:
>Define the universe (2 points)
>Give three examples (5 points)
>
>Thanks,
>
>>A<