Ok, I found the culprit.
It appears Pb does not create/pass literal strings the same way "c" does.
'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
'iup menu.c -> Pbcc menu.bas
' The IupSetAttribute procedure was the problem.
'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
#COMPILE EXE
#CONSOLE OFF
#DIM ALL
'Use José's Include Files
'#INCLUDE ONCE "windows.inc"
'#Include Once "PbLib610.bas"
'Make sure you compile the rc file first.
'#RESOURCE RES,"IUPTEST.RES"
'#include "iup.bi"
MACRO NULL = 0
MACRO IHANDLE = DWORD
MACRO StringzPtr = DWORD
MACRO VoidPtr = DWORD
MACRO Icallback = DWORD
%IUP_CLOSE = -3
%IUP_ERROR = 1
$DLLNAME = "iup.dll"
'==============================================================================
'int IupOpen (int *argc, char ***argv);
Declare Function IupOpen cdecl Import $DLLNAME Alias "IupOpen" (BYVAL DWORD,BYVAL DWORD)AS LONG
'------------------------------------------------------------------------------
'Ihandle* IupItem (const char* title, const char* action);
Declare Function IupItem cdecl Import $DLLNAME Alias "IupItem"(Byref StringZ,Byref StringZ) As Ihandle
'------------------------------------------------------------------------------
'void IupSetAttribute (Ihandle* ih, const char* name, const char* value);
Declare Sub IupSetAttribute cdecl Import $DLLNAME Alias "IupSetAttribute"(Byval Ihandle,Byref Stringz,Byref Stringz)
'------------------------------------------------------------------------------
'void IupSetStrAttribute(Ihandle* ih, const char* name, const char* value);
Declare Sub IupSetStrAttribute cdecl Import $DLLNAME Alias "IupSetStrAttribute"(Byval Ihandle,Byref Stringz,Byref Stringz)
'------------------------------------------------------------------------------
'Ihandle* IupSetAttributes (Ihandle* ih, const char *str);
Declare Function IupSetAttributes cdecl Import $DLLNAME Alias "IupSetAttributes"(Byval Ihandle,Byref Stringz) As Ihandle
'------------------------------------------------------------------------------
'Icallback IupSetCallback (Ihandle* ih, const char *name, Icallback func);
Declare Function IupSetCallback cdecl Import $DLLNAME Alias "IupSetCallback"(Byval Ihandle,Byref Stringz,Byval Icallback) As Icallback
'------------------------------------------------------------------------------
'Ihandle* IupSeparator (void);
Declare Function IupSeparator cdecl Import $DLLNAME Alias "IupSeparator"() As Ihandle
'------------------------------------------------------------------------------
'Ihandle* IupMenu (Ihandle* child,...);
Declare Function IupMenu cdecl Import $DLLNAME Alias "IupMenu"(Byval Ihandle, OPT _
Byval Ihandle, _
Byval Ihandle, _
Byval Ihandle, _
Byval Ihandle, _
Byval Ihandle, _
Byval Ihandle, _
Byval Ihandle, _
Byval Ihandle _
) As Ihandle
'------------------------------------------------------------------------------
'Ihandle* IupSubmenu (const char* title, Ihandle* child);
Declare Function IupSubmenu cdecl Import $DLLNAME Alias "IupSubmenu"(Byref StringZ,Byval Ihandle) As Ihandle
'------------------------------------------------------------------------------
'Ihandle* IupSetHandle (const char *name, Ihandle* ih);
Declare Function IupSetHandle cdecl Import $DLLNAME Alias "IupSetHandle"(Byref Stringz,Byval Ihandle) As Ihandle
'------------------------------------------------------------------------------
'Ihandle* IupDialog (Ihandle* child);
Declare Function IupDialog cdecl Import $DLLNAME Alias "IupDialog"(Byval Ihandle) As Ihandle
'------------------------------------------------------------------------------
'Ihandle* IupCanvas (const char* action);
Declare Function IupCanvas cdecl Import $DLLNAME Alias "IupCanvas"(Byref StringZ) As Ihandle
'------------------------------------------------------------------------------
'int IupShow (Ihandle* ih);
Declare Function IupShow cdecl Import $DLLNAME Alias "IupShow"(Byval Ihandle) As Long
'------------------------------------------------------------------------------
'int IupMainLoop (void);
Declare Function IupMainLoop cdecl Import $DLLNAME Alias "IupMainLoop"() As Long
'------------------------------------------------------------------------------
'void IupClose (void);
DECLARE SUB IupClose cdecl Import $DLLNAME Alias "IupClose"()
'==============================================================================
FUNCTION exit_cb()cdecl AS LONG
FUNCTION = %IUP_CLOSE
END FUNCTION
'==============================================================================
Function PbMain()
Dim rv AS long
Local dlg,menu,item_save, item_open, item_undo, item_exit, file_menu, _
sub1_menu As Ihandle
rv = IupOpen(0,0)
IF rv = %IUP_ERROR THEN
'MsgBox("Initialize Failed")
? "Initialize Failed"
EXIT FUNCTION
END IF
item_open = IupItem ("Open", "")
IupSetAttribute(item_open, "KEY", "O")
item_save = IupItem ("Save", "")
IupSetAttribute(item_save, "KEY", "S")
item_undo = IupItem ("Undo", "")
IupSetAttribute(item_undo, "KEY", "U")
IupSetAttribute(item_undo, "ACTIVE", "NO")
item_exit = IupItem ("Exit", "")
IupSetAttribute(item_exit, "KEY", "x")
IupSetCallback(item_exit, "ACTION", CODEPTR(exit_cb))
file_menu = IupMenu(item_open, _
item_save, _
IupSeparator(), _
item_undo, _
item_exit, _
NULL)
sub1_menu = IupSubmenu("File", file_menu)
menu = IupMenu(sub1_menu, NULL)
IupSetHandle("mymenu", menu)
dlg = IupDialog(IupCanvas(""))
'Use IupSetAttributes
IupSetAttributes(dlg, "TITLE=IupMenu,SIZE=QUARTERxQUARTER,MENU=mymenu")
'or IupSetStrAttribute instead of IupSetAttribute
'IupSetStrAttribute(dlg, "TITLE","IupMenu")
'IupSetStrAttribute(dlg, "SIZE", "QUARTERxQUARTER")
'IupSetStrAttribute(dlg, "MENU", "mymenu")
IupShow(dlg)
IupMainLoop()
IupClose()
End Function
All fixed.
James