I think I have figured my own answer, I just redeclared the
TMenuItemInfo at the top of the pas file that uses this command and the
function declaration copied from D3 and it has fixed the bug/problem. It
must have been the     hbmpItem: HBITMAP;       { used if MIIM_BITMAP}
section that was causing Win 95 to fall over.

Regards
Jason Coley
Manawatu Software Solutions
http://www.software-solutions.co.nz


-----Original Message-----
From: Jason L. Coley 
Sent: Tuesday, 29 May 2001 2:21 p.m.
To: Multiple recipients of list delphi
Subject: [DUG]: RE: InsertMenuItem not working D5 Win 95

I have recently moved to D5 from D3 and recompiled my dll and it uses
the Win API InsertMenuItem, but it does not work in Win95 systems, but
works fine under win2K winMe Win98. Has anyone experienced this problem?

I think it may have something to do with the implementation of the
MenuItemInfo structure changes in D5 from D3

D3:

  TMenuItemInfoA = packed record
    cbSize: UINT;
    fMask: UINT;
    fType: UINT;             { used if MIIM_TYPE}
    fState: UINT;            { used if MIIM_STATE}
    wID: UINT;               { used if MIIM_ID}
    hSubMenu: HMENU;         { used if MIIM_SUBMENU}
    hbmpChecked: HBITMAP;    { used if MIIM_CHECKMARKS}
    hbmpUnchecked: HBITMAP;  { used if MIIM_CHECKMARKS}
    dwItemData: DWORD;       { used if MIIM_DATA}
    dwTypeData: PAnsiChar;      { used if MIIM_TYPE}
    cch: UINT;               { used if MIIM_TYPE}
  end;

D5:

  tagMENUITEMINFOA = packed record
    cbSize: UINT;
    fMask: UINT;
    fType: UINT;             { used if MIIM_TYPE}
    fState: UINT;            { used if MIIM_STATE}
    wID: UINT;               { used if MIIM_ID}
    hSubMenu: HMENU;         { used if MIIM_SUBMENU}
    hbmpChecked: HBITMAP;    { used if MIIM_CHECKMARKS}
    hbmpUnchecked: HBITMAP;  { used if MIIM_CHECKMARKS}
    dwItemData: DWORD;       { used if MIIM_DATA}
    dwTypeData: PAnsiChar;      { used if MIIM_TYPE}
    cch: UINT;               { used if MIIM_TYPE}
    hbmpItem: HBITMAP;       { used if MIIM_BITMAP}
  end;

notice the hbmpItem at the end of the D5 listing, so how can I get
around this problem? Any suggestions?

Regards
Jason Coley
Manawatu Software Solutions
http://www.software-solutions.co.nz
<http://www.software-solutions.co.nz/>

------------------------------------------------------------------------
---
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"

Reply via email to