CE: Open Dialog defined in different MA

I'm working on a huge project porting hundreds of V8i MA applications into native C++ code. I guess I'm gonna post lots of questions on this forum.

I start with this one:

From within an application, defined in DLL one, we call a function foo that is defined in DLL two.

This foo function opens a Dialog that is defined in the .r file that is linked with the second DLL, however, I get error "Unable to load dialog from 'DLL-ONE' whose id is 1001002".

The original code resolved this as follows:

void foo(int param1, const char* param2)

{

  if (strcmpi(mdlSystem_getCurrTaskID(), "NAME_DLL_2") != 0)
  {
    mdlDialog_callFunction(mdlSystem_findMdlDesc("NAME_DLL_2"), foo, param1, param2);
    return;
  }

  ...

  mdlDialog_openModal(&lastAction, NULL, 1001002);


}

How can we resolve this in native C++ code now that mdlDialog_callFunction is no longer supported?

I tried the following:

RscFileHandle rsc_handle;
StatusInt status;
status = mdlResource_openFile(&rsc_handle, "NAME_DLL_2", RSC_READWRITE);

mdlDialog_openModal(&lastAction, rsc_handle, 1001002);

But this returns status 32768 when opening the resource file.

Thanks,

Robert Kock

Parents Reply Children
No Data