🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.basic.visual.misc
Article #190

Re: VBX instances - HCTL values

#190
From: Jon Machtynger
Date: Mon, 25 Mar 1996 09:30
43 lines
2097 bytes
Bill,

Sorry I could not reply to your email before.  I've had email-out
problems but can use Free-Agent to post.  In any case, I still
can't see how you're getting your problem.

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 can only assume that you've made a user error.  Don't forget
that the VBX is a DLL and therefore shared by *all* controls using it.
So, your global variables are literally that.  If any instance needs to
reference info, make sure you set up an array and search based on
its hctl/hwnd.

Hope this helps.

Jon
----------------------------

mastbrook@duff.com (Bill Mastbrook) wrote:
>Does anyone know how the HCTL values passed to the main control
>procedure of a VBX are generated?
>Each instance of a VBX that I've created seems to be generating the
>same value for HCTL.  This is causing major problems because any
>events fired within the VBX are always fired in the instance of the
>VBX most recently created (i.e. the second of two VB applications
>started using the VBX).  I'm sure that I'm missing something very
>basic, but there doesn't seem to be any documentation on this.
>Everything I've seen says that these HCTL values are unique.  Period.
>And that's all it says.  ANY ideas of what I might be doing wrong
>would be greatly appreciated.
>Bill
Technical Details
Message-ID: <4j5p85$qv9@zebedee.ingres.co.uk>
Path: arc1-ca.pugleaf.net!ingres.co.uk!usenet
References: <4iv5pk$j2q@news.its.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!ingres.co.uk!usenet
From: jonm@ingres.com (Jon Machtynger)
Newsgroups: comp.lang.basic.visual.misc,comp.lang.c,comp.os.ms-windows.programmer.controls
Subject: Re: VBX instances - HCTL values
Date: Mon, 25 Mar 1996 09:30:08 GMT
Organization: Me!
Message-ID: <4j5p85$qv9@zebedee.ingres.co.uk>
References: <4iv5pk$j2q@news.its.com>
Reply-To: jonm@ingres.com
NNTP-Posting-Host: peacky.ingres.com
X-Newsreader: Forte Free Agent 1.0.82