UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
2 Pages V < 1 2  (Go to first unread post)
   Reply to this topicStart new topic
> Building A 'virtual Com Object', Any Version    
 
   
jleach
post Jun 19 2018, 08:21 AM
Post#21


UtterAccess Editor
Posts: 10,145
Joined: 7-December 09
From: St Augustine, FL


What you're looking for is called Aspect Oriented Programming - but not something that VBA can do OOTB (ref: https://stackoverflow.com/questions/242177/...ed-programming). If you're familiar with .NET at all and using method attributes (or the process of weaving), it's sort of like that but much more... separated. Essentially it means attaching some sort of unrelated, (usually) global type of behavior to a method (e.g., sub, function). A particularly apt use-case is for logging.

As for doing this in VBA/COM, this is going beyond an area I feel comfortable talking about (for fear of giving false information), but as I understand...

Part of the COM platform (which is not realized directly through VB/A*) is the ability to places hooks on events (or more technically I guess, intercepting messages that are sent when an event fires). By writing a custom COM object and having it operate at a level where it can "see" the inner workings of Access, it may be possible to have that COM object intercept messages that are responsible for raising the events that we see and use in Access.

* Windows API 32bit Programming and Subclassing and Hooks, both by O'Reily - another dated but good pair of books on that particular topic, though I don't know if it's quite the right direction (note that this isn't the basic "API programming" that many VBA programs have speckled in their code, but "real" Windows API programming - in much more depth than we tend to see). Again, I don't have an ISBN handy as everything's packed (ask me again in 6 weeks and I should have it handy again).

My guess would be that this is something along the lines of what vbWatchdog is doing (and my guess would also be that it's a fairly proprietary technique, in such that general use could hurt sales, so a full dissemination might be out of reach). With that said, maybe he's sitting around bored waiting for a next project to work on smile.gif

Cheers,

(p.s. - I'm fairly certain that there is no .NET work involved with vbWatchDog - besides the fact that the two platforms are somewhat at odds with each other (.NET isn't a fan or working heavily with unmanaged code, to the point where something like this would be easier just to avoid it), I'm near certain that there are no external dependency requirements with vbWatchdog, which would be impossible if it utilizes any sort of the .NET framework... with that said, he does have utilities that do this, but his core technique and most code I'm familiar with does not).
Go to the top of the page
 
jleach
post Jun 19 2018, 08:34 AM
Post#22


UtterAccess Editor
Posts: 10,145
Joined: 7-December 09
From: St Augustine, FL


Here's a entry on AOP from the C2 wiki: http://wiki.c2.com/?AspectOrientedProgramming

(c2 is amazing... no other place can I go for a few hours and be some humbled as the original wiki)
Go to the top of the page
 
JonSmith
post Jun 19 2018, 08:56 AM
Post#23


UtterAccess VIP
Posts: 4,053
Joined: 19-October 10



Thanks Jack!
I have more keywords to search for now.
I'll get cracking with them tomorrow.

I can understand where you are coming from with Wayne perhaps not wanting to share stuff that might hurt sales and I'm not planning on asking him to divulge his trade secrets, more just pointers on if stuff is possible or not. Hopefully he'll be kind enough to oblige my curiosity.

JS
Go to the top of the page
 
2 Pages V < 1 2


Custom Search


RSSSearch   Top   Lo-Fi    16th October 2019 - 02:45 PM