Home | Gallery | Forum | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com Forum
OS2 World.Com Online Discussion Forum.
Index / OS/2 - General / Applications
author message
API Function Problem
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
fra
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 2
since: 19 Jul, 2005
1. API Function Problem
Reply to this topic with quote Modify your message
Hello. Please help us to solve the problem.

We are developers of software under OS/2 Warp. We use Borland C++ for OS/2 version 2.0. After updating OS/2 Warp 4 on eComStation 1.2 we met a prob-lem. Our programs that work on OS/2 don’t work correctly on eComStation. They start without any problems. But after some time they unexpectedly crash without any error messages. When we start such program System Activity Monitor shows some values (for example 2%). Then this value start to grow. Our programs crash in level of 25%. We tried to solve this problem and found that some window func-tions don’t work correctly (in our case: WinSetPresParam(hwnd, PP_FOREGRAUNDCOLORINDEX, …), WinSetPresParam(hwnd, PP_BACKGRAUNDCOLORINDEX, …), etc.) We think it happens because of different schemes of memory management in OS/2 Warp and eComStation. How to find way out of this case?

Date: 19 Jul, 2005 on 06:23
yankeebean
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 6
since: 11 Apr, 2005
2. Re:API Function Problem
Reply to this topic with quote Modify your message
Read the popuplog.os2 file, in the system drive, for supressed error messages. If you migrated(not recommended) your Warp4 system to eCs 1.2 you should now backup your data, format the partition, and do a fresh install of eCs. Also, if you find(from the popuplog.os2 file) that you are getting errors related to pmmerge.dll then replace it with an older version such as that from fixpack 4.
Date: 19 Jul, 2005 on 12:29
Fahrvenugen
Premium member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 277
since: 10 Aug, 2004
3. Re:API Function Problem
Reply to this topic with quote Modify your message
What fixpak level was your Warp 4 system at?

And have you installed any fixpaks on your eCS 1.2 system?

I know there were a couple of things which changed between the old Warp 4 boxed version with various fixpaks, to the MCP release from IBM (which is what eCS is based on)

Date: 19 Jul, 2005 on 19:19
cyberspittle
Premium member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 252
since: 09 Dec, 2002
4. Re:API Function Problem
Reply to this topic with quote Modify your message
Are you sure that you went from OS/2 Warp 4 to eComStation 1.2 and not OS/2 Warp 3 to eComStation 1.2? I ask as there were a few differences between OS/2 Warp version 3 and version 4. Namely the scheme pallete didn't behave the same in Warp 4 as in Warp 3.

In Warp 4, there were a lot of schemes that looked like crap, unless you went with a grayish scheme. I'm not sure why this occurred, perhaps it was the porting from OS/2 PowerPC to create OS/2 Warp 4.

As a C programmer calling the Presentation Manager APIs I noticed this as I was learning PM programming using OS/2 Warp 4. I then switched to OS/2 Warp 3 in order to continue with my self-study using the book "Advanced OS/2 Presentation Manager Programming" (Thomas E. Burge, Joseph, Jr. Celi) ... still available from Amazon!

Date: 23 Jul, 2005 on 19:12
fra
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 2
since: 19 Jul, 2005
5. Re:API Function Problem
Reply to this topic with quote Modify your message
Here is a small sample code with this problem.
This test program was written with help of OS/2 ToolKit 4.5 samples. (Samples\PM\Controls)

