Object "name" in C++ vs VB 
Author Message
 Object "name" in C++ vs VB

Sorry for the cross-posting, but I hope someone in one of these groups can
help me...

I'm using an OCX developed (I'm assuming, in VB) by a third party. This OCX
has several controls. These controls can be "associated" with each other by
assigning the other's control "name" in a property.

For example (in VB), you do something like this:

' Assume two controls already exist as variables: ctrlA and ctrlB
ctrlB.OtherControl    = "ctrlA"    ' associate ctrlA with ctrlB
ctrlB.Attach                            ' attach them

Now, somehow, in VB magic land, ctrlB is able to take the string "ctrlA" and
turn it into a reference to the actual instance of the variable, ctrlA, of
the other control. I have no idea how this is done in the code, internally,
but I'm wondering if there's any way, in C++ (MFC or ATL), that I can turn
my instance of the control into a string that the VB code can use to get
that instance. Currently, I'm using MFC, and have imported the OCX. So,
ClassWizard has created a bunch of wrapper code for the OCX controls... but
I can't really modify that code, since I have no guarantee that ClassWizard
won't overwrite it again.

Any thought, ideas, shots in the dark...?

Thanks,
Jeff
--
Jeffrey T. Muller
Genetic MicroSystems, Inc.

http://www.*-*-*.com/



Tue, 04 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB
Jeff:

I know nothing about your VB-related questions, but if you derive your own C++
classes from the ones MFC provided for you, then you can make any changes you
want without CW changing them back again. Just change the designation of the
control object to be your derived class rather than the MFC class.

HTH,

David Wilkinson

==============

Quote:

> Sorry for the cross-posting, but I hope someone in one of these groups can
> help me...

> I'm using an OCX developed (I'm assuming, in VB) by a third party. This OCX
> has several controls. These controls can be "associated" with each other by
> assigning the other's control "name" in a property.

> For example (in VB), you do something like this:

> ' Assume two controls already exist as variables: ctrlA and ctrlB
> ctrlB.OtherControl    = "ctrlA"    ' associate ctrlA with ctrlB
> ctrlB.Attach                            ' attach them

> Now, somehow, in VB magic land, ctrlB is able to take the string "ctrlA" and
> turn it into a reference to the actual instance of the variable, ctrlA, of
> the other control. I have no idea how this is done in the code, internally,
> but I'm wondering if there's any way, in C++ (MFC or ATL), that I can turn
> my instance of the control into a string that the VB code can use to get
> that instance. Currently, I'm using MFC, and have imported the OCX. So,
> ClassWizard has created a bunch of wrapper code for the OCX controls... but
> I can't really modify that code, since I have no guarantee that ClassWizard
> won't overwrite it again.

> Any thought, ideas, shots in the dark...?

> Thanks,
> Jeff
> --
> Jeffrey T. Muller
> Genetic MicroSystems, Inc.

> http://www.geneticmicro.com



Tue, 04 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB
OK, I found out that the object enumerates all of its parent's children,
until it finds one with the "Name" specified. So here's my "new" question.
In C++, how can I assign the control a "Name"? That property, which is
inherent in VB, is not exposed in C++.

Jeff
--
Jeffrey T. Muller
Genetic MicroSystems, Inc.

http://www.geneticmicro.com

Quote:
> Sorry for the cross-posting, but I hope someone in one of these groups can
> help me...

> I'm using an OCX developed (I'm assuming, in VB) by a third party. This
OCX
> has several controls. These controls can be "associated" with each other
by
> assigning the other's control "name" in a property.

> For example (in VB), you do something like this:

> ' Assume two controls already exist as variables: ctrlA and ctrlB
> ctrlB.OtherControl    = "ctrlA"    ' associate ctrlA with ctrlB
> ctrlB.Attach                            ' attach them

> Now, somehow, in VB magic land, ctrlB is able to take the string "ctrlA"
and
> turn it into a reference to the actual instance of the variable, ctrlA, of
> the other control. I have no idea how this is done in the code,
internally,
> but I'm wondering if there's any way, in C++ (MFC or ATL), that I can turn
> my instance of the control into a string that the VB code can use to get
> that instance. Currently, I'm using MFC, and have imported the OCX. So,
> ClassWizard has created a bunch of wrapper code for the OCX controls...
but
> I can't really modify that code, since I have no guarantee that
ClassWizard
> won't overwrite it again.

> Any thought, ideas, shots in the dark...?

> Thanks,
> Jeff
> --
> Jeffrey T. Muller
> Genetic MicroSystems, Inc.

> http://www.geneticmicro.com



Tue, 04 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB
David,

