Does M!Table work with tablewindow inside splitterwindow form?

forum.3rdparty.tools (2005-2010)
Marko Naivo

Does M!Table work with tablewindow inside splitterwindow form?

Post by Marko Naivo » 02 Mar 2007, 12:55

 Posted by:  Marko Naivo 

Hi!
I tried to use sorting feature of M!Table (version 1.6.3) on table window,
which I assigned into one pane of splitted form window.
---
Set hWndChildLeft = GetParent ( SalCreateWindowEx( 'tblMyTableWindow',
hWndForm, 0, 0, 0, 0, CREATE_AsChild ))
---
MTblSubClass( tblMyTableWindow) returns TRUE as usually, but unfortunately
MTblFindNextCol does not find any column on my table window, although table
window hadle is ok.
When table window is opened as normal table window, MTblFindNextCol works
fine.

Is it a known phenomenom, that MTblFindNextCol (or other functions in
general) would not work with "sinked" table windows?

Regards, Marko

micsto
Germany
Posts: 752
Joined: 07 Mar 2017, 16:07
Location: Germany

Does M!Table work with tablewindow inside splitterwindow form?

Post by micsto » 02 Mar 2007, 13:30

 Posted by:  Michael Stoll \(MICSTO\) 

Hi Marko,

MTblSubClass must be the first called function in the SAM_Create message
handler of a table, otherwise it's not guaranteed that M!Table works as
expected ( it's also mentioned in the documentation )!

So you have to change your code this way:

Table Window: tblMyTableWindow
...
Message Actions
On SAM_Create
Call MTblSubClass( hWndForm )
...

Cheers
Michael

Marko Naivo

Does M!Table work with tablewindow inside splitterwindow form?

Post by Marko Naivo » 02 Mar 2007, 14:41

 Posted by:  Marko Naivo 

Hi Michael,
Yes, I had also tried a variation that MTblSubClass was called already under
SAM_Create of table window,
and there were no affect. The While-loop
While MTblFindNextCol( SalNumberToWindowHandle( nWindowHandleToSort ),
hWndCol, 0, 0 )
does not find any column of table window.
If I don't "sink" the table window into splitted form window (which has
derived cSplitterWindow), M!Table finds columns and sorting works.
Application is MDI style.

-Marko-

micsto
Germany
Posts: 752
Joined: 07 Mar 2017, 16:07
Location: Germany

Does M!Table work with tablewindow inside splitterwindow form?

Post by micsto » 02 Mar 2007, 15:01

 Posted by:  Michael Stoll \(MICSTO\) 

Hi Marko,

are you really sure that you pass the correct window handle?
Maybe you can provide a small testcase?

Cheers
Michael

Marko Naivo

Does M!Table work with tablewindow inside splitterwindow form?

Post by Marko Naivo » 05 Mar 2007, 10:54

 Posted by:  Marko Naivo 

Here is a small sample (SplitterAndMtbl.apt) for demonstrating the occured
difference.
The sample demonstrates the problem,
that MTblFindNextCol does not find table window columns,
when table window is "sinked" onto splitted form window.

It is done with GTD 3.1.0 PTF 4
It used mtbl.dll version 1.6.3.0 (TD 3.x version)
and was runned under Windows 2000 SP 4

-Marko-

Attachment: SplitterAndMtbl.apt

micsto
Germany
Posts: 752
Joined: 07 Mar 2017, 16:07
Location: Germany

Does M!Table work with tablewindow inside splitterwindow form?

Post by micsto » 05 Mar 2007, 12:08

 Posted by:  Michael Stoll \(MICSTO\) 

Hi Marko,

the problem is that you assign the window handle of the parent window to
"hWndMyTableWindow".

Here is the original code fragment:
! When Acessories is enabled, then importing successes only using
GetParent() (defined from USER32.DLL)
Set hWndChildLeft = GetParent ( SalCreateWindowEx( 'tblMyTableWindow',
hWndForm, 0, 0, 0, 0, CREATE_AsChild ))
! Run-time assignment to top pane
Call SetChild( TRUE, hWndChildLeft )
Set hWndMyTableWindow = hWndChildLeft ! **** Argh - that's not true, it's
the handle of the table's parent! *****

Of course no M!Table function will work when "hWndMyTableWindow" isn't the
table but the parent window!

You have to change the code this way:
Set hWndMyTableWindow = SalCreateWindowEx( 'tblMyTableWindow', hWndForm, 0,
0, 0, 0, CREATE_AsChild )
! When Acessories is enabled, then importing successes only using
GetParent() (defined from USER32.DLL)
Set hWndChildLeft = GetParent ( hWndMyTableWindow )
! Run-time assignment to top pane
Call SetChild( TRUE, hWndChildLeft )

As you can see, "hWndMyTableWindow" now contains the handle of the table
window, and all M!Table functions will work properly.

Cheers
Michael

Marko Naivo

Does M!Table work with tablewindow inside splitterwindow form?

Post by Marko Naivo » 05 Mar 2007, 13:21

 Posted by:  Marko Naivo 

Thank you for your notice - it was just a simple window handle mistake.
After the correction M!Table can see again the table window.

Vielen Dank!

-Marko-

micsto
Germany
Posts: 752
Joined: 07 Mar 2017, 16:07
Location: Germany

Does M!Table work with tablewindow inside splitterwindow form?

Post by micsto » 05 Mar 2007, 13:55

 Posted by:  Michael Stoll \(MICSTO\) 

My pleasure! ( for all german and austrian people: "Gern geschehen!" ;) )

Michael

Return to “3rdparty.tools”

Who is online

Users browsing this forum: [Ccbot] and 0 guests