Hi, I am just finishing up another tutorial, but suddenly I have smashed into a brick wall.
It seems that either I am doing something very dumb, or else PB is not handling the pointer I set to an array in the manner I expected. You see, an API function is wanting a pointer to an array of a specific number of elements. (Simple?) However the API call is apparently not accessing that array? Hmm..
Here is my current code (VERY messy right now, I know..)
.
.
;Declare variables
#wID = 66
;Open window
If OpenWindow(0, 150, 150, 300, 300, #PB_Window_SystemMenu, "Read Status Bar API Test")
hWnd = WindowID()
Else
MessageRequester("Ouch", "Damn brick walls!
EndIf
;Set up status bar
test$ = "WORK?"
InitCommonControls_()
StatushWnd = CreateStatusWindow_(#WS_VISIBLE | #WS_CHILD, @test$, hWnd, #wID)
;Set up gadgets
If CreateGadgetList(hWnd)
TextGadget(007, 2, 50, 100, 20, "", #PB_Text_Center | #PB_Text_Border)
Else
MessageRequester("", "", 0)
EndIf
;Call SendMessage API
szText$ = Space(12)
SetText$ = "Yahoo!!"
Dim SetParts.w(3)
SetParts(0) = 60
SetParts(1) = 120
SetParts(2) = 180
SendMessage_(StatushWnd, #SB_SETPARTS, 3, @SetParts)
SendMessage_(StatushWnd, #SB_SETTEXT, 0, @SetText$)
SendMessage_(StatushWnd, #SB_GETTEXT, 0, @szText$)
SetGadgetText(007, szText$)
;Main loop
Repeat
Select WaitWindowEvent()
Case #WM_ClOSE
Quit = 1
EndSelect
Until Quit = 1
;Finish up
End
.
.
#SB_SETPARTS is not working the way I expected. The trouble seems to be localized there. Did I make some foolish logic error (or typo)? Or is there something about using pointers to arrays in PB I am not yet familar with? Please help me if you can. Thank you!
Take care.
- Art Sentinel
http://www.artsentinel.net
--------------
Top Ten Reasons Not To Procrastinate:
Coming Soon...
