|
-
Mar 30th, 2001, 12:59 AM
#1
Thread Starter
New Member
A few days ago I found out, that VB6 knows variable with name "RefCount". I have tried to use this variable, but I always getting a message "Out of stack".
I wanted to use this variable to obtain number of references for COM objet. (In C++ a variable with this name is using for reference counting)
Do somebody know, how to employ this variable.
Thanks a lot. Martin
-
Mar 30th, 2001, 07:46 AM
#2
Fanatic Member
Why do you need to get the reference count anyway??
I took the Example from Bruce's book, I don't know much about vtable hacking / reference counting hacks apart from the issues involved in Vtable referencing when you subclass your own ActiveX controls. I'm afraid you're on your own here - and like Bruce said = "Don't go into a hatchet fight without a hatchet" or smoething like that??.....
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Apr 2nd, 2001, 03:51 AM
#3
Fanatic Member
you could do this also:
Code:
Public Function ObjRefCount(obj As IUnknown) As Long
On Error GoTo IsNothing
obj.AddRef ' errs if is Nothing (not set), rtns 0
ObjRefCount = obj.Release
IsNothing:
End Function
'credit to http://www.mvps.org/btmtz
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|