12-09-2005 12:28 PM
12-12-2005 01:33 PM
In noticed one of the error codes for this function is:
| -1 | == You are running on a platform other than Windows 2000/NT/9x. |
This may be a problem in your case.
Try checking duplicateInstance as shown in the following code and see if that works.
if (CheckForDuplicateAppInstance (ACTIVATE_OTHER_INSTANCE, &duplicateInstance ) < 0)
{
return -1;
}
if (duplicateInstance )
{
return 0;
}
robskii
12-13-2005 08:11 AM
Thanks for the suggestion. I tried it, but it did not make any difference. It is better coding practice, so I left your suggesting in. The CheckForDuplicateAppInstance function is returning 0 (success) with the duplicate instance variable is set to 1 (TRUE) as expected. The function appears to be activating an additional panel when processing the ACTIVATE_OTHER_INSTANCE parameter. The correct (main) panel of the original instance is activated as expected, but a child panel (that has been loaded, but never displayed in the original instance) also appears. It would be very confusing to the user because the panel that appears is used to input data under only very specific circumstances.
By the way, I first noticed this problem in another executable and thought that the last panel loaded was being displayed, but that does not appear to be the case. The exteraneous panel in both cases is one of several child panels of the main panel that is correctly activated by the function. Orignal instance had been active, without any child panels displayed when the 2nd instance was exectuted, so I would expect that to be the case when it is reactivated.
Any more ideas???
12-13-2005 12:44 PM
12-13-2005 12:59 PM
12-15-2005 12:40 PM
01-17-2006 08:28 AM
Have you been able to replicate the problem?
01-19-2006
12:35 AM
- last edited on
07-08-2025
09:22 AM
by
Content Cleaner
Hello kfourroux,
To test this behavior, I created a main panel and child panel and created the following source code:
int main(void)
{
panel1 = LoadPanel (0, "test.uir", PANEL);
panel2 = LoadPanel (panel1, "test.uir", PANEL_2);
DisplayPanel (panel1);
if (CheckForDuplicateAppInstance (ACTIVATE_OTHER_INSTANCE, &duplicateInstance ) < 0)
{
DiscardPanel (panel1);
return -1;
}
if (duplicateInstance )
{
DiscardPanel (panel1);
return 0;
}
RunUserInterface();
DiscardPanel (panel1);
}
01-19-2006 02:36 PM
01-20-2006 03:56 PM