Hi Gang,
Since my last project involved creating an in-process OLE Automation server, a couple of recent threads caught my eye. Basically, they confirmed that you couldn't have any sort of user interface coming from the DLL. However, since my DLL made several calls to the API (anybody surprised?:-)), an idea occurred to me.
The VFP MESSAGEBOX() function maps directly to the Windows API function of the same name, it occurred to me that I might be able to access the API where I couldn't do it in VFP. First, I inserted a call to the VFP function, compiled and called the DLL. Sure enough, an OLE error occurred saying that I couldn't have any interface. I then added the following declaration:
DECLARE INTEGER MessageBox IN Win32API AS MsgBox;
INTEGER hWnd, STRING @lpText, STRING @lpCaption,;
INTEGER uType
I then replaced the call to MESSAGEBOX() with MsgBox(), used zero for the window handle (the hWnd parameter), re-ordered the parameter list and re-compiled. It worked!
Since I've rather limited experience with OLE Automation, I was wondering if anyone with more experience in this area might be able to tell me if this will perform as expected when the DLL is called from platforms other than VFP. If so, we might have the basis for, at least, an addition to the UT KB.
Feedback? Comments?
tia,
George
Ubi caritas et amor, deus ibi est