Good thought. Thanks,
Jeff

--
Jeffrey T. Muller
Genetic MicroSystems, Inc.

http://www.geneticmicro.com

Quote:
> Jeff:

> I know nothing about your VB-related questions, but if you derive your own
C++
> classes from the ones MFC provided for you, then you can make any changes
you
> want without CW changing them back again. Just change the designation of
the
> control object to be your derived class rather than the MFC class.

> HTH,

> David Wilkinson

> ==============


> > Sorry for the cross-posting, but I hope someone in one of these groups
can
> > help me...

> > I'm using an OCX developed (I'm assuming, in VB) by a third party. This
OCX
> > has several controls. These controls can be "associated" with each other
by
> > assigning the other's control "name" in a property.

> > For example (in VB), you do something like this:

> > ' Assume two controls already exist as variables: ctrlA and ctrlB
> > ctrlB.OtherControl    = "ctrlA"    ' associate ctrlA with ctrlB
> > ctrlB.Attach                            ' attach them

> > Now, somehow, in VB magic land, ctrlB is able to take the string "ctrlA"
and
> > turn it into a reference to the actual instance of the variable, ctrlA,
of
> > the other control. I have no idea how this is done in the code,
internally,
> > but I'm wondering if there's any way, in C++ (MFC or ATL), that I can
turn
> > my instance of the control into a string that the VB code can use to get
> > that instance. Currently, I'm using MFC, and have imported the OCX. So,
> > ClassWizard has created a bunch of wrapper code for the OCX controls...
but
> > I can't really modify that code, since I have no guarantee that
ClassWizard
> > won't overwrite it again.

> > Any thought, ideas, shots in the dark...?

> > Thanks,
> > Jeff
> > --
> > Jeffrey T. Muller
> > Genetic MicroSystems, Inc.

> > http://www.geneticmicro.com



Tue, 04 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB

OK, since nobody's responding, I'll blabber some more...

Might the "control's name" be the same string that I pass in for the window
name to CreateControl() ???

--
Jeffrey T. Muller
Genetic MicroSystems, Inc.

http://www.geneticmicro.com

Quote:
> OK, I found out that the object enumerates all of its parent's children,
> until it finds one with the "Name" specified. So here's my "new" question.
> In C++, how can I assign the control a "Name"? That property, which is
> inherent in VB, is not exposed in C++.

> Jeff
> --
> Jeffrey T. Muller
> Genetic MicroSystems, Inc.

> http://www.geneticmicro.com


> > Sorry for the cross-posting, but I hope someone in one of these groups
can
> > help me...

> > I'm using an OCX developed (I'm assuming, in VB) by a third party. This
> OCX
> > has several controls. These controls can be "associated" with each other
> by
> > assigning the other's control "name" in a property.

> > For example (in VB), you do something like this:

> > ' Assume two controls already exist as variables: ctrlA and ctrlB
> > ctrlB.OtherControl    = "ctrlA"    ' associate ctrlA with ctrlB
> > ctrlB.Attach                            ' attach them

> > Now, somehow, in VB magic land, ctrlB is able to take the string "ctrlA"
> and
> > turn it into a reference to the actual instance of the variable, ctrlA,
of
> > the other control. I have no idea how this is done in the code,
> internally,
> > but I'm wondering if there's any way, in C++ (MFC or ATL), that I can
turn
> > my instance of the control into a string that the VB code can use to get
> > that instance. Currently, I'm using MFC, and have imported the OCX. So,
> > ClassWizard has created a bunch of wrapper code for the OCX controls...
> but
> > I can't really modify that code, since I have no guarantee that
> ClassWizard
> > won't overwrite it again.

> > Any thought, ideas, shots in the dark...?

> > Thanks,
> > Jeff
> > --
> > Jeffrey T. Muller
> > Genetic MicroSystems, Inc.

> > http://www.geneticmicro.com



Tue, 04 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB

I think it is a property using the standard DISPID_CAPTION dispid value.

--
===============================
Alexander Nickolov, MCP
Panasonic Technologies Inc.
Speech Technology Laboratory

===============================

Quote:

>OK, since nobody's responding, I'll blabber some more...

>Might the "control's name" be the same string that I pass in for the window
>name to CreateControl() ???

>--
>Jeffrey T. Muller
>Genetic MicroSystems, Inc.

>http://www.geneticmicro.com


>> OK, I found out that the object enumerates all of its parent's children,
>> until it finds one with the "Name" specified. So here's my "new"
question.
>> In C++, how can I assign the control a "Name"? That property, which is
>> inherent in VB, is not exposed in C++.

