|
-
May 21st, 2001, 09:17 PM
#1
Thread Starter
New Member
Appendmenu description string garbled
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)
-
May 22nd, 2001, 07:07 AM
#2
Fanatic Member
I used the tlb's that came with Hardcore VB, and it worked fine, it sounds daft and should be noddifferent than the way you are currently doing but maybe you could try:
Code:
Dim wHandle As Long
Dim hmenupopup As Long
Dim result As Long
Dim subPop As Long
Dim smItem As String
smItem = "Sub1" & VbNullChar
wHandle = GetMenu(Me.hwnd)
hmenupopup = CreatePopupMenu()
subPop = CreatePopupMenu()
'dunno if this will change anything - but worth a try...
result = AppendMenu(subPop, MF_STRING, 10, ByVal smItem)
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|