Adam@Datapel
2019-03-26T10:38:35Z
Hi Igor,

We are experiencing some major problems with iGrid 7.0/6.5 under windows 10 environment. On closing our application we are getting the Run-time error '97': Can not call friend function on object which is not an instance of defining class.

This only occurs when we close the application - everything runs fine until we close the app.

Worst case can we just get a fix to suppress the dialog box - as it seems to be only when the controls are unloading?

Any help you can offer would be great!

Thanks,
Adam


Igor/10Tec
2019-03-26T14:50:52Z
Can you reproduce this problem in a brand new project? Does it occur when you have several iGrid's on a form?

And what is your development environment?
Adam@Datapel
2019-03-27T14:31:11Z
Hey Igor,

Thanks for coming back to me - I decided to spend some more time working with it... our project is complex and I am embedding the iGrid as part of the CodeJock TaskPanels control. I decide to run the iGrid control in code hoping to spot the error - turns out I managed to catch something.

The root cause appears to be the error -> UserControl.hDC Client Site Not Available (398)... but in run-time this is not actually the result (we get a 97).

Reason behind it - seems like iGrid is attempting to render (triggered in pBuildMemDCGrid/Row) - however the hdc is gone! (presumably due to the parent unloading).

So I did manage to fix it in the iGrid Code by adding some On Error Resume Next(s) where the Draws were running... as I am not keen on having a one-off build of iGrid I found another solution.

In the Form_Unload Event I just set my iGrids.BeginUpdate - in this way the controls will not render - as I figure they are receiving events after the parent is gone.

This seems to have WORKED! Vb6 now exits cleanly. I guess its a rare circumstance - but for cases where iGrid is getting embedded into another UserControl (as is our case) it seems like this may require addressing. For now I have a simple fix - just looks a bit weird in the code. If you want to see were I put the error handlers let me know - but I think you might get what I mean...

Cheers, Adam

Igor/10Tec
2019-03-28T07:13:34Z
Yes, I understand the nature of your fix. I can recall that one or two developers reported such a problem earlier, and it was related to placing iGrid in a non-standard control container. I do not remember exactly whether it was a CodeJock panel - but something like this. As I understand, those controls use non-standard techniques to work with child controls inside them or to provide other features like visual themes, and this approach may be incompatible with iGrid.

Interesting, can you reproduce the problem you reported with the standard VB6/Microsoft control containers like GroupBox or a similar control?
Adam@Datapel
2019-03-28T07:19:00Z
Hi Again,

Thanks for confirming that others may have seen this problem - everything is stable for me now. Unfortunately I am running behind schedule at the moment so will not have a chance to test this out any further. We do have some standard user controls that we are replacing an embedded sGrid with iGrid - so I will let you know if that causes any issues.

Cheers,
Adam@Datapel