>> Jeff
>> --
>> Jeffrey T. Muller
>> Genetic MicroSystems, Inc.

>> http://www.geneticmicro.com


>> > Sorry for the cross-posting, but I hope someone in one of these groups
>can
>> > help me...

>> > I'm using an OCX developed (I'm assuming, in VB) by a third party. This
>> OCX
>> > has several controls. These controls can be "associated" with each
other
>> by
>> > assigning the other's control "name" in a property.

>> > For example (in VB), you do something like this:

>> > ' Assume two controls already exist as variables: ctrlA and ctrlB
>> > ctrlB.OtherControl    = "ctrlA"    ' associate ctrlA with ctrlB
>> > ctrlB.Attach                            ' attach them

>> > Now, somehow, in VB magic land, ctrlB is able to take the string
"ctrlA"
>> and
>> > turn it into a reference to the actual instance of the variable, ctrlA,
>of
>> > the other control. I have no idea how this is done in the code,
>> internally,
>> > but I'm wondering if there's any way, in C++ (MFC or ATL), that I can
>turn
>> > my instance of the control into a string that the VB code can use to
get
>> > that instance. Currently, I'm using MFC, and have imported the OCX. So,
>> > ClassWizard has created a bunch of wrapper code for the OCX controls...
>> but
>> > I can't really modify that code, since I have no guarantee that
>> ClassWizard
>> > won't overwrite it again.

>> > Any thought, ideas, shots in the dark...?

>> > Thanks,
>> > Jeff
>> > --
>> > Jeffrey T. Muller
>> > Genetic MicroSystems, Inc.

>> > http://www.geneticmicro.com



Tue, 04 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB
If I call GetProperty(DISPID_CAPTION,...), I get an exception that sez
"Member not found".

... just not making any progress here...

Jeff

--
Jeffrey T. Muller
Genetic MicroSystems, Inc.

http://www.geneticmicro.com

Quote:
> I think it is a property using the standard DISPID_CAPTION dispid value.

> --
> ===============================
> Alexander Nickolov, MCP
> Panasonic Technologies Inc.
> Speech Technology Laboratory

> ===============================


> >OK, since nobody's responding, I'll blabber some more...

> >Might the "control's name" be the same string that I pass in for the
window
> >name to CreateControl() ???

> >--
> >Jeffrey T. Muller
> >Genetic MicroSystems, Inc.

> >http://www.geneticmicro.com


> >> OK, I found out that the object enumerates all of its parent's
children,
> >> until it finds one with the "Name" specified. So here's my "new"
> question.
> >> In C++, how can I assign the control a "Name"? That property, which is
> >> inherent in VB, is not exposed in C++.

> >> Jeff
> >> --
> >> Jeffrey T. Muller
> >> Genetic MicroSystems, Inc.

> >> http://www.geneticmicro.com


> >> > Sorry for the cross-posting, but I hope someone in one of these
groups
> >can
> >> > help me...

> >> > I'm using an OCX developed (I'm assuming, in VB) by a third party.
This
> >> OCX
> >> > has several controls. These controls can be "associated" with each
> other
> >> by
> >> > assigning the other's control "name" in a property.

> >> > For example (in VB), you do something like this:

> >> > ' Assume two controls already exist as variables: ctrlA and ctrlB
> >> > ctrlB.OtherControl    = "ctrlA"    ' associate ctrlA with ctrlB
> >> > ctrlB.Attach                            ' attach them

> >> > Now, somehow, in VB magic land, ctrlB is able to take the string
> "ctrlA"
> >> and
> >> > turn it into a reference to the actual instance of the variable,
ctrlA,
> >of
> >> > the other control. I have no idea how this is done in the code,
> >> internally,
> >> > but I'm wondering if there's any way, in C++ (MFC or ATL), that I can
> >turn
> >> > my instance of the control into a string that the VB code can use to
> get
> >> > that instance. Currently, I'm using MFC, and have imported the OCX.
So,
> >> > ClassWizard has created a bunch of wrapper code for the OCX
controls...
> >> but
> >> > I can't really modify that code, since I have no guarantee that
> >> ClassWizard
> >> > won't overwrite it again.

> >> > Any thought, ideas, shots in the dark...?

> >> > Thanks,
> >> > Jeff
> >> > --
> >> > Jeffrey T. Muller
> >> > Genetic MicroSystems, Inc.

> >> > http://www.geneticmicro.com



Fri, 07 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB
Well, see the value from a VB type library. VB has some standard
dispid for the 'Name' property...

--
===============================
Alexander Nickolov, MCP
Panasonic Technologies Inc.
Speech Technology Laboratory

===============================

Quote:

