VB.net的Friend

fjjfxz 2008-01-22 12:06:36
以前学过一点C++
所以对VB.NET中的friend感到很困惑,老是以为类中的友元过程其表现应该和C++一样,所以我在写个简单的程序中(一个有理数类):
Public Class Fraction
#Region "Data Fields"
Private numerator As Integer '分子
Private denominator As Integer '分母
#End Region
#Region "Methods"
Friend Function Add(ByVal f1 As Fraction, ByVal f2 As Fraction) As Fraction
'友元函数,加法为二元运算符,想做成Add(f1,f2)这样求两个分数的和
Dim t1 As Integer
Dim f As New Fraction
t1 = lcm(f1.denomIs(), f2.denomIs())
'numerator = numerator * (t1 / denominator) + frac1.numIs() * (t1 / frac1.denomIs())
f.numerator = f1.numerator * (t1 / f1.denominator) + f2.numerator * (t1 / f2.denominator)
f.denominator = t1
Return f
End Function

Public Function Subtract(ByVal frac1 As Fraction) As Fraction

End Function
Public Function Mult(ByVal frac1 As Fraction) As Fraction

End Function
Public Function numIs() As Integer '返回分子
Return numerator
End Function

Public Function denomIs() As Integer '返回分母
Return denominator
End Function

Public Sub New()

End Sub

Public Sub New(ByVal num As Integer, ByVal denom As Integer)
Dim t1 As Integer
t1 = gcd(num, denom)
num /= t1
denom /= t1
numerator = num
denominator = denom
End Sub

Private Function gcd(ByVal a As Integer, ByVal b As Integer) As Integer '最大公约数
Dim c As Integer
If a < b Then
c = a
a = b
b = c
End If
c = a Mod b
While (c <> 0)
a = b
b = c
c = a Mod b
End While
Return b
End Function

Private Function lcm(ByVal a As Integer, ByVal b As Integer) As Integer '最小公倍数
Dim c As Integer
If a < b Then
c = a
a = b
b = c
End If
c = a
Do While (c Mod b <> 0)
c = c + a
Loop
Return c
End Function
Public Sub Print()
Console.WriteLine(numerator & "/" & denominator)
End Sub
#End Region

End Class

可是我想在模块中:
Module Module1

Sub Main()
Dim a As Fraction = New Fraction(1, 2)
Dim b As New Fraction(1, 3)
Dim c As New Fraction
a.Print()
b.Print()
c = Add(a, b) '<-------------这里无法调用
c.Print()

Console.Read()
End Sub

End Module
想问的是,friend在vb.net中跟c++中的到底有什么不同?
能不能实现二元加Add?
...全文
1249 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
fjjfxz 2008-01-25
  • 打赏
  • 举报
回复
感谢楼上的,在VB.net中是太麻烦了,按你的方法
把方法声明成shared,可如何实现对实例成员的调用?
还是感谢楼上的!
vwxyzh 2008-01-25
  • 打赏
  • 举报
回复
Imports NameSpaces.Fraction
加了以后可以直接用这个Fraction类的静态方法
fjjfxz 2008-01-25
  • 打赏
  • 举报
回复
好象还是要用类型名.过程名的方式调用
即:
c=Fraction.Add(a,b)
vwxyzh 2008-01-23
  • 打赏
  • 举报
回复
lz想直接写Add也可以,就是vb.net里面要麻烦一点
1、把Add方法改成Shared
2、在调用处(Module1)添加一个Imports NameSpaces.Fraction
vwxyzh 2008-01-22
  • 打赏
  • 举报
回复
Add是实例方法,需要Fraction实例才能调用
chuxue1342 2008-01-22
  • 打赏
  • 举报
回复
能不能实现二元加Add?
--------------------
应该能够的!
rockyvan 2008-01-22
  • 打赏
  • 举报
回复
C++我沒有接觸過,你自己學過一點,你自己找找區別吧。
rockyvan 2008-01-22
  • 打赏
  • 举报
回复
Friend (Visual Basic)声明上下文。仅可以在模块、接口或命名空间级别使用 Friend。这意味着 Friend 元素的声明上下文必须是源文件、命名空间、接口、模块、类或结构,不能是过程。
fjjfxz 2008-01-22
  • 打赏
  • 举报
回复
但是在VB.NET中,类中某过程声明为Friend,该过程仍然是类的一部分,换句话说,调用这个Friend方法,仍需要使用对象.过程名这样的形式!
足球中国 2008-01-22
  • 打赏
  • 举报
回复
friend 在VB中和C++中是一样的.都是表示友元.
fjjfxz 2008-01-22
  • 打赏
  • 举报
回复
可以用这样的方法来调用:
c=Add(a,b)而不需要象在VB.NET中这样
使用类或对象来调用Add,写在c.Add(a,b)或将其声明为类的方法Shared,用Fraction.Add(a,b)这样丑陋的方式。
唉,不知c#中是不是这样?
fjjfxz 2008-01-22
  • 打赏
  • 举报
回复
Friend在VB.NET中的意义是什么?
C++中friend其实也就是为提高效率而破坏类的封装
如用C++,在上述Fraction类,如果把Add函数声明为友元,Add不是类的组成部分
可以用这样的方法来调用:
c=Add(a,b)而不需要使用类或对象来调用Add,写在c.Add(a,b)或将其声明为类的方法Shared,用Fraction.Add(a,b)这样丑陋的方式。
唉,不知c#中是不是这样?
Lost_Love_Anymore 2008-01-22
  • 打赏
  • 举报
回复
c = Add(a, b)
c = c.Add(a, b)
类的方法调用问题。Add是实例化Fraction 类后C的方法。
Option Strict OnImports System.MathPublic Class MandelbrotForm 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. InitializeComponent() ‘Add any initialization after the InitializeComponent() 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.Dispose() End If End If MyBase.Dispose(disposing) End Sub ‘Required by the Windows Form Designer Private components As System.ComponentModel.IContainer ‘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 PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents txtMin As System.Windows.Forms.TextBox Friend WithEvents txtMax As System.Windows.Forms.TextBox Friend WithEvents txtColorMin As System.Windows.Forms.TextBox Friend WithEvents txtColorMax As System.Windows.Forms.TextBox Friend WithEvents bttnMandelbrot As System.Windows.Forms.Button Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents Label6 As System.Windows.Forms.Label Friend WithEvents bttnViewPrevious As System.Windows.Forms.Button Friend WithEvents bttnViewNext As System.Windows.Forms.Button Private Sub InitializeComponent() Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(MandelbrotForm)) Me.PictureBox1 = New System.Windows.Forms.PictureBox Me.bttnMandelbrot = New System.Windows.Forms.Button Me.bttnViewPrevious = New System.Windows.Forms.Button Me.bttnViewNext = New System.Windows.Forms.Button Me.txtMin = New System.Windows.Forms.TextBox Me.txtMax = New System.Windows.Forms.TextBox Me.txtColorMin = New System.Windows.Forms.TextBox Me.txtColorMax = New System.Windows.Forms.TextBox Me.Label1 = New System.Windows.Forms.Label Me.Label2 = New System.Windows.Forms.Label Me.Label3 = New System.Windows.Forms.Label Me.Label4 = New System.Windows.Forms.Label Me.Label5 = New System.Windows.Forms.Label Me.Label6 = New System.Windows.Forms.Label Me.SuspendLayout() ‘ ‘PictureBox1 ‘ Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.PictureBox1.Location = New System.Drawing.Point(5, 97) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(512, 512) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 0 Me.PictureBox1.TabStop = False ‘ ‘bttnMandelbrot ‘ Me.bttnMandelbrot.Font = New System.Drawing.Font("Verdana", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.bttnMandelbrot.Location = New System.Drawing.Point(62, 4) Me.bttnMandelbrot.Name = "bttnMandelbrot" Me.bttnMandelbrot.Size = New System.Drawing.Size(399, 30) Me.bttnMandelbrot.TabIndex = 1 Me.bttnMandelbrot.Text = "New Fractal" ‘ ‘bttnViewPrevious ‘ Me.bttnViewPrevious.Image = CType(resources.GetObject("bttnViewPrevious.Image"), System.Drawing.Image) Me.bttnViewPrevious.Location = New System.Drawing.Point(3, 4) Me.bttnViewPrevious.Name = "bttnViewPrevious" Me.bttnViewPrevious.Size = New System.Drawing.Size(50, 30) Me.bttnViewPrevious.TabIndex = 3 ‘ ‘bttnViewNext ‘ Me.bttnViewNext.Image = CType(resources.GetObject("bttnViewNext.Image"), System.Drawing.Image) Me.bttnViewNext.Location = New System.Drawing.Point(470, 4) Me.bttnViewNext.Name = "bttnViewNext" Me.bttnViewNext.Size = New System.Drawing.Size(50, 30) Me.bttnViewNext.TabIndex = 4 ‘ ‘txtMin ‘ Me.txtMin.Font = New System.Drawing.Font("Verdana", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte)) Me.txtMin.Location = New System.Drawing.Point(61, 67) Me.txtMin.Name = "txtMin" Me.txtMin.Size = New System.Drawing.Size(46, 26) Me.txtMin.TabIndex = 6 Me.txtMin.Text = "0" ‘ ‘txtMax ‘ Me.txtMax.Font = New System.Drawing.Font("Verdana", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte)) Me.txtMax.Location = New System.Drawing.Point(165, 67) Me.txtMax.Name = "txtMax" Me.txtMax.Size = New System.Drawing.Size(46, 26) Me.txtMax.TabIndex = 7 Me.txtMax.Text = "128" ‘ ‘txtColorMin ‘ Me.txtColorMin.Font = New System.Drawing.Font("Verdana", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte)) Me.txtColorMin.Location = New System.Drawing.Point(336, 67) Me.txtColorMin.Name = "txtColorMin" Me.txtColorMin.Size = New System.Drawing.Size(46, 26) Me.txtColorMin.TabIndex = 9 Me.txtColorMin.Text = "0" ‘ ‘txtColorMax ‘ Me.txtColorMax.Font = New System.Drawing.Font("Verdana", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte)) Me.txtColorMax.Location = New System.Drawing.Point(451, 67) Me.txtColorMax.Name = "txtColorMax" Me.txtColorMax.Size = New System.Drawing.Size(46, 26) Me.txtColorMax.TabIndex = 10 Me.txtColorMax.Text = "512" ‘ ‘Label1 ‘ Me.Label1.Font = New System.Drawing.Font("Verdana", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte)) Me.Label1.Location = New System.Drawing.Point(11, 41) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(121, 22) Me.Label1.TabIndex = 11 Me.Label1.Text = "Iterations" ‘ ‘Label2 ‘ Me.Label2.Font = New System.Drawing.Font("Verdana", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte)) Me.Label2.Location = New System.Drawing.Point(16, 72) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(39, 16) Me.Label2.TabIndex = 12 Me.Label2.Text = "Min" ‘ ‘Label3 ‘ Me.Label3.Font = New System.Drawing.Font("Verdana", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte)) Me.Label3.Location = New System.Drawing.Point(120, 72) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(46, 16) Me.Label3.TabIndex = 13 Me.Label3.Text = "Max" ‘ ‘Label4 ‘ Me.Label4.Font = New System.Drawing.Font("Verdana", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte)) Me.Label4.Location = New System.Drawing.Point(285, 41) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(158, 22) Me.Label4.TabIndex = 14 Me.Label4.Text = "Color Range" ‘ ‘Label5 ‘ Me.Label5.Font = New System.Drawing.Font("Verdana", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte)) Me.Label5.Location = New System.Drawing.Point(293, 72) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(39, 16) Me.Label5.TabIndex = 15 Me.Label5.Text = "Min" ‘ ‘Label6 ‘ Me.Label6.Font = New System.Drawing.Font("Verdana", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte)) Me.Label6.Location = New System.Drawing.Point(402, 72) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(46, 16) Me.Label6.TabIndex = 16 Me.Label6.Text = "Max" ‘ ‘MandelbrotForm ‘ Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(524, 620) Me.Controls.Add(Me.Label6) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.txtColorMax) Me.Controls.Add(Me.txtColorMin) Me.Controls.Add(Me.txtMax) Me.Controls.Add(Me.txtMin) Me.Controls.Add(Me.bttnViewNext) Me.Controls.Add(Me.bttnViewPrevious) Me.Controls.Add(Me.bttnMandelbrot) Me.Controls.Add(Me.PictureBox1) Me.KeyPreview = True Me.Name = "MandelbrotForm" Me.Text = "Fractal Generator: The Mandelbrot Set" Me.ResumeLayout(False) End Sub#End Region Dim XMin As Double, XMax As Double Dim YMin As Double, YMax As Double Dim XStart, YStart As Integer Dim XEnd, YEnd As Integer Dim currentFractal As Integer Dim breaknow As Boolean Dim limits As New ArrayList Structure Bounding Dim XMin As Double Dim XMax As Double Dim YMin As Double Dim YMax As Double End Structure Private Sub bttnMandelbrot_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttnMandelbrot.Click Static IterMin As Integer = 100000 Dim IterMax As Integer = -100000 Dim bmap As Bitmap bmap = New Bitmap(512, 512, Drawing.Imaging.PixelFormat.Format32bppPArgb) PictureBox1.Image = bmap Dim pX, pY As Integer Dim NX As Integer = 512 Dim NY As Integer = 512 Dim MaxIter As Integer Dim X, Y As Double Dim Iterations As Integer Dim minIterations As Integer = CInt(txtMin.Text) Dim maxIterations As Integer = CInt(txtMax.Text) Dim colorMin As Integer Dim colorMax As Integer Dim pixelColor As Color If IsNumeric(txtColorMin.Text) Then colorMin = CInt(txtColorMin.Text) If IsNumeric(txtColorMax.Text) Then colorMax = CInt(txtColorMax.Text) If IsNumeric(txtMin.Text) Then minIterations = CInt(txtMin.Text) If IsNumeric(txtMax.Text) Then maxIterations = CInt(txtMax.Text) If maxIterations <= minIterations Then MsgBox("The number of maximum iterations should be larger " & _ "than the number of minimum iterations") Exit Sub End If If colorMax <= colorMin Then MsgBox("The first color‘s value should be smalled than the last color‘s value") Exit Sub End If For pY = 0 To NY - 1 Y = YMin + pY * (YMax - YMin) / (NY - 1) For pX = 0 To NX - 1 X = (XMin + pX * (XMax - XMin) / (NY - 1)) Iterations = Mandelbrot(X, Y, maxIterations) Dim clr As Integer clr = CInt(colorMin + _ (colorMax - colorMin) / (maxIterations - minIterations) * _ (Iterations - minIterations)) clr = Math.Max(minIterations, clr) pixelColor = PaintPixel(clr) bmap.SetPixel(pX, pY, pixelColor) Next PictureBox1.Invalidate() Application.DoEvents() If breaknow Then breaknow = False Exit Sub End If Next End Sub Private Function PaintPixel(ByVal clr As Integer) As Color Select Case clr Case 0 To 256 - 1 Return Color.FromArgb(clr, 0, 0) Case 256 To 256 * 2 - 1 Return Color.FromArgb(255, clr - 256, 0) Case 256 * 2 To 256 * 3 - 1 Return Color.FromArgb(255, 255, clr - 256 * 2) Case 256 * 3 To 256 * 4 - 1 Return Color.FromArgb(255, clr - 256 * 3, clr - 256 * 3) Case 256 * 4 To 256 * 5 - 1 Return Color.FromArgb(255, 256 * 5 - clr - 1, 255) Case 256 * 5 To 256 * 6 - 1 Return Color.FromArgb(clr - 256 * 5, clr - 256 * 5, clr - 256 * 5) Case Else Return Color.FromArgb(clr Mod 256, clr Mod 256, clr Mod 256) End Select End Function Function Mandelbrot(ByVal Cx As Double, ByVal Cy As Double, ByVal max As Integer) As Integer Dim iter As Integer Dim X2, Y2 As Double Dim X, Y As Double Dim temp As Double Dim currentBounds As Bounding currentBounds = CType(limits.Item(currentFractal), Bounding) XMin = currentBounds.XMin XMax = currentBounds.XMax YMin = currentBounds.YMin YMax = currentBounds.YMax While iter < max And (Sqrt(X2 * X2 + Y2 * Y2) < 100000) temp = X2 - Y2 + Cx Y = 2 * X * Y + Cy X = temp X2 = X * X Y2 = Y * Y * Y iter = iter + 1 End While Return (iter) End Function Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown XStart = e.X YStart = e.Y End Sub Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove If e.Button <> MouseButtons.Left Then Exit Sub PictureBox1.Refresh() Dim newX, newY As Integer newX = e.X newY = e.Y If Math.Abs(newX - XStart) < Math.Abs(newY - YStart) Then newY = YStart + Math.Abs(newX - XStart) Else newX = XStart + Math.Abs(newY - YStart) End If PictureBox1.CreateGraphics.DrawRectangle(Pens.White, XStart, YStart, newX - XStart, newY - YStart) End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load XMin = -1.5 : XMax = 0.5 YMin = -1 : YMax = 1 Dim currentBounds As Bounding currentBounds.XMin = XMin currentBounds.XMax = XMax currentBounds.YMin = YMin currentBounds.YMax = YMax limits.Add(currentBounds) End Sub Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp XEnd = e.X YEnd = e.Y If Math.Abs(XEnd - XStart) < Math.Abs(YEnd - YStart) Then YEnd = YStart + Math.Abs(XEnd - XStart) Else XEnd = XStart + Math.Abs(YEnd - YStart) End If Dim currentBounds As Bounding currentBounds = CType(limits.Item(currentFractal), Bounding) XMin = currentBounds.XMin XMax = currentBounds.XMax YMin = currentBounds.YMin YMax = currentBounds.YMax If XEnd <> 0 And YEnd <> 0 Then Dim DX, DY As Double DX = XMax - XMin DY = YMax - YMin Dim newXMin, newXMax, newYMin, newYMax As Double newXMin = XMin + DX * XStart / PictureBox1.Width newXMax = XMin + DX * XEnd / PictureBox1.Width newYMin = YMin + DY * YStart / PictureBox1.Height newYMax = YMin + DY * YEnd / PictureBox1.Height XMin = newXMin : XMax = newXMax YMin = newYMin : YMax = newYMax currentBounds.XMin = XMin currentBounds.XMax = XMax currentBounds.YMin = YMin currentBounds.YMax = YMax limits.Add(currentBounds) currentFractal = currentFractal + 1 End If End Sub Private Sub bttnViewNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttnViewNext.Click Dim currentBounds As Bounding currentBounds.XMin = XMin currentBounds.XMax = XMax currentBounds.YMin = YMin currentBounds.YMax = YMax limits.Add(currentBounds) currentFractal += 1 If currentFractal <= limits.Count Then bttnMandelbrot_Click(sender, e) End If End Sub Private Sub bttnViewPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttnViewPrevious.Click currentFractal = currentFractal - 1 If currentFractal >= 0 Then bttnMandelbrot_Click(sender, e) Else currentFractal = 0 End If End Sub Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp If e.KeyCode = Keys.Escape Then breaknow = True End If End SubEnd Class
Build 1632
requires software maintenance through 2008.04.03. (Beta release.)
New! Added context-sensitive help to VA X dialogs. Click ? or press F1 to get help. (case=8980)
New! Visual Studio 2008-style transparent listboxes are available in all IDEs. Hold down Ctrl when listbox is displayed to activate. (case=10072) 7209, 6972
New! Added option to include or exclude refactoring suggestions in listboxes; see Advanced | Refactoring | Include refactoring suggestions in listboxes. (case=10428) 5797, 7254
"return" takes precedence over "RETCODE" in suggestion lists. (case=11277) 7036
Fixed incompatibility with XNA Game Studio 2.0. (case=10703) 7064
Restored "put n spaces between method name and ()" option under Advanced | Corrections. (case=10995) 7304
Fixed a problem typing "else" on a line by itself. (case=8415)
Debugger tooltips display without flickering. (case=8817) 6647
Fixed hang when opening web site project in Visual Studio 2008. (case=10401)
Fixed intermittent crash when typing a VB Imports statement in Visual Studio 2008 on Windows Vista. (case=15154)
Ctrl+Tab document switching is handled properly in Visual Studio 2008. (case=10303) 7010
Visual Studio 2008 C++ include directories that contain double backslashes due to environment variable expansion are located and parsed correctly. (case=11261)
Highlight current line works properly in .js and .asp/.aspx files in Visual Studio 2008. (case=15384)
Visual Basic enumerations are parsed correctly. (case=12161)
Removed C-style comment and semicolon from Encapsulate Field in Visual Basic files. (case=11160, case=4475) 7107
Object methods called on boxed string literals in C# are parsed correctly. (case=8012) 6513
Subsequent rename operations issued from VA Outline target the correct symbol. (case=10502) 7039
MFC dispatch map is shown in VA Outline. (case=10514)
Tooltips are positioned correctly when VA Outline is undocked in VC6. (case=9976) 6946
VA Outline shows correct hierarchy for C++ classes containing friend methods without friend class declaration. (case=10740) 7072
.Net symbols are excluded from suggestion lists in unmanaged C++ solutions. (case=11391) 7148
Fixed Extract Method with for each loop in managed C++. (case=14864) 7348
Typing a dot after a C++ constructor invocation [ e.g. std::string("some text"). ] displays member list properly. (case=9876)
C++ using declarations (using namespace::identifier) are parsed correctly. (case=9436)
STL list<> and vector<> member lists appear correctly following a "using namespace std::list" or "using namespace std::vector" directive. (case=12345) 7226
Empty C++ preprocessor directives are ignored (fixes problem parsing Boost library). (case=10353)
Typedefs declared inside template classes are parsed correctly. (case=12098)
Improved parsing of STL iterator patterns (case=11842) 7136, 7202, 7212
Improved stability when parsing deep templates. (case=15454)
Fixed dereferenced iterators missing from Find References / Rename. (case=1702) 6451, 4978
Cloned Find References windows are not hidden behind the VC6 IDE. (case=10201) 7000, 7026
IDE warning message about writing to a read-only file is brought to the foreground during a rename operation if applicable. (case=8958)
#include paths are preserved when typing a slash with Repair Case disabled. (case=12025) 7200
C# generic methods are colored properly. (case=9300) 6801
Comments in tooltips and views use IDE comment color. (case=9363) 6904, 6808
Dialog edit controls are colored properly in Windows Vista. (case=9281)
Filenames displayed in lists and views are not syntax colored. (case=12556, case=12788)
Foreground text color is automatically changed if it matches the background color. (case=14268)
VA View Symbols in Solution list items are colored properly. (case=14899)
Quick Info and Parameter Tooltips invoked via the keyboard are colored properly. (case=3082) 5462
Goto (Alt+G) handles template class typedefs. (case=4249) 6168, 5774
Goto handles duplicate files better (as with VSS shared directories). (case=5567, case=7457) 6027, 6021
Listboxes are positioned such that they are not truncated at the right edge of the screen. (case=5178)
Listbox remains on the same side of a symbol (either above or below) when typing inside parentheses. (case=8998) 6672
Windows Vista visual styles are applied to listboxes. (case=9275)
Accepting a suggestion from a listbox properly replaces acronym text. (case=14290) 7316
Fixed disappearing listboxes in .js and .asax files. (case=1699, case=15295) 4843
Fixed bad icons appearing in suggestion lists. (case=14469)
#include directives listed in Find References results are displayed with question mark icons. (case=9592) 6869
Esc key turns off Highlight All when Find References results window is undocked. (case=9364) 6803
Find References error messages may optionally be displayed in the status bar instead of a modal message box. (case=10226) 7038, 6997
Spelling errors in comments with XML tags are underlined. (case=9649) 6893
XML comment suggestion list opened with < functions properly. (case=12324) 7229
Suggestions are suppressed in comments and string literals. (case=10480) 5797, 7030, 7055
Change Signature does not cause some known symbols to become unknown. (case=10432) 6762
"Enable automatic Quick Info Tooltips" option is forced on when enabling "Display comments from source files when available" option in Advanced | Display. (case=10967)
Macros in [VA X install directory]\Misc\stdafx.h are parsed each time a project is opened. (case=284)
Surround with { indents properly when selection is made from bottom to top. (case=1521) 6792, 5961, 5796, 5249
Long words (>64 chars) in comments are not underlined as mistyped. (case=3485) 5634, 5588
Improved Autosave performance. (case=9821) 6916, 5613
Open File in Solution grid lines are drawn correctly in Windows XP. (case=9948)
Forward-declared stable symbols are shown in italic. (case=399) 2263, 1934, 1912
Repair Case changes only those symbols that differ by case alone (similarly named symbols are not changed). (case=8723)
Corrected spacing around spell check replacements. (case=7768) 6471
Eliminated spurious suggestions. (case=12061) 6900
Source files residing in directories named p4win or p4v (or their descendants) are included when parsing. (case=11506) 7150
Missing VC6 toolbar icons have been restored (case=10126) 6980
Filtering toolbar shows the rightmost button correctly. (case=10623) 7044

中文注释有乱码

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