Discussion:
Problem with Visual Studio Macros
(too old to reply)
b***@de.thalesgroup.com
2007-02-28 13:45:30 UTC
Permalink
Hello,
I found a bug in Visual Basic used with Visual Studio Macros
(Microsoft Visual C++ 2005+ SP1).

Description:
If I apply the simple Visual Basic statement
ActiveDocument.Selection.Text = "//" +
ActiveDocument.Selection.Text

contained in a macro, to the C++ source line
m_nodes.SetSize(10, 5);

the following error message is always produced:
"Beim Aufruf einer COM-Komponente wurde ein HRESULT E_FAIL-Fehler
zurückgegeben"


If found that the reason for the failure is the comma character (,).
If I replace the character with, for example, a semicolon every thing
works fine.
With a ',' the result looks like this
"// m_nodes.SetSize(10,"


and an error message box is displayed.
However a statement like
Sel.Text = "xxxx" + Sel.Text
works fine.


With Visual Studio 2003 and Visual Studio 2005 without SP1 it works
fine.
But with installed service pack it fails.

If the following macro is applied to the line
m_nodes.SetSize(10, 5);
it produces the error message..


Public Sub StringBug()
Dim Sel As TextSelection = ActiveDocument.Selection
Sel.SelectLine()
Sel.Text = "//" + Sel.Text
End Sub


My configuration:
Microsoft Visual C++ 2005
Version 8.0.50727.762 (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727
Microsoft Visual Studio 2005 Professional Edition - DEU Service
Pack 1 (KB926606)


I hope someone can give me a hint how to circumvent this bug.

Bernhard
Ken Halter
2007-02-28 15:04:25 UTC
Permalink
<***@de.thalesgroup.com> wrote in message news:***@s48g2000cws.googlegroups.com...
Hello,
I found a bug in Visual Basic used with Visual Studio Macros
(Microsoft Visual C++ 2005+ SP1).



The groups that start with 'microsoft.public.vb' are for VB Classic. dotNet
questions/reports should go in groups that contain "dotnet" in their names.
--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
Continue reading on narkive:
Loading...