Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WithEvents ...
Message
From
26/06/2001 08:10:14
 
General information
Forum:
Visual Basic
Category:
COM, DCOM and OLE automation
Title:
Miscellaneous
Thread ID:
00521653
Message ID:
00523477
Views:
19
Vin,

Thanks. Somehow I didn't realize that Withevents could be used with both scenarios.

But... my problem remains because, indeed, I will probably need to remove all references.

It's all because of the setup in place here. When an application is launched, it checks the version against the version stored in the registry. If different, then it will shutdown and a batch file will fire. That batch file will re-register all DLLs needed by the application and relaunch the app. This is to insure that app and their DLLs are in sync.

To do this, the app must not reference its DLLs (Arghhhh! :) ).



>Ben -- I am not sure if this will help/make a difference, but I want to point out that there is a slight, but important, difference between late/early binding and the use of CreateObject/New.
>
>Early binding means that a project reference has been added to VB, and the variable has been DIM'd as a type of that object. But whether you use NEW or Createobject(), in this context, doesn't affect your ability to use WithEvents.
>
>When you say that you "might have to go to latebinding and use CreateObject instead" what do you mean? Are you also removing the references, and DIM'ing your variables as objects (or variants)? If so, I can't think of anything to solve your problem.
>
>But, some folks I know prefer CreateObject() to NEW even when using Project References (I hear tell of a memory leak using NEW, though I haven't come across this myself). If this is your situation, you are in luck: WithEvents will work just fine.
>
>In other words, early binding allows you to use either NEW or CreateObject. Late binding requires CreateObject. But, just because you are using CreateObject, it doesn't mean that you have stopped using early binding. It's the project references and the DIM'ing that count.
>
>
>
>
>
>>>
>>>With vb6...
>>>
>>>We are 'earlybinding' the classes that we are using. And some of them are instantiated with WithEvents keyword. I might have to go to latebinding and use CreateObject instead.
>>>
>>>I'm just hopefull but ... Is there something that will reproduce the WithEvents features when instantiating it with CreateObject?
>>>
>>>I'm not sure ... but I think I read somewhere that I can name a procedure of the form with the name of the object followed by the event (Private sub myObject_EventXXX) ... or something like that ! What is just my imagination ?
>>
>>Events cannot be intercepted when using late binding.
Ben Rail
Business Solutions
LOGI.design
Previous
Reply
Map
View

Click here to load this message in the networking platform