I am trying to use Appendmenu to dynamically add sub menus.
I am playing with the code and can't get the menu description to display. It is just garbled ascii as if i was using a bad pointer.

Here is the code, i am referencing win32.tlb so the i haven't declared these functions in my code.
Any ideas?

Dim wHandle As Long
Dim hmenupopup As Long
Dim result As Long
Dim subPop As Long

wHandle = GetMenu(Me.hwnd)
hmenupopup = CreatePopupMenu()
subPop = CreatePopupMenu()

result = AppendMenu(subPop, MF_STRING, 10, "Sub1")
result = AppendMenu(hmenupopup, MF_POPUP, subPop, "Sub")

result = AppendMenu(hmenupopup, MF_STRING, 1, "Copy")
result = AppendMenu(hmenupopup, MF_STRING, 2, "Cut")
result = AppendMenu(wHandle, MF_POPUP, hmenupopup, "Edit")

DrawMenuBar (Me.hwnd)