>If I call GetProperty(DISPID_CAPTION,...), I get an exception that sez
>"Member not found".

>... just not making any progress here...

>Jeff

>--
>Jeffrey T. Muller
>Genetic MicroSystems, Inc.

>http://www.geneticmicro.com


>> I think it is a property using the standard DISPID_CAPTION dispid value.

>> --
>> ===============================
>> Alexander Nickolov, MCP
>> Panasonic Technologies Inc.
>> Speech Technology Laboratory

>> ===============================


>> >OK, since nobody's responding, I'll blabber some more...

>> >Might the "control's name" be the same string that I pass in for the
>window
>> >name to CreateControl() ???

>> >--
>> >Jeffrey T. Muller
>> >Genetic MicroSystems, Inc.

>> >http://www.geneticmicro.com


>> >> OK, I found out that the object enumerates all of its parent's
>children,
>> >> until it finds one with the "Name" specified. So here's my "new"
>> question.
>> >> In C++, how can I assign the control a "Name"? That property, which is
>> >> inherent in VB, is not exposed in C++.

>> >> Jeff
>> >> --
>> >> Jeffrey T. Muller
>> >> Genetic MicroSystems, Inc.

>> >> http://www.geneticmicro.com


>> >> > Sorry for the cross-posting, but I hope someone in one of these
>groups
>> >can
>> >> > help me...

>> >> > I'm using an OCX developed (I'm assuming, in VB) by a third party.
>This
>> >> OCX
>> >> > has several controls. These controls can be "associated" with each
>> other
>> >> by
>> >> > assigning the other's control "name" in a property.

>> >> > For example (in VB), you do something like this:

>> >> > ' Assume two controls already exist as variables: ctrlA and ctrlB
>> >> > ctrlB.OtherControl    = "ctrlA"    ' associate ctrlA with ctrlB
>> >> > ctrlB.Attach                            ' attach them

>> >> > Now, somehow, in VB magic land, ctrlB is able to take the string
>> "ctrlA"
>> >> and
>> >> > turn it into a reference to the actual instance of the variable,
>ctrlA,
>> >of
>> >> > the other control. I have no idea how this is done in the code,
>> >> internally,
>> >> > but I'm wondering if there's any way, in C++ (MFC or ATL), that I
can
>> >turn
>> >> > my instance of the control into a string that the VB code can use to
>> get
>> >> > that instance. Currently, I'm using MFC, and have imported the OCX.
>So,
>> >> > ClassWizard has created a bunch of wrapper code for the OCX
>controls...
>> >> but
>> >> > I can't really modify that code, since I have no guarantee that
>> >> ClassWizard
>> >> > won't overwrite it again.

>> >> > Any thought, ideas, shots in the dark...?

>> >> > Thanks,
>> >> > Jeff
>> >> > --
>> >> > Jeffrey T. Muller
>> >> > Genetic MicroSystems, Inc.

>> >> > http://www.geneticmicro.com



Fri, 07 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB
Can it be DISPID_AMBIENT_DISPLAYNAME? Just guessing..

On Mon, 21 Jun 1999 16:35:46 -0700, "Alexander Nickolov"

Quote:

>Well, see the value from a VB type library. VB has some standard
>dispid for the 'Name' property...

>--
>===============================
>Alexander Nickolov, MCP
>Panasonic Technologies Inc.
>Speech Technology Laboratory

>===============================


>>If I call GetProperty(DISPID_CAPTION,...), I get an exception that sez
>>"Member not found".

>>... just not making any progress here...

>>Jeff

>>--
>>Jeffrey T. Muller
>>Genetic MicroSystems, Inc.

>>http://www.geneticmicro.com


>>> I think it is a property using the standard DISPID_CAPTION dispid value.

>>> --
>>> ===============================
>>> Alexander Nickolov, MCP
>>> Panasonic Technologies Inc.
>>> Speech Technology Laboratory

>>> ===============================


>>> >OK, since nobody's responding, I'll blabber some more...

>>> >Might the "control's name" be the same string that I pass in for the
>>window
>>> >name to CreateControl() ???

>>> >--
>>> >Jeffrey T. Muller
>>> >Genetic MicroSystems, Inc.

>>> >http://www.geneticmicro.com


>>> >> OK, I found out that the object enumerates all of its parent's
>>children,
>>> >> until it finds one with the "Name" specified. So here's my "new"
>>> question.
>>> >> In C++, how can I assign the control a "Name"? That property, which is
>>> >> inherent in VB, is not exposed in C++.

>>> >> Jeff
>>> >> --
>>> >> Jeffrey T. Muller
>>> >> Genetic MicroSystems, Inc.

