Article View: comp.lang.basic.visual.misc
Article #191Re: VBX instances - HCTL values
From: Bill Mastbrook
Date: Mon, 01 Apr 1996 18:34
Date: Mon, 01 Apr 1996 18:34
61 lines
2717 bytes
2717 bytes
> mastbrook@duff.com (Bill Mastbrook) wrote:
>>Each instance of a VBX that I've created seems to be generating the
>>same value for HCTL.
jonm@ingres.com (Jon Machtynger) wrote:
>To convince you that it should all work. Take a look at the circ2
>or circ3 examples that come with VB3.0 Proffessional edition.
>In the FireClickIn reoutine, add the following code.
>char Msg[100];
>wsprintf(Msg, "HTCL = %d", hctl);
>MessageBox(NULL, Msg, NULL, MB_OK);
>Now creae two circ2 controls. When you click on each one, it
>should show a different value.
I did exactly this and the same problem still exists: The HCTL value
returned from clicking in any instance of the circ2.vbx is 242. This
is exactly the same value for hctl that I always see from any VBX
(242).
Here's exactly what I did ...
Added the above code to the beginning of FireClickIn in circ2.c.
Made a new VBX project using VC++ 1.52.
Added files circ2.c, circ2.def, circ2.rc to the project.
Added vbapi to the list of linked libraries.
Built the VBX.
Created a new VB 3.0 exe containing one form with the circ2.vbx on it.
(No code, whatsoever).
Copied the VBX to my system directory.
Ran multiple instances of this exe.
All clicks generated "HCTL = 242".
I did receive the following warnings when buildiing the VBX:
Binding resources...
RC: warning RW4002: Non-discardable segment 1 set to PRELOAD
RC: warning RW4002: Non-discardable segment 2 set to PRELOAD
I ignored them.
Any ideas? Could this possibly be a problem with my machine, my
compiler, my compile setttings, or something similar, because from
this test using circ2.vbx I would tend to think that there isn't
anything wrong with my code.
I just realized that when you said, "Now creae two circ2 controls",
that you may have meant to create two different .vbx files using the
same code. Is this correct? If so, does this mean that any instance
of a particular VBX (i.e. .vbx file included in a VB project and the
vbx control placed on a form) passes the same HCTL value to the main
procedure of the VBX. If this is true, then I'm back to my original
question, "How do you fire events in the correct one?".
Thanks,
Bill
Technical Details
Message-ID:
<4jp844$8jn@news.its.com>Path:
arc1-ca.pugleaf.net!news.its.com!usenetReferences:
<4iv5pk$j2q@news.its.com> <4j5p85$qv9@zebedee.ingres.co.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.its.com!usenet From: mastbrook@duff.com (Bill Mastbrook) Newsgroups: comp.lang.basic.visual.misc,comp.lang.c,comp.os.ms-windows.programmer.controls Subject: Re: VBX instances - HCTL values Date: Mon, 01 Apr 1996 18:34:11 GMT Organization: Information Technology Solutions, Inc. Message-ID: <4jp844$8jn@news.its.com> References: <4iv5pk$j2q@news.its.com> <4j5p85$qv9@zebedee.ingres.co.uk> NNTP-Posting-Host: duff230.duff.com X-Newsreader: Forte Free Agent 1.0.82