Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Drag/Drop between treeviews causes C5 error
Message
De
18/06/2004 12:19:48
 
 
À
17/06/2004 16:23:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00914439
Message ID:
00915126
Vues:
10
I finally put a timer on the form that checks for a value. The value is set to true when the left tree is empty (no more items to process). Then the timer event releases the form and it works fine without any c5 errors.


>Sorry it didn't work.
>
>I had that problem with an activex control i assigned to a variable which i didn't properly cleaned-up - when i restarted my form, it would crash my whole app.
>
>looking at your code (i don't know if you clean up later in that method) you have 2 references 'dangling' after finishing the code.
>
>- oNode
>- this.DropHighlight
>
>try
>oNode = .null. and release oNode at the end of this method and before destroying your form this.DropHighlight = .null.
>
>hope this helps.
>
>
>>Well, I thought I had this resolved, but it appears to still be happening. To recap, items in treeview1 are dragged over to items in treeview2. I can step through the code and see that the oledragdrop event of treeview2 has finished running cleanly and exited the event. If all items in treeview1 have been dragged and dropped to treeview2 then I close the form for the user. This is the same process as when the user clicks on a button to move an item from treeview1 to treeview2 to process it (see the call to cmdadd below). Treeview1 is cleared and repopulated afterwards and if there are no items in treeview1 then I display a message (using messagebox) and close the form for the user. Everything runs cleanly when the user clicks on the button themselves to do the move but when the user uses oledragdrop if I close the form afterwards for the user then after the form is destroyed and the calling form is reactivated, a C5 occurs. If I step through it I can see that the
>>oledragdrop event below has finished running.
>>
>>LPARAMETERS data, effect, button, shift, x, y
>>DODEFAULT()
>>LOCAL oNode
>>oNode=this.Hittest(x/96*1440,y/96*1440)
>>
>>IF TYPE("oNode")="O" AND !ISNULL(oNode)
>>	*--Selected a node on the right (policy or name)
>>	this.DropHighlight = oNode
>>	IF !EMPTY(thisform.tpolicy)
>>		THIS.nodeclick(onode)
>>		RETURN thisform.cmdmove.click()
>>	ENDIF
>>ELSE
>>	*--Did not select a policy or name on the right (no node selection)
>>	IF !EMPTY(thisform.tpolicy)
>>		RETURN thisform.cmdadd.click()  && see note below!!
>>	ENDIF
>>ENDIF
>>*NOTE:  if the user clicks on the item in tree1 and then clicks on an item
>>*       in tree2 and clicks on the cmdadd button, everything runs fine and
>>*       no c5 error occurs.  The form only closes if all items in the tree1
>>*       have been processed and the same code is run when the user clicks
>>*       on cmdadd and when he/she uses the mouse to drag/drop.
>>
>>There is only one other object that is created in the process run from the cmdadd button and it is a progress window. I check for it and release it if it exists before the form is released. I thought not releasing that object was causing my c5 error but it is still ocurring.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform