473,791 Members | 2,881 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Type 'TypeName' has no constructors

Hi, if anyone can help on this, please! This is driving me crazy.

I have a user control hierarchy several levels deep that derive for
UserControl (windows).

The class that is at the top level, has the following constructor (generated
by VS.NET)
Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeCompo nent()
'Add any initialization after the InitializeCompo nent() call

End Sub

Sometimes (about half the time), when I recompile my solution (which
contains a project with this class, and a project with a form tester trying
out this user control), I get the error I put in the subject of this post.

Now, clearly, this class has a constructor.
If I change the code by removing the word 'Public', and recompile everything
is great.

Next time I need to recompile, I get this error again. In this case, I just
put the word 'Public' back in, and recompile - all is well again.

So I spend half my time removing 'Public' and then adding it back in - just
to get the compiler to change its mind.

Now, it doesn't do this all the time. Sometimes it recompiles OK.

I've checked the project build order - and the project with the user control
is compiled first.

I've tried manually compiling the first project - and then the second. And
the second always fails, because it thinks there is no constructor available
for the user control. Until that is, I take away or remove the 'Public'
keyword off of the constructor - in which case its fine.

Is this some ridiculous VB compiler problem? Some VS.NET bug. Anything I can
do about it?

Thanks
Jul 21 '05
18 1457
As you can see in my response to Jay, rebuilding the solution helps. I am
still mystified as to why this happens at all, and why this particular error
in this particular case.

In any case, thanks for taking an interest and trying to help.

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:es******** ******@TK2MSFTN GP12.phx.gbl...
Hi Marina,

I can not reproduce it, can you tell me what I have to add to the method?

After you answered the question from Jay of course.

However you will see my next answer not for tomorrow probably, so do not
count to much on that.

Cor

Jul 21 '05 #11
This is VS.NET 2003.

I am referencing the generated DLL.

Oddly enough - chosing rebuild solution does work.

I've gotten used to doing just a build (ctl + shift + b), and I've doing
that for probably 3 years and haven't had a problem yet. I guess I'll have
to reassign that to the rebuild command...

Do you have any idea why rebuilding the solution helps?

Or better yet, why does this happen at all?

Thanks

"Jay B. Harlow [MVP - Outlook]" <Ja************ @msn.com> wrote in message
news:%2******** *********@TK2MS FTNGP11.phx.gbl ...
Marina,
VS.NET 2002 or VS.NET 2003?

Are you referencing the Project or the generated DLL?

Does 'Build - Rebuild Solution' take care of the problem? (instead of
modifing the source file).

Hope this helps
Jay

"Marina" <so*****@nospam .com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Ok, here is the reproduceable code (at least over here). The controls are
in
one project, Form1.vb is in a separate project (one solution).

The key is, there has to be a change in the controls dll (such as adding a Protected method to BaseInputContro l.vb), that will trigger this. Not all changes cause this behavior - so it doesn't happen with every change - but very frequently.

BaseInputContro l.vb:

Imports System.Componen tModel
Imports System.Componen tModel.Design
Imports System.Drawing. Design
Public Class BaseInputContro l
Inherits UserControl
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeCompo nent()
'Add any initialization after the InitializeCompo nent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Protected WithEvents inputCtl As System.Windows. Forms.TextBox
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub

InitializeCompo nent()
Me.inputCtl = New System.Windows. Forms.TextBox
Me.SuspendLayou t()
'
'inputCtl
'
Me.inputCtl.Loc ation = New System.Drawing. Point(0, 0)
Me.inputCtl.Nam e = "inputCtl"
Me.inputCtl.Siz e = New System.Drawing. Size(89, 20)
Me.inputCtl.Tab Index = 0
Me.inputCtl.Tex t = ""
'
'BaseInputContr ol
'
Me.Controls.Add (Me.inputCtl)
Me.Name = "BaseInputContr ol"
Me.Size = New System.Drawing. Size(89, 20)
Me.ResumeLayout (False)
End Sub
#End Region
Private s As String
Protected Sub AdjustBackgroun dColor()
End Sub
End Class

BaseFormInputCo ntrol.vb:
Imports System.Componen tModel
Imports System.Componen tModel.Design
Imports System.Drawing. Design
Public Class BaseFormInputCo ntrol
Inherits BaseInputContro l
#Region " Windows Form Designer generated code "
'UserControl overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub

InitializeCompo nent()
'
'inputCtl
'
Me.inputCtl.Acc eptsReturn = True
Me.inputCtl.Nam e = "inputCtl"
'
'BaseFormInputC ontrol
'
Me.Name = "BaseFormInputC ontrol"
End Sub
#End Region
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeCompo nent()
'Add any initialization after the InitializeCompo nent() call
End Sub
Public Sub test()
End Sub
Private Sub inputCtl_Valida ting(ByVal sender As Object, ByVal e As
System.EventArg s) Handles inputCtl.Valida ted
AdjustBackgroun dColor()
End Sub
End Class
Form1.vb:
Public Class Form1
Inherits System.Windows. Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeCompo nent()
'Add any initialization after the InitializeCompo nent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents BaseFormInputCo ntrol1 As
TestControlLibr ary.BaseFormInp utControl
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub

InitializeCompo nent()
Me.BaseFormInpu tControl1 = New TestControlLibr ary.BaseFormInp utControl
Me.SuspendLayou t()
'
'BaseFormInputC ontrol1
'
Me.BaseFormInpu tControl1.Locat ion = New System.Drawing. Point(192, 80)
Me.BaseFormInpu tControl1.Name = "BaseFormInputC ontrol1"
Me.BaseFormInpu tControl1.Size = New System.Drawing. Size(89, 20)
Me.BaseFormInpu tControl1.TabIn dex = 0
'
'Form1
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(448, 266)
Me.Controls.Add (Me.BaseFormInp utControl1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout (False)
End Sub
#End Region
End Class
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:OJ******** ******@TK2MSFTN GP10.phx.gbl...
My apologies. I did misread the post.

Wow...

Wierd question, but how many projects are in your solution... I ran into some weird compiler errors when I had a lot of projects. I'm just pulling straws right now I hope you know.. just trying to help.

-CJ

"Marina" <so*****@nospam .com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
> I don't think you carefully read my post, but just skimmed for some key > words.
>
> The constructor was declared public. And that caused an error. Taking away
> 'Public' would then compile fine.
>
> Next time I made a change, it woudln't compile again. So I would put the > 'Public' back in. Then it was fine again.
>
> The point being, that I kept needing to add and remove the word 'Public' > every other change in order to get the project to compile.
>
> In fact, I believe that the default for a constructor is 'Public', else > taking 'Public' away, would never have compiled the tester application,
as
> then it definitely would not have had a constructor.
>
> So again, the question is, why is the compiler complaining constantly about
> not finding a constructor, making me place and remove the word

'Public' > every other compile time, in order to make it work?
>
> Note: There may be other ways that work in getting the compiler to work > other then this trick with 'Public', I don't know. I just found an easy one.
>
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
> > If you don't put an accessor on there doesn't it default it to Friend? In
> > which case doesn't your project B (second compiled) need to be in the same
> > namespace in order for that to work?
> >
> > So therefore you contructor must be declared public or it doesn't

think
> that
> > a constructor is avalible for it to use.
> >
> > Someone correct me if I'm wrong.
> >
> >
> > "Marina" <so*****@nospam .com> wrote in message
> > news:uz******** ******@TK2MSFTN GP11.phx.gbl...
> > > Hi, if anyone can help on this, please! This is driving me crazy. > > >
> > > I have a user control hierarchy several levels deep that derive for > > > UserControl (windows).
> > >
> > > The class that is at the top level, has the following constructor > > (generated
> > > by VS.NET)
> > > Public Sub New()
> > > MyBase.New()
> > >
> > > 'This call is required by the Windows Form Designer.
> > > InitializeCompo nent()
> > > 'Add any initialization after the InitializeCompo nent() call > > >
> > > End Sub
> > >
> > > Sometimes (about half the time), when I recompile my solution (which > > > contains a project with this class, and a project with a form tester > > trying
> > > out this user control), I get the error I put in the subject of this > post.
> > >
> > > Now, clearly, this class has a constructor.
> > > If I change the code by removing the word 'Public', and recompile > > everything
> > > is great.
> > >
> > > Next time I need to recompile, I get this error again. In this

case,
I
> > just
> > > put the word 'Public' back in, and recompile - all is well again. > > >
> > > So I spend half my time removing 'Public' and then adding it back in -
> > just
> > > to get the compiler to change its mind.
> > >
> > > Now, it doesn't do this all the time. Sometimes it recompiles
OK. > > >
> > > I've checked the project build order - and the project with the

user > > control
> > > is compiled first.
> > >
> > > I've tried manually compiling the first project - and then the

second.
> And
> > > the second always fails, because it thinks there is no constructor > > available
> > > for the user control. Until that is, I take away or remove the
'Public'
> > > keyword off of the constructor - in which case its fine.
> > >
> > > Is this some ridiculous VB compiler problem? Some VS.NET bug.

Anything
I
> > can
> > > do about it?
> > >
> > > Thanks
> > >
> > >
> >
> >
>
>



Jul 21 '05 #12
"Marina" <so*****@nospam .com> schrieb
Well, just try adding a new method to BaseInputContro l that is
protected - doing that usually does the trick for me.


When I do it, I get an error in BaseInputContro l:

"TestControlLib rary.BaseInputC ontrol.Private Sub InitializeCompo nent()" is
not accesible in this context because it is "private".

I think the error is not ok. When I rebuild, the error disappears.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Jul 21 '05 #13
Marina,
I normally reference the project itself, not the DLL. My understanding is
referencing the project enables VS.NET to better determine dependencies.
Or better yet, why does this happen at all? I believe it happens because the background compilation gets confused.

http://www.panopticoncentral.net/arc...03/07/284.aspx
http://www.panopticoncentral.net/arc...03/19/291.aspx
Do you have any idea why rebuilding the solution helps? My theory is the background compilation gets confused, and the Build Rebuild
Solution throws every thing out & does a 100% clean compile, however that is
just my theory.

I know VS.NET 2002 had more problems with then VS.NET 2003 does, at least on
the multi-project solutions that I have worked on.

Hope this helps
Jay
"Marina" <so*****@nospam .com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. This is VS.NET 2003.

I am referencing the generated DLL.

Oddly enough - chosing rebuild solution does work.

I've gotten used to doing just a build (ctl + shift + b), and I've doing
that for probably 3 years and haven't had a problem yet. I guess I'll have
to reassign that to the rebuild command...

Do you have any idea why rebuilding the solution helps?

Or better yet, why does this happen at all?

Thanks

"Jay B. Harlow [MVP - Outlook]" <Ja************ @msn.com> wrote in message
news:%2******** *********@TK2MS FTNGP11.phx.gbl ...
Marina,
VS.NET 2002 or VS.NET 2003?

Are you referencing the Project or the generated DLL?

Does 'Build - Rebuild Solution' take care of the problem? (instead of
modifing the source file).

Hope this helps
Jay

"Marina" <so*****@nospam .com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Ok, here is the reproduceable code (at least over here). The controls are
in
one project, Form1.vb is in a separate project (one solution).

The key is, there has to be a change in the controls dll (such as adding
a Protected method to BaseInputContro l.vb), that will trigger this. Not all changes cause this behavior - so it doesn't happen with every change - but very frequently.

BaseInputContro l.vb:

Imports System.Componen tModel
Imports System.Componen tModel.Design
Imports System.Drawing. Design
Public Class BaseInputContro l
Inherits UserControl
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeCompo nent()
'Add any initialization after the InitializeCompo nent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er
'NOTE: The following procedure is required by the Windows Form
Designer 'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Protected WithEvents inputCtl As System.Windows. Forms.TextBox
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub

InitializeCompo nent()
Me.inputCtl = New System.Windows. Forms.TextBox
Me.SuspendLayou t()
'
'inputCtl
'
Me.inputCtl.Loc ation = New System.Drawing. Point(0, 0)
Me.inputCtl.Nam e = "inputCtl"
Me.inputCtl.Siz e = New System.Drawing. Size(89, 20)
Me.inputCtl.Tab Index = 0
Me.inputCtl.Tex t = ""
'
'BaseInputContr ol
'
Me.Controls.Add (Me.inputCtl)
Me.Name = "BaseInputContr ol"
Me.Size = New System.Drawing. Size(89, 20)
Me.ResumeLayout (False)
End Sub
#End Region
Private s As String
Protected Sub AdjustBackgroun dColor()
End Sub
End Class

BaseFormInputCo ntrol.vb:
Imports System.Componen tModel
Imports System.Componen tModel.Design
Imports System.Drawing. Design
Public Class BaseFormInputCo ntrol
Inherits BaseInputContro l
#Region " Windows Form Designer generated code "
'UserControl overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er
'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub

InitializeCompo nent()
'
'inputCtl
'
Me.inputCtl.Acc eptsReturn = True
Me.inputCtl.Nam e = "inputCtl"
'
'BaseFormInputC ontrol
'
Me.Name = "BaseFormInputC ontrol"
End Sub
#End Region
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeCompo nent()
'Add any initialization after the InitializeCompo nent() call
End Sub
Public Sub test()
End Sub
Private Sub inputCtl_Valida ting(ByVal sender As Object, ByVal e As
System.EventArg s) Handles inputCtl.Valida ted
AdjustBackgroun dColor()
End Sub
End Class
Form1.vb:
Public Class Form1
Inherits System.Windows. Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeCompo nent()
'Add any initialization after the InitializeCompo nent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er
'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents BaseFormInputCo ntrol1 As
TestControlLibr ary.BaseFormInp utControl
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub

InitializeCompo nent()
Me.BaseFormInpu tControl1 = New TestControlLibr ary.BaseFormInp utControl
Me.SuspendLayou t()
'
'BaseFormInputC ontrol1
'
Me.BaseFormInpu tControl1.Locat ion = New System.Drawing. Point(192, 80)
Me.BaseFormInpu tControl1.Name = "BaseFormInputC ontrol1"
Me.BaseFormInpu tControl1.Size = New System.Drawing. Size(89, 20)
Me.BaseFormInpu tControl1.TabIn dex = 0
'
'Form1
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(448, 266)
Me.Controls.Add (Me.BaseFormInp utControl1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout (False)
End Sub
#End Region
End Class
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:OJ******** ******@TK2MSFTN GP10.phx.gbl...
> My apologies. I did misread the post.
>
> Wow...
>
> Wierd question, but how many projects are in your solution... I ran into > some weird compiler errors when I had a lot of projects. I'm just

pulling
> straws right now I hope you know.. just trying to help.
>
> -CJ
>
> "Marina" <so*****@nospam .com> wrote in message
> news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
> > I don't think you carefully read my post, but just skimmed for some key
> > words.
> >
> > The constructor was declared public. And that caused an error. Taking > away
> > 'Public' would then compile fine.
> >
> > Next time I made a change, it woudln't compile again. So I would
put
the
> > 'Public' back in. Then it was fine again.
> >
> > The point being, that I kept needing to add and remove the word

'Public'
> > every other change in order to get the project to compile.
> >
> > In fact, I believe that the default for a constructor is 'Public',

else
> > taking 'Public' away, would never have compiled the tester

application,
as
> > then it definitely would not have had a constructor.
> >
> > So again, the question is, why is the compiler complaining constantly > about
> > not finding a constructor, making me place and remove the word

'Public'
> > every other compile time, in order to make it work?
> >
> > Note: There may be other ways that work in getting the compiler to

work
> > other then this trick with 'Public', I don't know. I just found an

easy
> one.
> >
> > "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> > news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
> > > If you don't put an accessor on there doesn't it default it to

Friend?
> In
> > > which case doesn't your project B (second compiled) need to be
in the
> same
> > > namespace in order for that to work?
> > >
> > > So therefore you contructor must be declared public or it
doesn't think
> > that
> > > a constructor is avalible for it to use.
> > >
> > > Someone correct me if I'm wrong.
> > >
> > >
> > > "Marina" <so*****@nospam .com> wrote in message
> > > news:uz******** ******@TK2MSFTN GP11.phx.gbl...
> > > > Hi, if anyone can help on this, please! This is driving me

crazy. > > > >
> > > > I have a user control hierarchy several levels deep that derive for
> > > > UserControl (windows).
> > > >
> > > > The class that is at the top level, has the following constructor > > > (generated
> > > > by VS.NET)
> > > > Public Sub New()
> > > > MyBase.New()
> > > >
> > > > 'This call is required by the Windows Form Designer.
> > > > InitializeCompo nent()
> > > > 'Add any initialization after the
InitializeCompo nent()
call
> > > >
> > > > End Sub
> > > >
> > > > Sometimes (about half the time), when I recompile my solution

(which
> > > > contains a project with this class, and a project with a form

tester
> > > trying
> > > > out this user control), I get the error I put in the subject
of this
> > post.
> > > >
> > > > Now, clearly, this class has a constructor.
> > > > If I change the code by removing the word 'Public', and recompile > > > everything
> > > > is great.
> > > >
> > > > Next time I need to recompile, I get this error again. In
this case,
> I
> > > just
> > > > put the word 'Public' back in, and recompile - all is well

again. > > > >
> > > > So I spend half my time removing 'Public' and then adding it back in -
> > > just
> > > > to get the compiler to change its mind.
> > > >
> > > > Now, it doesn't do this all the time. Sometimes it recompiles OK. > > > >
> > > > I've checked the project build order - and the project with the user
> > > control
> > > > is compiled first.
> > > >
> > > > I've tried manually compiling the first project - and then the
second.
> > And
> > > > the second always fails, because it thinks there is no constructor > > > available
> > > > for the user control. Until that is, I take away or remove

the > 'Public'
> > > > keyword off of the constructor - in which case its fine.
> > > >
> > > > Is this some ridiculous VB compiler problem? Some VS.NET bug.
Anything
> I
> > > can
> > > > do about it?
> > > >
> > > > Thanks
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Jul 21 '05 #14

"Jay B. Harlow [MVP - Outlook]" <Ja************ @msn.com> wrote in message
news:O6******** ******@TK2MSFTN GP10.phx.gbl...
Marina,
I normally reference the project itself, not the DLL. My understanding is
referencing the project enables VS.NET to better determine dependencies.
Or better yet, why does this happen at all? I believe it happens because the background compilation gets confused.

http://www.panopticoncentral.net/arc...03/07/284.aspx
http://www.panopticoncentral.net/arc...03/19/291.aspx
Do you have any idea why rebuilding the solution helps?

My theory is the background compilation gets confused, and the Build

Rebuild Solution throws every thing out & does a 100% clean compile, however that is just my theory.

I'd agree with that theory. I would compare it to make clean;
=0

I know VS.NET 2002 had more problems with then VS.NET 2003 does, at least on the multi-project solutions that I have worked on.

I too saw more problems in VS 2002

Hope this helps
Jay
"Marina" <so*****@nospam .com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
This is VS.NET 2003.

I am referencing the generated DLL.

Oddly enough - chosing rebuild solution does work.

I've gotten used to doing just a build (ctl + shift + b), and I've doing
that for probably 3 years and haven't had a problem yet. I guess I'll have
to reassign that to the rebuild command...

Do you have any idea why rebuilding the solution helps?

Or better yet, why does this happen at all?

Thanks

"Jay B. Harlow [MVP - Outlook]" <Ja************ @msn.com> wrote in message news:%2******** *********@TK2MS FTNGP11.phx.gbl ...
Marina,
VS.NET 2002 or VS.NET 2003?

Are you referencing the Project or the generated DLL?

Does 'Build - Rebuild Solution' take care of the problem? (instead of
modifing the source file).

Hope this helps
Jay

"Marina" <so*****@nospam .com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> Ok, here is the reproduceable code (at least over here). The controls
are
in
> one project, Form1.vb is in a separate project (one solution).
>
> The key is, there has to be a change in the controls dll (such as adding
a
> Protected method to BaseInputContro l.vb), that will trigger this.

Not all
> changes cause this behavior - so it doesn't happen with every
change - but
> very frequently.
>
> BaseInputContro l.vb:
>
> Imports System.Componen tModel
> Imports System.Componen tModel.Design
> Imports System.Drawing. Design
> Public Class BaseInputContro l
> Inherits UserControl
> #Region " Windows Form Designer generated code "
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeCompo nent()
> 'Add any initialization after the InitializeCompo nent() call
> End Sub
> 'Form overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean) > If disposing Then
> If Not (components Is Nothing) Then
> components.Disp ose()
> End If
> End If
> MyBase.Dispose( disposing)
> End Sub
> 'Required by the Windows Form Designer
> Private components As System.Componen tModel.IContain er
> 'NOTE: The following procedure is required by the Windows Form

Designer > 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> Protected WithEvents inputCtl As System.Windows. Forms.TextBox
> <System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
> Me.inputCtl = New System.Windows. Forms.TextBox
> Me.SuspendLayou t()
> '
> 'inputCtl
> '
> Me.inputCtl.Loc ation = New System.Drawing. Point(0, 0)
> Me.inputCtl.Nam e = "inputCtl"
> Me.inputCtl.Siz e = New System.Drawing. Size(89, 20)
> Me.inputCtl.Tab Index = 0
> Me.inputCtl.Tex t = ""
> '
> 'BaseInputContr ol
> '
> Me.Controls.Add (Me.inputCtl)
> Me.Name = "BaseInputContr ol"
> Me.Size = New System.Drawing. Size(89, 20)
> Me.ResumeLayout (False)
> End Sub
> #End Region
> Private s As String
> Protected Sub AdjustBackgroun dColor()
> End Sub
> End Class
>
> BaseFormInputCo ntrol.vb:
> Imports System.Componen tModel
> Imports System.Componen tModel.Design
> Imports System.Drawing. Design
> Public Class BaseFormInputCo ntrol
> Inherits BaseInputContro l
> #Region " Windows Form Designer generated code "
> 'UserControl overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) > If disposing Then
> If Not (components Is Nothing) Then
> components.Disp ose()
> End If
> End If
> MyBase.Dispose( disposing)
> End Sub
> 'Required by the Windows Form Designer
> Private components As System.Componen tModel.IContain er
> 'NOTE: The following procedure is required by the Windows Form Designer > 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> <System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
> '
> 'inputCtl
> '
> Me.inputCtl.Acc eptsReturn = True
> Me.inputCtl.Nam e = "inputCtl"
> '
> 'BaseFormInputC ontrol
> '
> Me.Name = "BaseFormInputC ontrol"
> End Sub
> #End Region
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeCompo nent()
> 'Add any initialization after the InitializeCompo nent() call
> End Sub
> Public Sub test()
> End Sub
> Private Sub inputCtl_Valida ting(ByVal sender As Object, ByVal e As
> System.EventArg s) Handles inputCtl.Valida ted
> AdjustBackgroun dColor()
> End Sub
> End Class
> Form1.vb:
> Public Class Form1
> Inherits System.Windows. Forms.Form
> #Region " Windows Form Designer generated code "
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeCompo nent()
> 'Add any initialization after the InitializeCompo nent() call
> End Sub
> 'Form overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) > If disposing Then
> If Not (components Is Nothing) Then
> components.Disp ose()
> End If
> End If
> MyBase.Dispose( disposing)
> End Sub
> 'Required by the Windows Form Designer
> Private components As System.Componen tModel.IContain er
> 'NOTE: The following procedure is required by the Windows Form Designer > 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> Friend WithEvents BaseFormInputCo ntrol1 As
> TestControlLibr ary.BaseFormInp utControl
> <System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
> Me.BaseFormInpu tControl1 = New TestControlLibr ary.BaseFormInp utControl > Me.SuspendLayou t()
> '
> 'BaseFormInputC ontrol1
> '
> Me.BaseFormInpu tControl1.Locat ion = New System.Drawing. Point(192, 80) > Me.BaseFormInpu tControl1.Name = "BaseFormInputC ontrol1"
> Me.BaseFormInpu tControl1.Size = New System.Drawing. Size(89, 20)
> Me.BaseFormInpu tControl1.TabIn dex = 0
> '
> 'Form1
> '
> Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
> Me.ClientSize = New System.Drawing. Size(448, 266)
> Me.Controls.Add (Me.BaseFormInp utControl1)
> Me.Name = "Form1"
> Me.Text = "Form1"
> Me.ResumeLayout (False)
> End Sub
> #End Region
> End Class
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:OJ******** ******@TK2MSFTN GP10.phx.gbl...
> > My apologies. I did misread the post.
> >
> > Wow...
> >
> > Wierd question, but how many projects are in your solution... I ran into
> > some weird compiler errors when I had a lot of projects. I'm just
pulling
> > straws right now I hope you know.. just trying to help.
> >
> > -CJ
> >
> > "Marina" <so*****@nospam .com> wrote in message
> > news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
> > > I don't think you carefully read my post, but just skimmed for some key
> > > words.
> > >
> > > The constructor was declared public. And that caused an error.

Taking
> > away
> > > 'Public' would then compile fine.
> > >
> > > Next time I made a change, it woudln't compile again. So I would put the
> > > 'Public' back in. Then it was fine again.
> > >
> > > The point being, that I kept needing to add and remove the word
'Public'
> > > every other change in order to get the project to compile.
> > >
> > > In fact, I believe that the default for a constructor is
'Public', else
> > > taking 'Public' away, would never have compiled the tester
application,
> as
> > > then it definitely would not have had a constructor.
> > >
> > > So again, the question is, why is the compiler complaining

constantly
> > about
> > > not finding a constructor, making me place and remove the word
'Public'
> > > every other compile time, in order to make it work?
> > >
> > > Note: There may be other ways that work in getting the compiler to work
> > > other then this trick with 'Public', I don't know. I just found an easy
> > one.
> > >
> > > "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> > > news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
> > > > If you don't put an accessor on there doesn't it default it to
Friend?
> > In
> > > > which case doesn't your project B (second compiled) need to be in the
> > same
> > > > namespace in order for that to work?
> > > >
> > > > So therefore you contructor must be declared public or it doesn't > think
> > > that
> > > > a constructor is avalible for it to use.
> > > >
> > > > Someone correct me if I'm wrong.
> > > >
> > > >
> > > > "Marina" <so*****@nospam .com> wrote in message
> > > > news:uz******** ******@TK2MSFTN GP11.phx.gbl...
> > > > > Hi, if anyone can help on this, please! This is driving me

crazy.
> > > > >
> > > > > I have a user control hierarchy several levels deep that derive for
> > > > > UserControl (windows).
> > > > >
> > > > > The class that is at the top level, has the following

constructor
> > > > (generated
> > > > > by VS.NET)
> > > > > Public Sub New()
> > > > > MyBase.New()
> > > > >
> > > > > 'This call is required by the Windows Form Designer.
> > > > > InitializeCompo nent()
> > > > > 'Add any initialization after the InitializeCompo nent() call
> > > > >
> > > > > End Sub
> > > > >
> > > > > Sometimes (about half the time), when I recompile my solution (which
> > > > > contains a project with this class, and a project with a form tester
> > > > trying
> > > > > out this user control), I get the error I put in the subject of this
> > > post.
> > > > >
> > > > > Now, clearly, this class has a constructor.
> > > > > If I change the code by removing the word 'Public', and

recompile
> > > > everything
> > > > > is great.
> > > > >
> > > > > Next time I need to recompile, I get this error again. In this > case,
> > I
> > > > just
> > > > > put the word 'Public' back in, and recompile - all is well

again.
> > > > >
> > > > > So I spend half my time removing 'Public' and then adding it

back
> in -
> > > > just
> > > > > to get the compiler to change its mind.
> > > > >
> > > > > Now, it doesn't do this all the time. Sometimes it recompiles OK.
> > > > >
> > > > > I've checked the project build order - and the project with the user
> > > > control
> > > > > is compiled first.
> > > > >
> > > > > I've tried manually compiling the first project - and then
the > second.
> > > And
> > > > > the second always fails, because it thinks there is no

constructor
> > > > available
> > > > > for the user control. Until that is, I take away or remove

the > > 'Public'
> > > > > keyword off of the constructor - in which case its fine.
> > > > >
> > > > > Is this some ridiculous VB compiler problem? Some VS.NET bug. > Anything
> > I
> > > > can
> > > > > do about it?
> > > > >
> > > > > Thanks
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Jul 21 '05 #15
Thanks for quoting the whole code! Now I got it 5 times. :-(
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Jul 21 '05 #16
Sorry.

=)

"Armin Zingler" <az*******@free net.de> wrote in message
news:40******** *************** @news.freenet.d e...
Thanks for quoting the whole code! Now I got it 5 times. :-(
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Jul 21 '05 #17
Ok, thanks to everyone who took time to look at this.

I guess that 'background compilation' gets confused is about the best answer
as to why 'building' the solution doesn't work but 'rebuilding' it does.

Thanks

"Jay B. Harlow [MVP - Outlook]" <Ja************ @msn.com> wrote in message
news:O6******** ******@TK2MSFTN GP10.phx.gbl...
Marina,
I normally reference the project itself, not the DLL. My understanding is
referencing the project enables VS.NET to better determine dependencies.
Or better yet, why does this happen at all? I believe it happens because the background compilation gets confused.

http://www.panopticoncentral.net/arc...03/07/284.aspx
http://www.panopticoncentral.net/arc...03/19/291.aspx
Do you have any idea why rebuilding the solution helps?

My theory is the background compilation gets confused, and the Build

Rebuild Solution throws every thing out & does a 100% clean compile, however that is just my theory.

I know VS.NET 2002 had more problems with then VS.NET 2003 does, at least on the multi-project solutions that I have worked on.

Hope this helps
Jay
"Marina" <so*****@nospam .com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
This is VS.NET 2003.

I am referencing the generated DLL.

Oddly enough - chosing rebuild solution does work.

I've gotten used to doing just a build (ctl + shift + b), and I've doing
that for probably 3 years and haven't had a problem yet. I guess I'll have
to reassign that to the rebuild command...

Do you have any idea why rebuilding the solution helps?

Or better yet, why does this happen at all?

Thanks

"Jay B. Harlow [MVP - Outlook]" <Ja************ @msn.com> wrote in message news:%2******** *********@TK2MS FTNGP11.phx.gbl ...
Marina,
VS.NET 2002 or VS.NET 2003?

Are you referencing the Project or the generated DLL?

Does 'Build - Rebuild Solution' take care of the problem? (instead of
modifing the source file).

Hope this helps
Jay

"Marina" <so*****@nospam .com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> Ok, here is the reproduceable code (at least over here). The controls
are
in
> one project, Form1.vb is in a separate project (one solution).
>
> The key is, there has to be a change in the controls dll (such as adding
a
> Protected method to BaseInputContro l.vb), that will trigger this.

Not all
> changes cause this behavior - so it doesn't happen with every
change - but
> very frequently.
>
> BaseInputContro l.vb:
>
> Imports System.Componen tModel
> Imports System.Componen tModel.Design
> Imports System.Drawing. Design
> Public Class BaseInputContro l
> Inherits UserControl
> #Region " Windows Form Designer generated code "
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeCompo nent()
> 'Add any initialization after the InitializeCompo nent() call
> End Sub
> 'Form overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean) > If disposing Then
> If Not (components Is Nothing) Then
> components.Disp ose()
> End If
> End If
> MyBase.Dispose( disposing)
> End Sub
> 'Required by the Windows Form Designer
> Private components As System.Componen tModel.IContain er
> 'NOTE: The following procedure is required by the Windows Form

Designer > 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> Protected WithEvents inputCtl As System.Windows. Forms.TextBox
> <System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
> Me.inputCtl = New System.Windows. Forms.TextBox
> Me.SuspendLayou t()
> '
> 'inputCtl
> '
> Me.inputCtl.Loc ation = New System.Drawing. Point(0, 0)
> Me.inputCtl.Nam e = "inputCtl"
> Me.inputCtl.Siz e = New System.Drawing. Size(89, 20)
> Me.inputCtl.Tab Index = 0
> Me.inputCtl.Tex t = ""
> '
> 'BaseInputContr ol
> '
> Me.Controls.Add (Me.inputCtl)
> Me.Name = "BaseInputContr ol"
> Me.Size = New System.Drawing. Size(89, 20)
> Me.ResumeLayout (False)
> End Sub
> #End Region
> Private s As String
> Protected Sub AdjustBackgroun dColor()
> End Sub
> End Class
>
> BaseFormInputCo ntrol.vb:
> Imports System.Componen tModel
> Imports System.Componen tModel.Design
> Imports System.Drawing. Design
> Public Class BaseFormInputCo ntrol
> Inherits BaseInputContro l
> #Region " Windows Form Designer generated code "
> 'UserControl overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) > If disposing Then
> If Not (components Is Nothing) Then
> components.Disp ose()
> End If
> End If
> MyBase.Dispose( disposing)
> End Sub
> 'Required by the Windows Form Designer
> Private components As System.Componen tModel.IContain er
> 'NOTE: The following procedure is required by the Windows Form Designer > 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> <System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
> '
> 'inputCtl
> '
> Me.inputCtl.Acc eptsReturn = True
> Me.inputCtl.Nam e = "inputCtl"
> '
> 'BaseFormInputC ontrol
> '
> Me.Name = "BaseFormInputC ontrol"
> End Sub
> #End Region
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeCompo nent()
> 'Add any initialization after the InitializeCompo nent() call
> End Sub
> Public Sub test()
> End Sub
> Private Sub inputCtl_Valida ting(ByVal sender As Object, ByVal e As
> System.EventArg s) Handles inputCtl.Valida ted
> AdjustBackgroun dColor()
> End Sub
> End Class
> Form1.vb:
> Public Class Form1
> Inherits System.Windows. Forms.Form
> #Region " Windows Form Designer generated code "
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeCompo nent()
> 'Add any initialization after the InitializeCompo nent() call
> End Sub
> 'Form overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) > If disposing Then
> If Not (components Is Nothing) Then
> components.Disp ose()
> End If
> End If
> MyBase.Dispose( disposing)
> End Sub
> 'Required by the Windows Form Designer
> Private components As System.Componen tModel.IContain er
> 'NOTE: The following procedure is required by the Windows Form Designer > 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> Friend WithEvents BaseFormInputCo ntrol1 As
> TestControlLibr ary.BaseFormInp utControl
> <System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
> Me.BaseFormInpu tControl1 = New TestControlLibr ary.BaseFormInp utControl > Me.SuspendLayou t()
> '
> 'BaseFormInputC ontrol1
> '
> Me.BaseFormInpu tControl1.Locat ion = New System.Drawing. Point(192, 80) > Me.BaseFormInpu tControl1.Name = "BaseFormInputC ontrol1"
> Me.BaseFormInpu tControl1.Size = New System.Drawing. Size(89, 20)
> Me.BaseFormInpu tControl1.TabIn dex = 0
> '
> 'Form1
> '
> Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
> Me.ClientSize = New System.Drawing. Size(448, 266)
> Me.Controls.Add (Me.BaseFormInp utControl1)
> Me.Name = "Form1"
> Me.Text = "Form1"
> Me.ResumeLayout (False)
> End Sub
> #End Region
> End Class
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:OJ******** ******@TK2MSFTN GP10.phx.gbl...
> > My apologies. I did misread the post.
> >
> > Wow...
> >
> > Wierd question, but how many projects are in your solution... I ran into
> > some weird compiler errors when I had a lot of projects. I'm just
pulling
> > straws right now I hope you know.. just trying to help.
> >
> > -CJ
> >
> > "Marina" <so*****@nospam .com> wrote in message
> > news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
> > > I don't think you carefully read my post, but just skimmed for some key
> > > words.
> > >
> > > The constructor was declared public. And that caused an error.

Taking
> > away
> > > 'Public' would then compile fine.
> > >
> > > Next time I made a change, it woudln't compile again. So I would put the
> > > 'Public' back in. Then it was fine again.
> > >
> > > The point being, that I kept needing to add and remove the word
'Public'
> > > every other change in order to get the project to compile.
> > >
> > > In fact, I believe that the default for a constructor is
'Public', else
> > > taking 'Public' away, would never have compiled the tester
application,
> as
> > > then it definitely would not have had a constructor.
> > >
> > > So again, the question is, why is the compiler complaining

constantly
> > about
> > > not finding a constructor, making me place and remove the word
'Public'
> > > every other compile time, in order to make it work?
> > >
> > > Note: There may be other ways that work in getting the compiler to work
> > > other then this trick with 'Public', I don't know. I just found an easy
> > one.
> > >
> > > "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> > > news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
> > > > If you don't put an accessor on there doesn't it default it to
Friend?
> > In
> > > > which case doesn't your project B (second compiled) need to be in the
> > same
> > > > namespace in order for that to work?
> > > >
> > > > So therefore you contructor must be declared public or it doesn't > think
> > > that
> > > > a constructor is avalible for it to use.
> > > >
> > > > Someone correct me if I'm wrong.
> > > >
> > > >
> > > > "Marina" <so*****@nospam .com> wrote in message
> > > > news:uz******** ******@TK2MSFTN GP11.phx.gbl...
> > > > > Hi, if anyone can help on this, please! This is driving me

crazy.
> > > > >
> > > > > I have a user control hierarchy several levels deep that derive for
> > > > > UserControl (windows).
> > > > >
> > > > > The class that is at the top level, has the following

constructor
> > > > (generated
> > > > > by VS.NET)
> > > > > Public Sub New()
> > > > > MyBase.New()
> > > > >
> > > > > 'This call is required by the Windows Form Designer.
> > > > > InitializeCompo nent()
> > > > > 'Add any initialization after the InitializeCompo nent() call
> > > > >
> > > > > End Sub
> > > > >
> > > > > Sometimes (about half the time), when I recompile my solution (which
> > > > > contains a project with this class, and a project with a form tester
> > > > trying
> > > > > out this user control), I get the error I put in the subject of this
> > > post.
> > > > >
> > > > > Now, clearly, this class has a constructor.
> > > > > If I change the code by removing the word 'Public', and

recompile
> > > > everything
> > > > > is great.
> > > > >
> > > > > Next time I need to recompile, I get this error again. In this > case,
> > I
> > > > just
> > > > > put the word 'Public' back in, and recompile - all is well

again.
> > > > >
> > > > > So I spend half my time removing 'Public' and then adding it

back
> in -
> > > > just
> > > > > to get the compiler to change its mind.
> > > > >
> > > > > Now, it doesn't do this all the time. Sometimes it recompiles OK.
> > > > >
> > > > > I've checked the project build order - and the project with the user
> > > > control
> > > > > is compiled first.
> > > > >
> > > > > I've tried manually compiling the first project - and then
the > second.
> > > And
> > > > > the second always fails, because it thinks there is no

constructor
> > > > available
> > > > > for the user control. Until that is, I take away or remove

the > > 'Public'
> > > > > keyword off of the constructor - in which case its fine.
> > > > >
> > > > > Is this some ridiculous VB compiler problem? Some VS.NET bug. > Anything
> > I
> > > > can
> > > > > do about it?
> > > > >
> > > > > Thanks
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Jul 21 '05 #18
"CJ Taylor" <[cege] at [tavayn] dit commmmm> schrieb
Sorry.

=)


Ok. :)
--
Armin

Jul 21 '05 #19

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3508
by: JohnnySparkles | last post by:
Hi everyone, I'm currently writing an application which uses the XmlSerializer class to serialize/deserialize objects to/from xml. Now when deserializing an XmlDocument back into the object, I'm using the System::Type::GetType(String* typeName) to create a Type* needed to construct the XmlSerializer. The typeName argument is taken from the XmlDocument and consists of the
11
1880
by: Johan | last post by:
Hi Can somebody explain to me why I get this warning message and how I can solve this warning message. Thanks a lot Johan In member function `void
1
1465
by: icedac | last post by:
I have some questions about template and c++ itself. ///////////////////////////////////////////////////////////////////////// q1) see follow c++ code, and compile. it's works only IntelC++8.1 but VC71. Do you know why? Which compiler's activity is C++STANDARD? And I wanna be feed back some explain. :)
5
1527
by: Axter | last post by:
I'm fine tuning a scope_handle class that takes a policy class as the second template. http://code.axter.com/scope_handle.h Please see above link for full understanding of the problem. One thing I don't like about the way the current policy template is setup is that for the ptr_policy class the first template type is different from the template type given to the policy. And on the other policy classes, the template type is the same....
2
2346
by: PengYu.UT | last post by:
I have the following sample program, which can convert function object with 1 argument into function object with 2 arguments. It can also do + between function object of the same type. The last line is very long. I'm wondering if there is any way to suppress it. I can only think of typedef. But I'm not sure whether I can use typedef for the return type. Would you please help me? Please don't be daunted by the length of the code.
14
2213
by: Joseph Turian | last post by:
How can I determine the type of some particular typename? I am writing a template, and it needs special case handling for some particular types: template <typename T> class foo { public: foo() { if (T == int) cerr << "int\n";
0
1632
by: Edson Tadeu | last post by:
I was thinking in a way to do static dispatching on enumerations, in a way similar to dispatching on integral constants using Loki's Int2Type<> or Boost.MPL's int_<>, i.e, creating types based on the enumeration constants, so I came up with this example code: #include <iostream> using namespace std; template <class EnumType>
4
3641
by: Frank-René Schäfer | last post by:
-- A class needs to have N members according to N types mentioned in a typelist (possibly with one type occuring more than once). -- The classes should be generated **avoiding** multiple inheritance (avoiding prosperation of virtual func tables). -- At the same time, a class taking N types shall contain a virtual member function that calls a function according to the number of arguments That means, something like:
7
7818
by: Sky | last post by:
I have been looking for a more powerful version of GetType(string) that will find the Type no matter what, and will work even if only supplied "{TypeName}", not the full "{TypeName},{AssemblyName}" As far as I know yet -- hence this question -- there is no 'one solution fits all', but instead there are several parts that have to be put together to check. What I have so far is, and would like as much feedback as possible to ensure I've...
18
3668
by: AlexanderVX | last post by:
How do I write a constructor mehtod call in this case /*-----------*/ template<typename Tclass CObjectPoolImpl { public: void smth(T* pObj) { if (pObj)
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5430
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.