/*************************************
* File Name : STYLE.H
**************************************/
#define IDD_MSGBOX 1001
#define IDS_BLUE 50
#define IDS_RED 51
#define IDS_PINK 52
#define IDS_GREEN 53
#define IDS_CYAN 54
#define IDS_YELLOW 55
#define IDS_DARKGRAY 56
#define IDS_DARKBLUE 57
#define IDS_DARKRED 58
#define IDS_DARKPINK 59
#define IDS_DARKGREEN 60
#define IDS_DARKCYAN 61
#define IDS_BROWN 62
#define IDS_PALEGRAY 63
#define IDS_DEFAULT 64
#define IDS_WARNING 65
#define IDS_FIRSTCOLOR IDS_BLUE
#define IDMSG_CANNOTLOADSTRING 11
#define IDMSG_CANNOTSETPP 26
#define IDD_PPDEMODLG 10007
#define IDC_EXIT 2
#define IDC_FORECOLORLIST 119
#define IDC_BACKCOLORLIST 120
#define IDC_SAMPLETEXT 322
#define IDC_START_TIMER 422
#define IDC_STOP_TIMER 423
#define IDC_DELAY_TIMER 424
/**********************************
* File Name : STYLE.CPP
***********************************/
#define INCL_WIN
#include <os2.h>
#include <string.h>
#include "style.h"
#define MESSAGELEN 100
#define COLORNAMELEN 20
#define NUMCOLORS 15
#define TIMER_DELAY 250UL
#define CONTROLS_COUNT 24
static ULONG ulTimerId = 0;
static LONG DelayTimer = TIMER_DELAY;
static CHAR apszPresParamColor[NUMCOLORS][COLORNAMELEN];
static ULONG aulColor[NUMCOLORS-1] =
{ CLR_BLUE, CLR_RED, CLR_PINK, CLR_GREEN, CLR_CYAN,
CLR_YELLOW, CLR_DARKGRAY, CLR_DARKBLUE, CLR_DARKRED,
CLR_DARKPINK, CLR_DARKGREEN, CLR_DARKCYAN, CLR_BROWN,
CLR_PALEGRAY };

HAB hab;
HMQ hmq;
QMSG qmsg;
HWND hwndMain;
SHORT MessageBox(HWND hwndOwner, SHORT idMsg, SHORT fsStyle, BOOL fBeep);
BOOL InitPresParamDemoDlg(HWND hwnd);
BOOL UpdatePresParamDemoDlg(HWND hwnd);
MRESULT EXPENTRY PresParamDemoDlgProc(HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2);

