Home All Groups Group Topic Archive Search About

VB6 User Control next problem

Author
15 Feb 2007 9:56 PM
Darhl Thomason
I used the ActiveX Control Interface Wizard as Ken H suggested in a previous
post.

This time, I want to expose the DataFormat and DataSource (and DataField but
that's an Extender object and I think I can figure it out).  When I try to
run the user control, it tells me that a User Defined Type is not defined.
My code for DataFormat is below with the "error line" noted.

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=txtDatePicker,txtDatePicker,-1,DataFormat
<note - this is the line that errors>
Public Property Get DataFormat() As IStdDataFormatDisp
</note>
  Set DataFormat = txtDatePicker.DataFormat
End Property
Public Property Set DataFormat(ByVal New_DataFormat As IStdDataFormatDisp)
  Set txtDatePicker.DataFormat = New_DataFormat
  PropertyChanged "DataFormat"
End Property

If I comment all this out, I get the same error on the same line (adjusted
for the new property, of course) with the DataSource property.

Any ideas?

d

Author
15 Feb 2007 10:49 PM
Henning
Show quote Hide quote
"Darhl Thomason" <darhlt@papamurphys.nospamplease.com> skrev i meddelandet
news:%23y6kwwUUHHA.5068@TK2MSFTNGP03.phx.gbl...
> I used the ActiveX Control Interface Wizard as Ken H suggested in a
previous
> post.
>
> This time, I want to expose the DataFormat and DataSource (and DataField
but
> that's an Extender object and I think I can figure it out).  When I try to
> run the user control, it tells me that a User Defined Type is not defined.
> My code for DataFormat is below with the "error line" noted.
>
> 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
> 'MappingInfo=txtDatePicker,txtDatePicker,-1,DataFormat
> <note - this is the line that errors>
> Public Property Get DataFormat() As IStdDataFormatDisp
> </note>
>   Set DataFormat = txtDatePicker.DataFormat
> End Property
> Public Property Set DataFormat(ByVal New_DataFormat As IStdDataFormatDisp)
>   Set txtDatePicker.DataFormat = New_DataFormat
>   PropertyChanged "DataFormat"
> End Property
>
> If I comment all this out, I get the same error on the same line (adjusted
> for the new property, of course) with the DataSource property.
>
> Any ideas?
>
> d
>
A blind shot from not knowing, is txtDatePicker within scope for accessing?

/Henning
Author
16 Feb 2007 12:32 AM
Darhl Thomason
"Henning" <computer_h***@coldmail.com> wrote in message
news:45d4e307$0$36417$57c3e1d3@news3.bahnhof.se...
>
> A blind shot from not knowing, is txtDatePicker within scope for
> accessing?
>
> /Henning
>
Yes it is.  I can access other properties (like TEXT) from txtDatePicker so
I know that part is working.

d
Author
16 Feb 2007 2:27 AM
Henning
Show quote Hide quote
"Darhl Thomason" <darhlt@papamurphys.nospamplease.com> skrev i meddelandet
news:ubkF7HWUHHA.5108@TK2MSFTNGP06.phx.gbl...
>
> "Henning" <computer_h***@coldmail.com> wrote in message
> news:45d4e307$0$36417$57c3e1d3@news3.bahnhof.se...
> >
> > A blind shot from not knowing, is txtDatePicker within scope for
> > accessing?
> >
> > /Henning
> >
> Yes it is.  I can access other properties (like TEXT) from txtDatePicker
so
> I know that part is working.
>
> d
>
>Then as I see it, there is just IStdDataFormatDisp left. Is this also in
scope? Else I don't know if it dislikes the DataFormat as the name, it's
also a property of the DTPicker.


/Henning
Author
16 Feb 2007 6:49 PM
Darhl Thomason
"Henning" <computer_h***@coldmail.com> wrote in message
news:45d5161f$0$36418$57c3e1d3@news3.bahnhof.se...
>
>Then as I see it, there is just IStdDataFormatDisp left. Is this also in
> scope? Else I don't know if it dislikes the DataFormat as the name, it's
> also a property of the DTPicker.
>
>
> /Henning
>
I don't know how to tell if it's "in scope" or not.  But I'm getting the
same error when I try to expose DataSource.

d
Author
16 Feb 2007 8:30 PM
Henning
Show quote Hide quote
"Darhl Thomason" <darhlt@papamurphys.nospamplease.com> skrev i meddelandet
news:O1vSqsfUHHA.1364@TK2MSFTNGP06.phx.gbl...
>
> "Henning" <computer_h***@coldmail.com> wrote in message
> news:45d5161f$0$36418$57c3e1d3@news3.bahnhof.se...
> >
> >Then as I see it, there is just IStdDataFormatDisp left. Is this also in
> > scope? Else I don't know if it dislikes the DataFormat as the name, it's
> > also a property of the DTPicker.
> >
> >
> > /Henning
> >
> I don't know how to tell if it's "in scope" or not.  But I'm getting the
> same error when I try to expose DataSource.
>
> d
>
Is IStdDataFormatDisp defined in a .bas module and not Private, or in the
same form as the Property Get?
If defined on a different form you have to access it as
WhateverForm.IStdDataFormatDisp.

/Henning
Author
1 Mar 2007 4:20 PM
Darhl Thomason
Show quote Hide quote
"Henning" <computer_h***@coldmail.com> wrote in message
news:45d61406$0$36420$57c3e1d3@news3.bahnhof.se...
>> >
>> I don't know how to tell if it's "in scope" or not.  But I'm getting the
>> same error when I try to expose DataSource.
>>
>> d
>>
> Is IStdDataFormatDisp defined in a .bas module and not Private, or in the
> same form as the Property Get?
> If defined on a different form you have to access it as
> WhateverForm.IStdDataFormatDisp.
>
> /Henning
>
>
Sorry for the late reply, I've been traveling for the last couple of weeks
and didn't have time to check the NG.

IStdDataFormatDisp is not defined in a .bas module, I'd have to say I didn't
know I needed to do that.  I assumed (and you know what happens when you
assume) that since I was enabling via the wizard it would take care of what
needed to be done.

So I'll definitely need more explicit help on this i.e. how exactly to
define IStdDataFormatDisp and how to "use" it in my user control.

Thanks!

d