
VB Auto-generation of certain events (was Re: VB refuses to load my control DLL)
This is a follow-up to a long-expired (on most servers, I would assume)
message of my own. I'd fill in the message-id in the references, just
in case, but I'm not currently using a newsreader that lets me do that.
Google link for the whole thread:
http://www.*-*-*.com/ %40hal...
Anyway, I found a gotcha to doing controls for VB. If it's documented
anywhere, I just haven't put in the right search parameters. Anyway,
it seems VB autogenerates GotFocus and LostFocus events for at least
some controls. My specific case is a wrapper for a Windows Edit
control which provides some extensions. Since I didn't realize this,
I tried to supply my own GotFocus and LostFocus, and VB refused to
load the control dll, without saying anything about the cause for the
rejection. M{*filter*}of the story: if you encounter a similar problem, try
selectively removing events from your interface, and when you find ones
that it works without, you may presume that VB is generating them for
you.
(
My original problem statement:
I created a control DLL which was working very nicely, and all the
properties were doing what I wanted them to do. When I added events
(and implemented the connection point), VB suddenly started refusing
to load my DLL, without any detail about what it found offensive.
After commenting out the event methods in the IDL and references to the
event interface in the ATL code, VB became happy again.
)