Mike,
I forgot to mention that I have code so you can roll your own Dialogs at
run time. I use it with a script engine I created. If you're interested email
me at mailto:[email protected][email protected]</A>
James
------------------
[This message has been edited by jcfuller (edited June 29, 2000).]
Announcement
Collapse
No announcement yet.
Using a Codeptr instead of Function name when adding DDT control?
Collapse
X
-
Mike --
The CONTROL ADD function does not support CALL DWORD, in part (I would speculate) because you must use a special CALLBACK function, not just any old function. And since the compiler has no way of knowing whether or not your lFunc points to a CALLBACK function or a regular function...
Your best bet is probably to simulate the effect you're looking for, by using an IF/THEN block inside your CALLBACK FUNCTION. This is only pseudo-code, but I'm picturing something like this:
Code:Callback Function MasterCallback() as long DIM dwFunc1 AS GLOBAL DWORD IF CBCTL = %CTL_ID THEN CALL DWORD dwFunc1 USING (...) CBHNDL, CBCTL, CBWPARAM, CBLPARAM ELSEIF CBCTL = %etc. CALL DWORD etc. ELSEIF... etc. END IF End Function Sub TryIt() DIM dwFunc1 AS GLOBAL DWORD dwFunc1 = CODEPTR(Test) CONTROL ADD BUTTON, hWin, %CTL_ID, "Caption", _ x,y,xx,yy, 0, CALL MasterCallback End Sub
Code:Callback Function MasterCallback() as long DIM dwFunc() AS GLOBAL DWORD CALL DWORD dwFunc(CBCTL) USING(...) CBHNDL,CBCTL,CBWPARAM,CBLPARAM TO lResult FUNCTION = lResult End Function
------------------
Perfect Sync: Perfect Sync Development Tools
Email: mailto:[email protected][email protected]</A>
[This message has been edited by Eric Pearson (edited June 27, 2000).]
Leave a comment:
-
Mike,
The way I would handle it is to use a common callback function for
all your controls and from there use CALL DWORD with the CODEPTR of the
function you want.
James
------------------
Leave a comment:
-
Using a Codeptr instead of Function name when adding DDT control?
Hi. I'm wondering if its possible to use a Codeptr instead of a function name when adding a DDT control?
e.g.
Code:Callback Function Test() as long Msgbox "hi" End FUnction Sub TryIt() lFunc = CODEPTR(Test) CONTROL ADD BUTTON, hWin, %CTL_ID, "Caption", _ x,y,xx,yy, 0, CALL lFunc End Sub
-Mike
[This message has been edited by Mike Joseph (edited June 27, 2000).]Tags: None
Leave a comment: