Hi guys,
I'm a real newbie, coming from the PBCC side of things. I am trying to write my first program with PB9, and it's not going well.
All the program does is draw a line in a graphic control. Alas, it's not drawing the line.
Can someone look at this and enlighten me?
Thanks,
Mike...
I'm a real newbie, coming from the PBCC side of things. I am trying to write my first program with PB9, and it's not going well.
All the program does is draw a line in a graphic control. Alas, it's not drawing the line.
Can someone look at this and enlighten me?
Thanks,
Mike...
Code:
#COMPILE EXE #DIM ALL %usemacros = 1 #INCLUDE "win32api.inc" #INCLUDE "commctrl.inc" #INCLUDE "PBForms.Inc" 'constants %idd_dialog1 = 101 %idc_button1 = 1001 %idc_graphic1 = 1002 GLOBAL hDlg AS DWORD GLOBAL mylabel AS STRING GLOBAL hParent AS DWORD GLOBAL hWin AS DWORD 'declarations DECLARE CALLBACK FUNCTION showDialog1proc() DECLARE FUNCTION ShowDialog1(BYVAL hParent AS DWORD) AS LONG 'main entry point FUNCTION PBMAIN () AS LONG 'PBFormsInitComCtrls (%icc_win95_classes or %icc_date_classes or_ '%icc_internet_classes) showDialog1 %HWND_DESKTOP END FUNCTION 'callbacks CALLBACK FUNCTION ShowDialog1Proc() 'LOCAL hDlg AS DWORD LOCAL hWin AS DWORD SELECT CASE AS LONG CBMSG CASE %WM_COMMAND SELECT CASE AS LONG CBCTL CASE %idc_button1 IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN 'mylabel$ = "hDlg = " + str$(hDlg) 'msgbox mylabel$ 'drawline GRAPHIC ATTACH hDlg, %idc_graphic1 GRAPHIC COLOR %RED, RGB(0,0,191) GRAPHIC LINE (10,-10)-(50,-50) END IF END SELECT END SELECT END FUNCTION 'dialogs FUNCTION showdialog1(BYVAL hParent AS DWORD) AS LONG LOCAL Rslt AS LONG ' LOCAL hDlg AS DWORD DIALOG NEW hParent, "Dialog1",384,184,201,121,%WS_POPUP OR %WS_SYSMENU OR _ %WS_BORDER OR %WS_DLGFRAME OR %DS_MODALFRAME, TO hDlg CONTROL ADD BUTTON, hDlg, %IDC_BUTTON1, "Button1",68,90,75,20 CONTROL ADD GRAPHIC, hDlg, %idc_graphic1, "", 50,10,100,75,%WS_BORDER DIALOG SHOW MODAL hDlg, CALL showDialog1Proc TO Rslt FUNCTION = Rslt END FUNCTION
Comment