>>> >> http://www.geneticmicro.com


>>> >> > Sorry for the cross-posting, but I hope someone in one of these
>>groups
>>> >can
>>> >> > help me...

>>> >> > I'm using an OCX developed (I'm assuming, in VB) by a third party.
>>This
>>> >> OCX
>>> >> > has several controls. These controls can be "associated" with each
>>> other
>>> >> by
>>> >> > assigning the other's control "name" in a property.

>>> >> > For example (in VB), you do something like this:

>>> >> > ' Assume two controls already exist as variables: ctrlA and ctrlB
>>> >> > ctrlB.OtherControl    = "ctrlA"    ' associate ctrlA with ctrlB
>>> >> > ctrlB.Attach                            ' attach them

>>> >> > Now, somehow, in VB magic land, ctrlB is able to take the string
>>> "ctrlA"
>>> >> and
>>> >> > turn it into a reference to the actual instance of the variable,
>>ctrlA,
>>> >of
>>> >> > the other control. I have no idea how this is done in the code,
>>> >> internally,
>>> >> > but I'm wondering if there's any way, in C++ (MFC or ATL), that I
>can
>>> >turn
>>> >> > my instance of the control into a string that the VB code can use to
>>> get
>>> >> > that instance. Currently, I'm using MFC, and have imported the OCX.
>>So,
>>> >> > ClassWizard has created a bunch of wrapper code for the OCX
>>controls...
>>> >> but
>>> >> > I can't really modify that code, since I have no guarantee that
>>> >> ClassWizard
>>> >> > won't overwrite it again.

>>> >> > Any thought, ideas, shots in the dark...?

>>> >> > Thanks,
>>> >> > Jeff
>>> >> > --
>>> >> > Jeffrey T. Muller
>>> >> > Genetic MicroSystems, Inc.

>>> >> > http://www.geneticmicro.com

Girish Bharadwaj [mvp].
Please do not email queries to me.
Post them in newsgroups.
Thank you.


Sat, 08 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB
Using either DISPID_AMBIENT_DIPLAYNAME or DISPID_CAPTION generates the
exception, "Member not found".

Ack!

--
Jeffrey T. Muller
Genetic MicroSystems, Inc.

http://www.geneticmicro.com

Quote:
> Can it be DISPID_AMBIENT_DISPLAYNAME? Just guessing..

> On Mon, 21 Jun 1999 16:35:46 -0700, "Alexander Nickolov"

> >Well, see the value from a VB type library. VB has some standard
> >dispid for the 'Name' property...

> >--
> >===============================
> >Alexander Nickolov, MCP
> >Panasonic Technologies Inc.
> >Speech Technology Laboratory

> >===============================


> >>If I call GetProperty(DISPID_CAPTION,...), I get an exception that sez
> >>"Member not found".

> >>... just not making any progress here...

> >>Jeff

> >>--
> >>Jeffrey T. Muller
> >>Genetic MicroSystems, Inc.

> >>http://www.geneticmicro.com


> >>> I think it is a property using the standard DISPID_CAPTION dispid
value.

> >>> --
> >>> ===============================
> >>> Alexander Nickolov, MCP
> >>> Panasonic Technologies Inc.
> >>> Speech Technology Laboratory

> >>> ===============================


> >>> >OK, since nobody's responding, I'll blabber some more...

> >>> >Might the "control's name" be the same string that I pass in for the
> >>window
> >>> >name to CreateControl() ???

> >>> >--
> >>> >Jeffrey T. Muller
> >>> >Genetic MicroSystems, Inc.

> >>> >http://www.geneticmicro.com


> >>> >> OK, I found out that the object enumerates all of its parent's
> >>children,
> >>> >> until it finds one with the "Name" specified. So here's my "new"
> >>> question.
> >>> >> In C++, how can I assign the control a "Name"? That property, which
is
> >>> >> inherent in VB, is not exposed in C++.

> >>> >> Jeff
> >>> >> --
> >>> >> Jeffrey T. Muller
> >>> >> Genetic MicroSystems, Inc.

> >>> >> http://www.geneticmicro.com


> >>> >> > Sorry for the cross-posting, but I hope someone in one of these
> >>groups
> >>> >can
> >>> >> > help me...

> >>> >> > I'm using an OCX developed (I'm assuming, in VB) by a third
party.
> >>This
> >>> >> OCX
> >>> >> > has several controls. These controls can be "associated" with
each
> >>> other
> >>> >> by
> >>> >> > assigning the other's control "name" in a property.

> >>> >> > For example (in VB), you do something like this:

> >>> >> > ' Assume two controls already exist as variables: ctrlA and ctrlB
> >>> >> > ctrlB.OtherControl    = "ctrlA"    ' associate ctrlA with ctrlB
> >>> >> > ctrlB.Attach                            ' attach them

> >>> >> > Now, somehow, in VB magic land, ctrlB is able to take the string
> >>> "ctrlA"
> >>> >> and
> >>> >> > turn it into a reference to the actual instance of the variable,
> >>ctrlA,
> >>> >of
> >>> >> > the other control. I have no idea how this is done in the code,
> >>> >> internally,
> >>> >> > but I'm wondering if there's any way, in C++ (MFC or ATL), that I
> >can
> >>> >turn
> >>> >> > my instance of the control into a string that the VB code can use
to
> >>> get
> >>> >> > that instance. Currently, I'm using MFC, and have imported the
OCX.
> >>So,
> >>> >> > ClassWizard has created a bunch of wrapper code for the OCX
> >>controls...
> >>> >> but
> >>> >> > I can't really modify that code, since I have no guarantee that
> >>> >> ClassWizard
> >>> >> > won't overwrite it again.

> >>> >> > Any thought, ideas, shots in the dark...?

> >>> >> > Thanks,
> >>> >> > Jeff
> >>> >> > --
> >>> >> > Jeffrey T. Muller
> >>> >> > Genetic MicroSystems, Inc.

> >>> >> > http://www.geneticmicro.com

> Girish Bharadwaj [mvp].
> Please do not email queries to me.
> Post them in newsgroups.
> Thank you.



Sat, 08 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB
I'm just wondering if it's actually _possible_ to do this...

I guess I would really need to know some internals of VB. I'm _guessing_
that when you drop a control on a VB form, it "wraps" that control with some
VB stuff that implements a particular interface that VB knows about, which
provides things like a "Name" attribute, etc. When I drop a control on a
dialog in C++, there is no such wrapper (a least, not the same kind), so
when the VB code searches for an object with the same name, it actually
can't find the interface that provides the "Name" attribute. This, in fact,
appears to be what I'm seeing. When I call the server object's "Attach()"
method, it generates the exception "No such interface supported".

Does this sound likely/possible? If so, the "vendor" is using a VB-specific
mechanism, that won't work if the objects are used in _any_ other language.

Jeff
--
Jeffrey T. Muller
Genetic MicroSystems, Inc.

http://www.geneticmicro.com

Quote:
> OK, since nobody's responding, I'll blabber some more...

> Might the "control's name" be the same string that I pass in for the
window
> name to CreateControl() ???

> --
> Jeffrey T. Muller
> Genetic MicroSystems, Inc.

> http://www.geneticmicro.com


> > OK, I found out that the object enumerates all of its parent's children,
> > until it finds one with the "Name" specified. So here's my "new"
question.
> > In C++, how can I assign the control a "Name"? That property, which is
> > inherent in VB, is not exposed in C++.

> > Jeff
> > --
> > Jeffrey T. Muller
> > Genetic MicroSystems, Inc.

> > http://www.geneticmicro.com


> > > Sorry for the cross-posting, but I hope someone in one of these groups
> can
> > > help me...

> > > I'm using an OCX developed (I'm assuming, in VB) by a third party.
This
> > OCX
> > > has several controls. These controls can be "associated" with each
other
> > by
> > > assigning the other's control "name" in a property.

> > > For example (in VB), you do something like this:

> > > ' Assume two controls already exist as variables: ctrlA and ctrlB
> > > ctrlB.OtherControl    = "ctrlA"    ' associate ctrlA with ctrlB
> > > ctrlB.Attach                            ' attach them

> > > Now, somehow, in VB magic land, ctrlB is able to take the string
"ctrlA"
> > and
> > > turn it into a reference to the actual instance of the variable,
ctrlA,
> of
> > > the other control. I have no idea how this is done in the code,
> > internally,
> > > but I'm wondering if there's any way, in C++ (MFC or ATL), that I can
> turn
> > > my instance of the control into a string that the VB code can use to
get
> > > that instance. Currently, I'm using MFC, and have imported the OCX.
So,
> > > ClassWizard has created a bunch of wrapper code for the OCX
controls...
> > but
> > > I can't really modify that code, since I have no guarantee that
> > ClassWizard
> > > won't overwrite it again.

> > > Any thought, ideas, shots in the dark...?

> > > Thanks,
> > > Jeff
> > > --
> > > Jeffrey T. Muller
> > > Genetic MicroSystems, Inc.

> > > http://www.geneticmicro.com



Sat, 08 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB
I think you are correct. The other posts have been recommending ambient
properties, which are provided by the container. It could be that the
container provided by MFC doesn't support these properties, in which case
you might be SOL. Have you tried contacting the control vendor?

Jeff


Quote:
> I'm just wondering if it's actually _possible_ to do this...

> I guess I would really need to know some internals of VB. I'm _guessing_
> that when you drop a control on a VB form, it "wraps" that control with
some
> VB stuff that implements a particular interface that VB knows about, which
> provides things like a "Name" attribute, etc. When I drop a control on a
> dialog in C++, there is no such wrapper (a least, not the same kind), so
> when the VB code searches for an object with the same name, it actually
> can't find the interface that provides the "Name" attribute. This, in
fact,
> appears to be what I'm seeing. When I call the server object's "Attach()"
> method, it generates the exception "No such interface supported".

> Does this sound likely/possible? If so, the "vendor" is using a
VB-specific
> mechanism, that won't work if the objects are used in _any_ other
language.

> Jeff



Sat, 08 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB
Yes, that's it, but it slipped off my mind for a while :(...

It is not VB specific - it is called extended control. There are some
standard dispids for extended properties and 'Name' is probably
one of them. The extended control is an object provided by the
container which blindly aggregates the control and only overrides
IDispatch and adds some 'extended' properties like its position
on the form, etc. which are not specific for any control. When
you get a pointer to the control on the form, you actually have
pointer to the extended control. The MFC extended control
probably doesn't expose this property, hence the things don't
work... BTW, the extended control is optional in the ActiveX
Controls specification (for the containers), so the control MUST
NOT EXPECT IT!!! It is the VB controls which are poorly written,
not MFC!

--
===============================
Alexander Nickolov, MCP
Panasonic Technologies Inc.
Speech Technology Laboratory

===============================

Quote:

>I'm just wondering if it's actually _possible_ to do this...

>I guess I would really need to know some internals of VB. I'm _guessing_
>that when you drop a control on a VB form, it "wraps" that control with
some
>VB stuff that implements a particular interface that VB knows about, which
>provides things like a "Name" attribute, etc. When I drop a control on a
>dialog in C++, there is no such wrapper (a least, not the same kind), so
>when the VB code searches for an object with the same name, it actually
>can't find the interface that provides the "Name" attribute. This, in fact,
>appears to be what I'm seeing. When I call the server object's "Attach()"
>method, it generates the exception "No such interface supported".

>Does this sound likely/possible? If so, the "vendor" is using a VB-specific
>mechanism, that won't work if the objects are used in _any_ other language.

>Jeff
>--
>Jeffrey T. Muller
>Genetic MicroSystems, Inc.

>http://www.geneticmicro.com


>> OK, since nobody's responding, I'll blabber some more...

>> Might the "control's name" be the same string that I pass in for the
>window
>> name to CreateControl() ???

>> --
>> Jeffrey T. Muller
>> Genetic MicroSystems, Inc.

>> http://www.geneticmicro.com


>> > OK, I found out that the object enumerates all of its parent's
children,
>> > until it finds one with the "Name" specified. So here's my "new"
>question.
>> > In C++, how can I assign the control a "Name"? That property, which is
>> > inherent in VB, is not exposed in C++.

>> > Jeff
>> > --
>> > Jeffrey T. Muller
>> > Genetic MicroSystems, Inc.

>> > http://www.geneticmicro.com


>> > > Sorry for the cross-posting, but I hope someone in one of these
groups
>> can
>> > > help me...

>> > > I'm using an OCX developed (I'm assuming, in VB) by a third party.
>This
>> > OCX
>> > > has several controls. These controls can be "associated" with each
>other
>> > by
>> > > assigning the other's control "name" in a property.

>> > > For example (in VB), you do something like this:

>> > > ' Assume two controls already exist as variables: ctrlA and ctrlB
>> > > ctrlB.OtherControl    = "ctrlA"    ' associate ctrlA with ctrlB
>> > > ctrlB.Attach                            ' attach them

>> > > Now, somehow, in VB magic land, ctrlB is able to take the string
>"ctrlA"
>> > and
>> > > turn it into a reference to the actual instance of the variable,
>ctrlA,
>> of
>> > > the other control. I have no idea how this is done in the code,
>> > internally,
>> > > but I'm wondering if there's any way, in C++ (MFC or ATL), that I can
>> turn
>> > > my instance of the control into a string that the VB code can use to
>get
>> > > that instance. Currently, I'm using MFC, and have imported the OCX.
>So,
>> > > ClassWizard has created a bunch of wrapper code for the OCX
>controls...
>> > but
>> > > I can't really modify that code, since I have no guarantee that
>> > ClassWizard
>> > > won't overwrite it again.

>> > > Any thought, ideas, shots in the dark...?

>> > > Thanks,
>> > > Jeff
>> > > --
>> > > Jeffrey T. Muller
>> > > Genetic MicroSystems, Inc.

>> > > http://www.geneticmicro.com



Sat, 08 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB
Ah! Alexander, thanks for this info! At least it's good to know I'm not
crazy (well, maybe I am, just not for the same reasons ;-).

By defaunt, when an ActiveX control is "dropped" on an MFC dialog, the
wizard wraps it in a "simple" CWnd, and adds the appropriate method wrappers
that call InvokeHelper() -- so there's not much additional functionality I
can "add". If the controls are "added" to the project from the type library,
the wizard wraps it in COleDispatchDriver. In this case, is it possible to
override/extend that class to provide the additional functionality? How?

tanx
--
Jeffrey T. Muller
Genetic MicroSystems, Inc.

http://www.geneticmicro.com

Quote:
> Yes, that's it, but it slipped off my mind for a while :(...

> It is not VB specific - it is called extended control. There are some
> standard dispids for extended properties and 'Name' is probably
> one of them. The extended control is an object provided by the
> container which blindly aggregates the control and only overrides
> IDispatch and adds some 'extended' properties like its position
> on the form, etc. which are not specific for any control. When
> you get a pointer to the control on the form, you actually have
> pointer to the extended control. The MFC extended control
> probably doesn't expose this property, hence the things don't
> work... BTW, the extended control is optional in the ActiveX
> Controls specification (for the containers), so the control MUST
> NOT EXPECT IT!!! It is the VB controls which are poorly written,
> not MFC!

> --
> ===============================
> Alexander Nickolov, MCP
> Panasonic Technologies Inc.
> Speech Technology Laboratory

> ===============================



Sun, 09 Dec 2001 03:00:00 GMT  
 Object "name" in C++ vs VB
I'm not your regular MFC expert :)... but you may try posting at
microsoft.public.vc.mfcole. As for the extended control - if it exists,
it is deep in the MFC implementation of control hosting. You have
no access there (I suppose). Or I may be wrong...

--
===============================
Alexander Nickolov, MCP
Panasonic Technologies Inc.
Speech Technology Laboratory

===============================

Quote:

>Ah! Alexander, thanks for this info! At least it's good to know I'm not
>crazy (well, maybe I am, just not for the same reasons ;-).

>By defaunt, when an ActiveX control is "dropped" on an MFC dialog, the
>wizard wraps it in a "simple" CWnd, and adds the appropriate method
wrappers
>that call InvokeHelper() -- so there's not much additional functionality I
>can "add". If the controls are "added" to the project from the type
library,
>the wizard wraps it in COleDispatchDriver. In this case, is it possible to
>override/extend that class to provide the additional functionality? How?

>tanx
>--
>Jeffrey T. Muller
>Genetic MicroSystems, Inc.

>http://www.geneticmicro.com


>> Yes, that's it, but it slipped off my mind for a while :(...

>> It is not VB specific - it is called extended control. There are some
>> standard dispids for extended properties and 'Name' is probably
>> one of them. The extended control is an object provided by the
>> container which blindly aggregates the control and only overrides
>> IDispatch and adds some 'extended' properties like its position
>> on the form, etc. which are not specific for any control. When
>> you get a pointer to the control on the form, you actually have
>> pointer to the extended control. The MFC extended control
>> probably doesn't expose this property, hence the things don't
>> work... BTW, the extended control is optional in the ActiveX
>> Controls specification (for the containers), so the control MUST
>> NOT EXPECT IT!!! It is the VB controls which are poorly written,
>> not MFC!

>> --
>> ===============================
>> Alexander Nickolov, MCP
>> Panasonic Technologies Inc.
>> Speech Technology Laboratory

>> ===============================



Sun, 09 Dec 2001 03:00:00 GMT  
 
 [ 15 post ] 

 Relevant Pages 

1. interesting statement: name = (name)?name:"";

2. VB accessing a "C++ DLL"

3. C# vs "old compilers" (Delphi/C++)

4. #define "name.h" "NAME.H"

5. is this allowed char *name = "bryan"

6. getting #define value from its "name"

7. MASM vs TASM vs VC++ vs DJGPP vs A*^ vs PCC vs DEBUG,, "Hello World!"

8. "illegal qualified name in member declaration"??

9. Calling class by "name"

10. pointer type names (a "new" style)

11. Systems imagelist and drives "given" names

12. Getting the "Active Project" Name

 

 
Powered by phpBB® Forum Software