If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I attached my control on the another usercontrol (as Web container),
because I would like to create Web application.

The problem is that it wouldn't been terminated when user closed IE. I mean
that Usercontrol_Terminated event of Usercontrol container (not mycontrol)
has never been raised. I had tested something and found that:
If I set like this : Set MyControl1.Datasource.Tablesource.Table =
Grid <-- msflexgrid

<< code within Property Table>>
Dim m_objFlex as MSFlexGrid
Public Set Property Table(Byval vData as Object)
Set m_objFlex = vData
End Property
<< >>
My web-app has never been shut-down. If I didn't set this property, it
can terminate properly. Unfortunately, I have to use MSFlexGrid as a datasource
for my control, and I need to let my control to work on MSFlexGrid; such
as fill data, or change color in MSFlexGrid.

I try to set m_objFlex to nothing before closing the Web, it can terminate
properly. Unfortunately, I can't track when user needs to close the Web.
Indeed, the Web should be terminated properly when user closed the Web.
That's the problem. How can I solve this problem?

Re: Usercontrol's never been terminated

"Rattagarn V." <rattagarn@hotmail.com> wrote:
>
>Hi all,
>
> I create an ActiveX control which needs to link with MSFlexGrid. This
>is my component model:
>
> MyControl (usercontrol)
> |
> +------ Datasource (Get Property () as CDatasrc class)
> |
> + ---- Tablesource (Get Property () as
>CTable class)
> |
> + ----- Table (Set
>Property (Byval vData as Object)
>
> I attached my control on the another usercontrol (as Web container),
>because I would like to create Web application.
>
>The problem is that it wouldn't been terminated when user closed IE. I
mean
>that Usercontrol_Terminated event of Usercontrol container (not mycontrol)
>has never been raised. I had tested something and found that:
> If I set like this : Set MyControl1.Datasource.Tablesource.Table
=
>Grid <-- msflexgrid
>
> << code within Property Table>>
> Dim m_objFlex as MSFlexGrid
> Public Set Property Table(Byval vData as Object)
> Set m_objFlex = vData
> End Property
> << >>
>My web-app has never been shut-down. If I didn't set this property, it
>can terminate properly. Unfortunately, I have to use MSFlexGrid as a datasource
>for my control, and I need to let my control to work on MSFlexGrid; such
>as fill data, or change color in MSFlexGrid.
>
> I try to set m_objFlex to nothing before closing the Web, it can terminate
>properly. Unfortunately, I can't track when user needs to close the Web.
> Indeed, the Web should be terminated properly when user closed the Web.
> That's the problem. How can I solve this problem?
>
>Thank you
>Rattagarn V.

Re: Usercontrol's never been terminated

Hi

Thank you for Micheal Culley's reponse and his last good tip.

I tried to use your solution with the problem I got. Unfortunately, it didn't
work. Now I have no problem about Parent/Child circular reference. I tested
this by implementing a small active X project and has the parent/child relationships.
It runs and shutdown properly. Unintentionally, I found the another error
which probably caused the shutdown problem of the control. It is my last
posted message. So I used your solution as I told, but it didn't work.

What should I deal with this problem?

Best Regards
Rattagarn V.

"Michael Culley" <m_culley@one.net.au> wrote:
>
>Rattagarn,
>
>I remember answering this question before. Didn't my previous suggestion
>work?
>
>Michael Culley
>
>
>"Rattagarn V." <rattagarn@hotmail.com> wrote:
>>
>>Hi all,
>>
>> I create an ActiveX control which needs to link with MSFlexGrid.
This
>>is my component model:
>>
>> MyControl (usercontrol)
>> |
>> +------ Datasource (Get Property () as CDatasrc class)
>> |
>> + ---- Tablesource (Get Property () as
>>CTable class)
>> |
>> + ----- Table (Set
>>Property (Byval vData as Object)
>>
>> I attached my control on the another usercontrol (as Web container),
>>because I would like to create Web application.
>>
>>The problem is that it wouldn't been terminated when user closed IE. I
>mean
>>that Usercontrol_Terminated event of Usercontrol container (not mycontrol)
>>has never been raised. I had tested something and found that:
>> If I set like this : Set MyControl1.Datasource.Tablesource.Table
>=
>>Grid <-- msflexgrid
>>
>> << code within Property Table>>
>> Dim m_objFlex as MSFlexGrid
>> Public Set Property Table(Byval vData as Object)
>> Set m_objFlex = vData
>> End Property
>> << >>
>>My web-app has never been shut-down. If I didn't set this property, it
>>can terminate properly. Unfortunately, I have to use MSFlexGrid as a
datasource
>>for my control, and I need to let my control to work on MSFlexGrid; such
>>as fill data, or change color in MSFlexGrid.
>>
>> I try to set m_objFlex to nothing before closing the Web, it can
terminate
>>properly. Unfortunately, I can't track when user needs to close the Web.
>> Indeed, the Web should be terminated properly when user closed the Web.
>> That's the problem. How can I solve this problem?
>>
>>Thank you
>>Rattagarn V.
>

Re: Usercontrol's never been terminated

Rattagarn,

I would need more info. Simplify the control so that you get the same problem
and post this code

Michael Culley

"Rattagarn V" <rattagarn@hotmail.com> wrote:
>
>Hi
>
> Thank you for Micheal Culley's reponse and his last good tip.
>
>I tried to use your solution with the problem I got. Unfortunately, it
didn't
>work. Now I have no problem about Parent/Child circular reference. I tested
>this by implementing a small active X project and has the parent/child relationships.
> It runs and shutdown properly. Unintentionally, I found the another error
>which probably caused the shutdown problem of the control. It is my last
>posted message. So I used your solution as I told, but it didn't work.
>
>What should I deal with this problem?
>
>Best Regards
>Rattagarn V.
>
>"Michael Culley" <m_culley@one.net.au> wrote:
>>
>>Rattagarn,
>>
>>I remember answering this question before. Didn't my previous suggestion
>>work?
>>
>>Michael Culley
>>
>>
>>"Rattagarn V." <rattagarn@hotmail.com> wrote:
>>>
>>>Hi all,
>>>
>>> I create an ActiveX control which needs to link with MSFlexGrid.
>This
>>>is my component model:
>>>
>>> MyControl (usercontrol)
>>> |
>>> +------ Datasource (Get Property () as CDatasrc class)
>>> |
>>> + ---- Tablesource (Get Property ()
as
>>>CTable class)
>>> |
>>> + ----- Table (Set
>>>Property (Byval vData as Object)
>>>
>>> I attached my control on the another usercontrol (as Web container),
>>>because I would like to create Web application.
>>>
>>>The problem is that it wouldn't been terminated when user closed IE.
I
>>mean
>>>that Usercontrol_Terminated event of Usercontrol container (not mycontrol)
>>>has never been raised. I had tested something and found that:
>>> If I set like this : Set MyControl1.Datasource.Tablesource.Table
>>=
>>>Grid <-- msflexgrid
>>>
>>> << code within Property Table>>
>>> Dim m_objFlex as MSFlexGrid
>>> Public Set Property Table(Byval vData as Object)
>>> Set m_objFlex = vData
>>> End Property
>>> << >>
>>>My web-app has never been shut-down. If I didn't set this property,
it
>>>can terminate properly. Unfortunately, I have to use MSFlexGrid as a
>datasource
>>>for my control, and I need to let my control to work on MSFlexGrid; such
>>>as fill data, or change color in MSFlexGrid.
>>>
>>> I try to set m_objFlex to nothing before closing the Web, it can
>terminate
>>>properly. Unfortunately, I can't track when user needs to close the Web.
>>> Indeed, the Web should be terminated properly when user closed the Web.
>>> That's the problem. How can I solve this problem?
>>>
>>>Thank you
>>>Rattagarn V.
>>
>

Public Sub LoadDataFromFlex()
Dim i As Long
Dim j As Long
Dim n As Long
For i = 1 To m_objFlex.Rows - 1
For j = 1 To m_objFlex.Cols - 1
n = n + 1
m_cBoxes.Add Me, m_objFlex.TextMatrix(i, j)
Next j
Next i
End Sub
====================================================