void main(int argc, char* argv[]) {
if(!(hab = WinInitialize(0))) { WinAlarm(HWND_DESKTOP, WA_ERROR); return; }
if(!(hmq = WinCreateMsgQueue(hab, 256))) { WinAlarm(HWND_DESKTOP, WA_ERROR); WinTerminate(hab); return; }
WinDlgBox(HWND_DESKTOP, HWND_DESKTOP, (PFNWP)PresParamDemoDlgProc, NULLHANDLE, IDD_PPDEMODLG, (PVOID)NULL);
WinDestroyMsgQueue(hmq); WinTerminate(hab);
}
/*****************************************************************/
MRESULT EXPENTRY PresParamDemoDlgProc( HWND hwnd, USHORT msg,
MPARAM mp1, MPARAM mp2)
{
switch(msg)
{
case WM_INITDLG:
hwndMain = hwnd;
if (!InitPresParamDemoDlg(hwnd)) WinPostMsg(hwnd, WM_CLOSE, NULL, NULL);
else WinEnableControl(hwnd, IDC_STOP_TIMER, FALSE);
return (MRESULT)FALSE;
case WM_TIMER:
WinStopTimer(hab, hwnd, ulTimerId);
UpdatePresParamDemoDlg(hwnd);
WinSendDlgItemMsg(hwnd, IDC_DELAY_TIMER, SPBM_QUERYVALUE, (MPARAM)&DelayTimer, MPFROM2SHORT(0, SPBQ_UPDATEIFVALID));
ulTimerId = WinStartTimer(hab, hwnd, 1, DelayTimer);
break;
case WM_COMMAND:
switch(SHORT1FROMMP(mp1))
{
case IDC_EXIT:
WinPostMsg(hwnd, WM_CLOSE, NULL, NULL);
break;
case IDC_START_TIMER:
WinSendDlgItemMsg(hwnd, IDC_DELAY_TIMER, SPBM_QUERYVALUE, (MPARAM)&DelayTimer, MPFROM2SHORT(0, SPBQ_UPDATEIFVALID));
ulTimerId = WinStartTimer(hab, hwnd, 1, DelayTimer);
WinEnableControl(hwnd, IDC_STOP_TIMER, TRUE);
WinEnableControl(hwnd, IDC_START_TIMER, FALSE);
WinEnableControl(hwnd, IDC_DELAY_TIMER, FALSE);
break;
case IDC_STOP_TIMER:
WinStopTimer(hab, hwnd, ulTimerId); ulTimerId = 0;
WinEnableControl(hwnd, IDC_DELAY_TIMER, TRUE);
WinEnableControl(hwnd, IDC_START_TIMER, TRUE);
WinEnableControl(hwnd, IDC_STOP_TIMER, FALSE);
break;
default:
break;
}
break;
case WM_CLOSE:
if (ulTimerId != 0) WinStopTimer(hab, hwnd, ulTimerId);
WinPostMsg(hwnd, WM_QUIT, NULL, NULL);
break;
default: return(WinDefDlgProc(hwnd, msg, mp1, mp2));
}
return (MRESULT)0;
}
/*********************************************************************/
BOOL InitPresParamDemoDlg(HWND hwnd)
{
HWND hwndTemp;
ULONG ulCounter;
MRESULT mresult;
for (ulCounter = 0; ulCounter < NUMCOLORS; ulCounter++)
{
if (!WinLoadString(hab, (HMODULE)0, (ulCounter + IDS_FIRSTCOLOR),
COLORNAMELEN, (PSZ)apszPresParamColor[ulCounter]))
{
MessageBox(hwndMain, IDMSG_CANNOTLOADSTRING, MB_OK | MB_ERROR, FALSE);
return FALSE;
}
}
hwndTemp = WinWindowFromID(hwnd, IDC_FORECOLORLIST);

for(ulCounter = 0; ulCounter < NUMCOLORS; ulCounter++)
{
mresult = WinSendMsg(hwndTemp, LM_INSERTITEM,
MPFROMSHORT(LIT_SORTASCENDING),
MPFROMP((PSZ)apszPresParamColor[ulCounter]));
if (((SHORT)mresult) == LIT_ERROR || ((SHORT)mresult) == LIT_MEMERROR)
{
MessageBox(hwndMain, IDMSG_CANNOTLOADSTRING, MB_OK | MB_ERROR, FALSE);
return FALSE;
}
}
hwndTemp = WinWindowFromID(hwnd, IDC_BACKCOLORLIST);

for(ulCounter = 0; ulCounter < NUMCOLORS; ulCounter++)
{
mresult = WinSendMsg(hwndTemp, LM_INSERTITEM,
MPFROMSHORT(LIT_SORTASCENDING),
MPFROMP((PSZ)apszPresParamColor[ulCounter]));
if (((SHORT)mresult) == LIT_ERROR || ((SHORT)mresult) == LIT_MEMERROR)
{
MessageBox(hwndMain, IDMSG_CANNOTLOADSTRING, MB_OK | MB_ERROR, FALSE);
return FALSE;
}
}
WinSendDlgItemMsg(hwnd, IDC_FORECOLORLIST, LM_SELECTITEM, MPFROMSHORT(0), MPFROMSHORT(TRUE));
WinSendDlgItemMsg(hwnd, IDC_BACKCOLORLIST, LM_SELECTITEM, MPFROMSHORT(NUMCOLORS - 1), MPFROMSHORT(TRUE));
WinSendDlgItemMsg(hwnd, IDC_DELAY_TIMER, SPBM_SETLIMITS, MPFROMLONG(5000), 0);
WinSendDlgItemMsg(hwnd, IDC_DELAY_TIMER, SPBM_SETCURRENTVALUE, MPFROMLONG(TIMER_DELAY), 0);
return TRUE;
}
/*********************************************************************/
BOOL UpdatePresParamDemoDlg(HWND hwnd)
{
HWND hwndTemp1, hwndTemp2, hwndSampleText;
CHAR pszTemp1[COLORNAMELEN], pszTemp2[COLORNAMELEN];
ULONG ulColor, ulPresParams, j;
SHORT sCounter;
hwndTemp1 = WinWindowFromID(hwnd, IDC_FORECOLORLIST);
if (WinQueryWindowText(hwndTemp1, COLORNAMELEN, (PSZ)pszTemp1))
{
sCounter = 0;
while (sCounter < NUMCOLORS)
{
if (!strcmp(pszTemp1, apszPresParamColor[sCounter]))
{
ulColor = aulColor[sCounter]; break;
}
else sCounter++;
}
if (sCounter < NUMCOLORS)
{
sCounter += IDS_FIRSTCOLOR;

for (j = 0; j < CONTROLS_COUNT; j++) {

hwndSampleText = WinWindowFromID(hwnd, IDC_SAMPLETEXT + j);
if (sCounter < IDS_DEFAULT)
{
if (!WinSetPresParam(hwndSampleText, PP_FOREGROUNDCOLORINDEX,
(ULONG)sizeof(LONG), (PVOID)&ulColor))
{
MessageBox(hwndMain, IDMSG_CANNOTSETPP, MB_OK | MB_ERROR, FALSE);
}
}
else
{
if (sCounter == IDS_DEFAULT &&
WinQueryPresParam(hwndSampleText, PP_FOREGROUNDCOLORINDEX,
0, &ulPresParams, (ULONG)sizeof(LONG), (PVOID)&ulColor,
QPF_NOINHERIT) != 0)
{
if (!WinRemovePresParam(hwndSampleText,
PP_FOREGROUNDCOLORINDEX))
{
MessageBox(hwndMain, IDMSG_CANNOTSETPP, MB_OK | MB_ERROR, FALSE);
}
}
}
}
}

hwndTemp2 = WinWindowFromID(hwnd, IDC_BACKCOLORLIST);
if (WinQueryWindowText(hwndTemp2, COLORNAMELEN, (PSZ)pszTemp2))
{
sCounter = 0;
while (sCounter < NUMCOLORS)
{
if (!strcmp(pszTemp2, apszPresParamColor[sCounter]))
{
ulColor = aulColor[sCounter]; break;
}
else sCounter++;
}
if (sCounter < NUMCOLORS)
{
sCounter += IDS_FIRSTCOLOR;

for (j = 0; j < CONTROLS_COUNT; j++) {

hwndSampleText = WinWindowFromID(hwnd, IDC_SAMPLETEXT + j);
if (sCounter < IDS_DEFAULT)
{
if (!WinSetPresParam(hwndSampleText, PP_BACKGROUNDCOLORINDEX,
(ULONG)sizeof(LONG), (PVOID)&ulColor))
{
MessageBox(hwndMain, IDMSG_CANNOTSETPP, MB_OK | MB_ERROR, FALSE);
}
}
else
{
if (sCounter == IDS_DEFAULT &&
WinQueryPresParam(hwndSampleText,
PP_BACKGROUNDCOLORINDEX, 0, &ulPresParams, (ULONG)sizeof(LONG),
(PVOID)&ulColor, QPF_NOINHERIT) != 0)
{
if (!WinRemovePresParam(hwndSampleText,
PP_BACKGROUNDCOLORINDEX))
{
MessageBox(hwndMain, IDMSG_CANNOTSETPP, MB_OK | MB_ERROR, FALSE);
}
}
}
}

}
}
WinSetWindowText(hwndTemp1, pszTemp2);
WinSetWindowText(hwndTemp2, pszTemp1);
return TRUE;
}
/*********************************************************************/
SHORT MessageBox(HWND hwndOwner, SHORT idMsg, SHORT fsStyle, BOOL fBeep)
{
CHAR szText[MESSAGELEN];
CHAR szTitle[MESSAGELEN];
PSZ pszTitle = NULL;

if(!WinLoadMessage(hab, (HMODULE)NULL, idMsg, MESSAGELEN, (PSZ)szText))
{
WinAlarm(HWND_DESKTOP, WA_ERROR); return MBID_ERROR;
}

if(fBeep) WinAlarm(HWND_DESKTOP, WA_ERROR);

if ( (fsStyle & MB_WARNING)
&& WinLoadString(hab, (HMODULE)0, IDS_WARNING, MESSAGELEN, szTitle) )
pszTitle = szTitle;
else pszTitle = NULL;
return(WinMessageBox(HWND_DESKTOP, hwndOwner, szText, pszTitle, IDD_MSGBOX, fsStyle));
}
/*****************************
* File Name : STYLE.RC
******************************/
#include <os2.h>
#include "style.h"
STRINGTABLE
{
IDS_BLUE "Blue"
IDS_RED "Red"
IDS_PINK "Pink"
IDS_GREEN "Green"
IDS_CYAN "Cyan"
IDS_YELLOW "Yellow"
IDS_DARKGRAY "Dark Gray"
IDS_DARKBLUE "Dark Blue"
IDS_DARKRED "Dark Red"
IDS_DARKPINK "Dark Pink"
IDS_DARKGREEN "Dark Green"
IDS_DARKCYAN "Dark Cyan"
IDS_BROWN "Brown"
IDS_PALEGRAY "Pale Gray"
IDS_DEFAULT "Default"
IDS_WARNING "Warning"
}
MESSAGETABLE
{
IDMSG_CANNOTLOADSTRING "Failed to load string."
IDMSG_CANNOTSETPP "Error setting presentation parameters."
}
DLGTEMPLATE IDD_PPDEMODLG
BEGIN
DIALOG "Style", IDD_PPDEMODLG, 15, 4, 240, 112, FS_NOBYTEALIGN | WS_VISIBLE, FCF_SYSMENU | FCF_TITLEBAR
BEGIN
RTEXT "~Foreground:", 256, 100, 96, 60, 8, SS_TEXT | DT_RIGHT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | NOT WS_GROUP
CONTROL "", IDC_FORECOLORLIST, 165, 62, 64, 42, WC_COMBOBOX, CBS_DROPDOWNLIST | WS_TABSTOP | WS_VISIBLE
RTEXT "~Background:", 258, 100, 76, 60, 8, SS_TEXT | DT_RIGHT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | NOT WS_GROUP
CONTROL "", IDC_BACKCOLORLIST, 165, 42, 64, 43, WC_COMBOBOX, CBS_DROPDOWNLIST | WS_TABSTOP | WS_VISIBLE
LTEXT "No", IDC_SAMPLETEXT, 4, 94, 10, 10, SS_TEXT | DT_CENTER | DT_VCENTER | WS_VISIBLE | NOT WS_GROUP
LTEXT "No", IDC_SAMPLETEXT +1, 28, 94, 10, 10, SS_TEXT | DT_CENTER | DT_VCENTER | WS_VISIBLE | NOT WS_GROUP
LTEXT "No", IDC_SAMPLETEXT +2, 52, 94, 10, 10, SS_TEXT | DT_CENTER | DT_VCENTER | WS_VISIBLE | NOT WS_GROUP
LTEXT "No", IDC_SAMPLETEXT +3, 76, 94, 10, 10, SS_TEXT | DT_CENTER | DT_VCENTER | WS_VISIBLE | NOT WS_GROUP
PUSHBUTTON "Exit", IDC_EXIT, 185, 3, 38, 13, BS_PUSHBUTTON | BS_DEFAULT | WS_VISIBLE | WS_TABSTOP
LTEXT "No", IDC_SAMPLETEXT +4, 4, 77, 10, 10, SS_TEXT | DT_CENTER | DT_VCENTER | WS_VISIBLE | NOT WS_GROUP
LTEXT "No", IDC_SAMPLETEXT +5, 28, 77, 10, 10, SS_TEXT | DT_CENTER | DT_VCENTER | WS_VISIBLE | NOT WS_GROUP
LTEXT "No", IDC_SAMPLETEXT +6, 52, 77, 10, 10, SS_TEXT | DT_CENTER | DT_VCENTER | WS_VISIBLE | NOT WS_GROUP
LTEXT "No", IDC_SAMPLETEXT +7, 76, 77, 10, 10, SS_TEXT | DT_CENTER | DT_VCENTER | WS_VISIBLE | NOT WS_GROUP
CONTROL "No", IDC_SAMPLETEXT +8, 4, 57, 14, 14, WC_BUTTON, BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP
CONTROL "No", IDC_SAMPLETEXT +9, 27, 57, 14, 14, WC_BUTTON, BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP
CONTROL "No", IDC_SAMPLETEXT +10, 50, 57, 14, 14, WC_BUTTON, BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP
CONTROL "No", IDC_SAMPLETEXT +11, 73, 57, 14, 14, WC_BUTTON, BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP
CONTROL "No", IDC_SAMPLETEXT +12, 4, 38, 14, 14, WC_BUTTON, BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP
CONTROL "No", IDC_SAMPLETEXT +13, 27, 38, 14, 14, WC_BUTTON, BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP
CONTROL "No", IDC_SAMPLETEXT +14, 50, 38, 14, 14, WC_BUTTON, BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP
CONTROL "No", IDC_SAMPLETEXT +15, 73, 38, 14, 14, WC_BUTTON, BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP
CONTROL "Start", IDC_START_TIMER, 132, 30, 38, 14, WC_BUTTON, BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP
CONTROL "Stop", IDC_STOP_TIMER, 185, 30, 38, 14, WC_BUTTON, BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP
CONTROL "No", IDC_SAMPLETEXT +16, 5, 22, 12, 10, WC_ENTRYFIELD, ES_CENTER | ES_MARGIN | ES_ANY | WS_VISIBLE | WS_TABSTOP
PRESPARAMS PP_BACKGROUNDCOLORINDEX , 15L
CONTROL "No", IDC_SAMPLETEXT +17, 28, 22, 12, 10, WC_ENTRYFIELD, ES_CENTER | ES_MARGIN | ES_ANY | WS_VISIBLE | WS_TABSTOP
PRESPARAMS PP_BACKGROUNDCOLORINDEX , 15L
CONTROL "No", IDC_SAMPLETEXT +18, 51, 22, 12, 10, WC_ENTRYFIELD, ES_CENTER | ES_MARGIN | ES_ANY | WS_VISIBLE | WS_TABSTOP
PRESPARAMS PP_BACKGROUNDCOLORINDEX , 15L
CONTROL "No", IDC_SAMPLETEXT +19, 74, 22, 12, 10, WC_ENTRYFIELD, ES_CENTER | ES_MARGIN | ES_ANY | WS_VISIBLE | WS_TABSTOP
PRESPARAMS PP_BACKGROUNDCOLORINDEX , 15L
CONTROL "No", IDC_SAMPLETEXT +20, 5, 5, 12, 10, WC_ENTRYFIELD, ES_CENTER | ES_MARGIN | ES_ANY | WS_VISIBLE | WS_TABSTOP
PRESPARAMS PP_BACKGROUNDCOLORINDEX , 15L
CONTROL "No", IDC_SAMPLETEXT +21, 28, 5, 12, 10, WC_ENTRYFIELD, ES_CENTER | ES_MARGIN | ES_ANY | WS_VISIBLE | WS_TABSTOP
PRESPARAMS PP_BACKGROUNDCOLORINDEX , 15L
CONTROL "No", IDC_SAMPLETEXT +22, 51, 5, 12, 10, WC_ENTRYFIELD, ES_CENTER | ES_MARGIN | ES_ANY | WS_VISIBLE | WS_TABSTOP
PRESPARAMS PP_BACKGROUNDCOLORINDEX , 15L
CONTROL "No", IDC_SAMPLETEXT +23, 74, 5, 12, 10, WC_ENTRYFIELD, ES_CENTER | ES_MARGIN | ES_ANY | WS_VISIBLE | WS_TABSTOP
PRESPARAMS PP_BACKGROUNDCOLORINDEX , 15L
CONTROL "Sample", IDC_DELAY_TIMER, 165, 52, 44, 12, WC_SPINBUTTON, SPBS_SERVANT | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_TABSTOP
CONTROL "~Delay:", 102, 117, 52, 40, 8, WC_STATIC, SS_TEXT | DT_RIGHT | DT_TOP | DT_MNEMONIC | WS_VISIBLE
CONTROL "ms", 103, 211, 53, 16, 8, WC_STATIC, SS_TEXT | DT_CENTER | DT_VCENTER | DT_MNEMONIC | WS_VISIBLE
CONTROL "Timer", 104, 107, 20, 123, 50, WC_STATIC, SS_GROUPBOX | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE
END
END

Date: 29 Jul, 2005 on 13:18
mikeg
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 14
since: 27 Nov, 2003
6. Re:API Function Problem
Reply to this topic with quote Modify your message

fra (19 Jul, 2005 06:23):
Hello. Please help us to solve the problem.

We are developers of software under OS/2 Warp. We use Borland C++ for OS/2 version 2.0. After updating OS/2 Warp 4 on eComStation 1.2 we met a prob-lem. Our programs that work on OS/2 don’t work correctly on eComStation. They start without any problems. But after some time they unexpectedly crash without any error messages. When we start such program System Activity Monitor shows some values (for example 2%). Then this value start to grow. Our programs crash in level of 25%. We tried to solve this problem and found that some window func-tions don’t work correctly (in our case: WinSetPresParam(hwnd, PP_FOREGRAUNDCOLORINDEX, …), WinSetPresParam(hwnd, PP_BACKGRAUNDCOLORINDEX, …), etc.) We think it happens because of different schemes of memory management in OS/2 Warp and eComStation. How to find way out of this case?



Maybe try the program with Openwatcom?

Date: 29 Jul, 2005 on 13:35
Redbill
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 7
since: 15 Jun, 2004
7. Re:API Function Problem
Reply to this topic with quote Modify your message

fra (19 Jul, 2005 06:23):
Hello. Please help us to solve the problem.

We are developers of software under OS/2 Warp. We use Borland C++ for OS/2 version 2.0. After updating OS/2 Warp 4 on eComStation 1.2 we met a prob-lem. Our programs that work on OS/2 don’t work correctly on eComStation. They start without any problems. But after some time they unexpectedly crash without any error messages. When we start such program System Activity Monitor shows some values (for example 2%). Then this value start to grow. Our programs crash in level of 25%. We tried to solve this problem and found that some window func-tions don’t work correctly (in our case: WinSetPresParam(hwnd, PP_FOREGRAUNDCOLORINDEX, …), WinSetPresParam(hwnd, PP_BACKGRAUNDCOLORINDEX, …), etc.) We think it happens because of different schemes of memory management in OS/2 Warp and eComStation. How to find way out of this case?



Hallo fra,

using the source you supplied I compiled it with OpenWatcom 1.1 (with minor modification) and can reproduce the problem with eComStation 1.1 . I found out that the program reduces the amount of available memory here.
Further investigation required.

Best regards,
Axel

Date: 29 Jul, 2005 on 21:05
cloclo
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 11
since: 25 Feb, 2004
8. Re:API Function Problem
Reply to this topic with quote Modify your message
Hello.

I had exactly the same problem you describe two years ago when migrating from Warp4 to ECS1.1 and the ECS 1.2 my PM applications. Don't try to change the compiler, the problem resides in the API itself (for info, I use the GNAT ADA compiler). In fact the problem appears when you use WinSetPresParam with any of these options:
PP_FOREGROUNDCOLORINDEX
PP_FOREGROUNDCOLOR
PP_BACKGROUNDCOLORINDEX
PP_BACKGROUNDCOLOR

I could solve the problem under ECS 1.2 by unchecking the "advanced desktop features" or "windows enhancements" something like this at ECS installation time (I could tell you more after rescanning the install options). The counterpart is that I lost the title bar and button enhancements provided by eStylerlite developped by Alessandro Cantatore.

In fact, I think that the problem resides in the button enhancement developped by Alessandro. About 2kbytes of system memory are lost at every of the calls listed above. I did not take contact with him at that moment but maybe it is the good time to send him a small mail because it seems that I am not the only victim of this bug.

Good luck with your developments.

François

Date: 29 Jul, 2005 on 21:51
eCSNL
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this memberhttp://home.wanadoo.nl/rwklein
posts: 6
since: 03 Dec, 2002
9. Re:API Function Problem
Reply to this topic with quote Modify your message

fra (19 Jul, 2005 06:23):
Hello. Please help us to solve the problem.

We are developers of software under OS/2 Warp. We use Borland C++ for OS/2 version 2.0. After updating OS/2 Warp 4 on eComStation 1.2 we met a prob-lem. Our programs that work on OS/2 don’t work correctly on eComStation. They start without any problems. But after some time they unexpectedly crash without any error messages. When we start such program System Activity Monitor shows some values (for example 2%). Then this value start to grow. Our programs crash in level of 25%. We tried to solve this problem and found that some window func-tions don’t work correctly (in our case: WinSetPresParam(hwnd, PP_FOREGRAUNDCOLORINDEX, …), WinSetPresParam(hwnd, PP_BACKGRAUNDCOLORINDEX, …), etc.) We think it happens because of different schemes of memory management in OS/2 Warp and eComStation. How to find way out of this case?



I work for Mensys. Why have not contacted us !? At least I saw no support ticket. eComStation 1.2 has clear directions where to get suppor tin the manual. Anyway with your source code we have been able to reproduce the problem and fix has been made. Should be made public soon and will also be part the eComStation 1.2.1. media refresh. This will be downloadble for 1.2 users free of charge or order a media kit,
This update will also contain lastest kernel, lastest drivers from IBM, MMeCS updates and can install on an Athlon 64.

Date: 02 Aug, 2005 on 11:19
cloclo
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 11
since: 25 Feb, 2004
10. Re:API Function Problem
Reply to this topic with quote Modify your message
Great !

I'm extremely pleased to hear that this problem could be solved. But I must say that I introduced a Bug report about this in june 2004 in the Bug tracker for eComStation 1.1 EN (bug report 745).

Anyway I will be pleased to test the new media refresh for ECS1.2. Could you tell how to proceed to get it or download it ? (I'm registred for ECS 1.1 & 1.2)


Best regards

Date: 02 Aug, 2005 on 23:10
cloclo
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 11
since: 25 Feb, 2004
11. Re:API Function Problem
Reply to this topic with quote Modify your message
After having tested the patch from eComStation developers, I am happy to tell that the bug seems to be corrected !

They told me it will be part of the future media refres (ECS 1.2.1)

Date: 05 Aug, 2005 on 17:14
Radek
Premium member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 121
since: 17 Jul, 2003
12. Re:API Function Problem
Reply to this topic with quote Modify your message
Okay, and what about eCS 1.1 users? They will be doomed to buggy WinSetPresParam or they will get a patch, too?
Date: 05 Aug, 2005 on 17:49
eCSNL
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this memberhttp://home.wanadoo.nl/rwklein
posts: 6
since: 03 Dec, 2002
13. Re:API Function Problem
Reply to this topic with quote Modify your message

Radek (05 Aug, 2005 17:49):
Okay, and what about eCS 1.1 users? They will be doomed to buggy WinSetPresParam or they will get a patch, too?

Why speculate ? If people have questions contact us !?!!?
Of course this fix will be released to the genereal public.

Roderick

Date: 06 Aug, 2005 on 21:01
API Function Problem
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
All times are CET+1. < Prev. | P. 1 | Next >
Go to:
 

Powered by UltraBoard 2000 Standard Edition,
Copyright © UltraScripts.com, Inc. 1999-2000.
Home | Gallery | Forums | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com 2000-2004