Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form's datasession can't be released
Message
From
29/05/2002 23:41:46
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00605724
Message ID:
00662853
Views:
20
Hi Nadya! I hope you're fine.

Great news! Can you send me this code? I'll love see it.

Fábio

>Hi Fabio,
>
>Today we tracked down the problem to the usage of the custom MessageBoxX function. If we use normal messagebox(), we don't have this problem. I reported this problem to Rick.
>
>>Hi Nadya,
>>
>>Yes... your probable solution seems clear and simple. But I've a reasonable doubt about if it will works. Explaining: In my case, even releasing the caller form and its DS (a private one) the 2nd "unknown" DS still remains, if using type() function. But we have to try to be sure.
>>
>>Fábio
>>
>>>Hi Fabio,
>>>
>>>I'm not sure, what in our case it's the type function to blame. My colleague changed every occurrence of type() function to vartype() function, but the problem still remained. This application is extremely complicated, so it's hard to trace the problem, besides, it's not mine, so I offered some help, but I can not spend too much time on it.
>>>
>>>I also have an idea, which may simplify this application. Currently it has Update library with couple of classes, one of them is update class based on custom class. In the init of this class it opens a form and all operations are happening in the form's private DS. So, I'm thinking, why do we need to complicate our life. Just made this form to be an update class, make this form a class, that's it. Simple, right? And I hope, it would solve this Unknown session problem as well.
>>>
>>>Still it would be interesting to find the root of the problem...
>>>
>>>>Hi Nadya!
>>>>
>>>>Well... Probably we are facing a bug (some kind of memory leak) when using the type() function.
>>>>I've noticed this happens when frx2word starts. I've tried isolating the problem interrupting the class execution in several points. This type() function was used in the beginning of the reportform method as follows:
>>>>
>>>>
>>>>dimension apropchar(5,2)
>>>>oword = createobject("word.application")
>>>>with oword
>>>>    apropchar(1,1) = ".Application.UserName"
>>>>    apropchar(2,1) = ".Application.UserInitials"
>>>>    apropchar(3,1) = ".Application.UserAddress"
>>>>    apropchar(4,1) = ".Activedocument.Password"
>>>>    apropchar(5,1) = ".Activedocument.WritePassword"
>>>>    for i = 1 to 5
>>>>        if  type(apropchar(m.i,1)) # "U"
>>>>            apropchar(m.i,2) = evaluate(apropchar(m.i,1))
>>>>        endif
>>>>    next
>>>>endwith
>>>>
>>>>Even using all kind of CLEAR statements, the unknown datasession still remains. And yes... CLEAR ALL manage to kill the unknown datasession, but it clears everything and it is not desirable.
>>>>When I've found this error, I simply comment the IF statement and the second datasession vanish as desired.
>>>>I've tried reproducing this error in a single form, but it'll not occur. It seems only occurs when the type function is contained in a class.
>>>>I suggest you the same approach, i.e., trying interrupting your class in order to see where it happens.
>>>>
>>>>Let me know the results.
>>>>
>>>>Fábio
>>>>
>>>>>Hi Fabio,
>>>>>
>>>>>We seemed to just be hit by the similar problem. My colleague inherited an application from another colleague. This application uses lots of constructs like if type('oValid')<>"O" ...
>>>>>She closed everything in Destroy method, yet we see "Unknown datasession 2", which is empty. We tried to execute every clear command, e.g.:
>>>>>CLEAR CLASSLIB name
>>>>>CLEAR TYPEHEAD
>>>>>etc. and it was not released until we typed clear all.
>>>>>
>>>>>I just showed her this message from you, so she is working on the code right now and making changes. Let's see, if it would solve this problem, and if it would, it clearly looks like a bug and should be reported...
>>>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform