Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #35  
Old 06-25-2014, 07:59 AM
whatsup whatsup is offline Slow "comparison/replace" script Windows 7 64bit Slow "comparison/replace" script Office 2010 32bit
Competent Performer
 
Join Date: May 2014
Posts: 137
whatsup will become famous soon enough
Default

I see your correction, but you still left out an important thing:
Quote:
If Mem_ReadHex_Words(lng_varPtr, 4) doesn't point anymore to
HexPtr(lng_objPtr, 4)
That's especially important for object-variables which are set to an object like "As Worksheet". That's because the lng_ObjPtr we obtain from objwks is the same as we get from ObjPtr(Sheet1). Since Sheet1 still exists when we check afterwards, it doesn't tell if the reference hold by VarPtr(objwks) has been released.

I have to come back on the example in my file for Run11_clsTest(). It actually doesn't show that the class got destroyed. I made an attempt to obtain the VarPtr and ObjPtr for Class1, but it didn't work therefore I left it. Now I figured it out:
Class1:
Code:
Public Sub Class_Initialize()
     Debug.Print "Class1 is initialized"
    
lng_objcls1 = ObjPtr(Me)
lng_varcls1 = VarPtr(Me)
    pointerToSomething "objClass1", lng_varcls1, lng_objcls1, coBytes
 End Sub
I still don't know why
Code:
lng_objcls1 = ObjPtr(Class1)
isn't accepted, but with "Me" it works.
Checking on these datas afterwards, it shows properly that the class gets terminated:
Mod11_Class:
Code:
Sub Run11_clsTest()
 Do_Header "Running Test_Class..."
Test_Class
    DoEvents
    Debug.Print "After Runtime"
    pointerToSomething "objcls1", lng_varPtr, lng_objPtr, coBytes
    pointerToSomething "objClass1", lng_varcls1, lng_objcls1, coBytes
    
End Sub
Quote:
Im building a class module now to encapsulate this stuff to make it more convenient to deploy....
I don't get what exactly you are after, but I guess you will surprise me again
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wierd "script code" in a downloaded .doc file CNBarnes Word 2 10-18-2012 02:07 AM
Slow "comparison/replace" script replace data from variable with "sub and super script" from excel to word by vba krishnaoptif Word VBA 9 06-22-2012 05:08 AM
Slow "comparison/replace" script How to choose a "List" for certain "Heading" from "Modify" tool? Jamal NUMAN Word 2 07-03-2011 03:11 AM
Rules and Alerts: "run a script"? discountvc Outlook 0 06-15-2010 07:36 AM
An "error has occurred in the script on this page" decann Outlook 8 09-03-2009 08:54 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft