|
Post by Walt Decker on Oct 23, 2022 15:34:41 GMT -5
Runtime error index: 20 is out of collection range.
The zip contains the source code and TABCTL.DLL.
The Styles tab window is created without problem as are the General and Size tab windows. However when attempting to add the Styles tab window to the tab control I get the error. The General and Size tabs are added without problem.
I have added a message to the dll add tab function, and it appears that with Styles the runtime is triggered before the function is called.
The dll is used by several people without problem, and I have used it in the PVS app on this forum without problem.
I could create a tab control using LB code, but the dll is simpler and easier to manage.
Thanks for your help.
|
|
|
Post by Walt Decker on Oct 23, 2022 18:27:25 GMT -5
After 3 days of banging my head more bald than it is I think finally found the problem. I re-wrote the function to use literals for each of the controls and then repositioned them to fit the form. So, I think the problem has to do with LB's inability to properly handle variables.
Have a nice day!
|
|
|
Post by Brandon Parker on Nov 2, 2022 18:03:15 GMT -5
Well, that is a strong stance to take, but could it be that you are most likely not using the appropriate variable type in LB for the DLL function parameter?
{:0)
Brandon Parker
|
|
|
Post by Walt Decker on Nov 3, 2022 9:44:24 GMT -5
Well, that is a strong stance to take, but could it be that you are most likely not using the appropriate variable type in LB for the DLL function parameter? {:0) Brandon Parker
No, Mr. Parker. The following function is used to add pages to the tab control. The only difference in the windows added is in the way the controls are defined for the windows. In the window that threw the error the placement of the controls was defined thusly:
0, 0, Lbwide, Lbhigh Lbwide + 5, 0, Lbwide, Lbhigh Lbwide * 2 + 10, 0, Lbwide, LbHigh
Before adding the window to the tab control the widow was created without a problem.
After changing the control placement to literals and then adjusting the the size and location after the window was created the error dissapeared.
' FUNCTION FN.AddTab(TabHndl, WinHndl$, Title$, Idx) '####################################################### ' Add a tab to the tab control ' ' WinHndl$ = Handl of the window which the tab will contain '#######################################################
PageHndl = FN.GetHndl(WinHndl$)
TabName$ = Title$ Index = 0 CALLDLL #TAB, "FN_AddTab", TabHndl AS ULONG, PageHndl AS ULONG, _ 0 AS ULONG, TabName$ AS PTR, Idx AS LONG, _ Index AS LONG FN.AddTab = Index + 1 END FUNCTION '
'------------------------------------------------------------ '------------------------------------------------------------
|
|