Open resource with lotus API

I need to open the resources from the different databases using the agent. And I need to open it in one window. I’ve read the article where discribed the method of closing the current window using the “nnotesws.dll” functions:NEMGetCurrentSubprogramWindow

NEMActivateSubprogram(whnd)

NEMStopSubprogramWindow(hWnd).

It said that you can use the URLOpen method to load the resources from the other database after closing the current window. It is working when doing from the button on the form, but when doing it in agent lotus crashes tring to open the resource

– Error:Unable to create a document, database does not contain design elements.

So I need to open the resources using some lotus API functions, does anyone knows how to do it? Or why does lotus crashes when trying to load the resource with URLOpen after closing the current window. (If not close the current window, all works fine).

Subject: open resource with lotus API

What are resources you are trying to access? What do you mean by “open” (view image resource, download zip file, view list of available resources)? What does current window have to do with “opening” resources and why it must be closed?