Good afternoon.
In MS VS 2003 I have created dll containing Com-object. The basic function of object is the call of standard window-function «ShowBox». I has connected Com-object in Lite-C. When program is started, the window with the message is shown, as well as should be. If I add creation of a standard «acnex»-window with the panel, the panel is not created. The program is started, I see a message-window, but I don’t see a panel and «acnex»-windows. If I exclude command to execute of function of Com-object i see the window with the panel. How to make so at first the window would be created, and then to show the message. For an example a code of the appendix:

#include <acknex.h>
#include <litec.h>
#include <com.h>
#include "iFoo.h"

IFoo *pIFoo;

int main()
{
video_mode = 8;
video_screen = 2;
mouse_mode = 4;
//Creating panel


// Opening Com-interface
HRESULT hr = CoInitialize(NULL);
if (hr!=S_OK)
{
printf("CoInitialize Failed: %x\n\n", hr);
} else
printf("CoInitialize succeeded\n");

// GUIDs
GUID CLSID_MyObject;
IID IID_IFoo;
IIDFromStr("{90D4C200-F6E0-4A22-BE67-399265E09D25}",&CLSID_MyObject);
IIDFromStr("{D6AB5386-CD98-4B92-BD68-9D3951FBF920}",&IID_IFoo);

// pointer to class-function
hr = CoCreateInstance(&CLSID_MyObject, NULL, CLSCTX_ALL,&IID_IFoo, &pIFoo);
if (hr!=S_OK) {
printf("CoCreateInstance Failed: %x\n\n", hr);
return 0;
} else
printf("CoCreateInstance succeeded\n");

int * res;

// function of the class
pIFoo->ShowMessageBox();

// interface closing
pIFoo->Release();
CoUninitialize();
}


Last edited by Olorin; 04/17/09 18:12.