Handling events issue in macros

Visual Studio .Net


  • 1. empty property window
    Fist of all, I think my problem is similar to Rick Austin (Missing Project Properties). My VS.Net 2003 (using VB.Net) was working fine until yesterday after I upgraded the Visual SourceSafe on my machine. I installed VSS 6.0d (client only) over my existing VSS 6.0b. I'm not sure if it was the one which triggered the problem but these are now the symptoms everytime I work on a project: 1] The Property window no longer displays anything for any control 2] When I add a server from the Server Explorer the error "Object reference not set to an instance of an object" I tried uninstalling the VSS (then a reboot) and uninstalling both the VS.Net 2003 and .Net Framework (then another reboot). Basically, I've uninstalled everything that I think is linked to the problem and then did a Reinstallation of the .Net framework then VS.Net2003. This did not solve the problem. Can anyone give me some tips on how to fix this, other than reformating my harddrive? Thanks in advance. Albert
  • 2. folder in a project
    This is a multi-part message in MIME format. Why I don't see any class under a folder in side a project Project ---------Folder --------- File.cs <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META content="MSHTML 6.00.2900.2180" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial size=2>Why I don't see any class under a folder in side a project</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Project</FONT></DIV> <DIV><FONT face=Arial size=2>    ---------Folder </FONT></DIV> <DIV><FONT face=Arial size=2>                 --------- File.cs</FONT></DIV></BODY></HTML>
  • 3. Exclude from source control
    I have an app.config file that is used for debugging, so I would like to have it in the project, but not under source control. Is there a way to do this is Visual Studio 2005 Professional? mike
  • 4. Intellisense for enumerations
    Hi. I was using VB under VS2003 but having received VS2005 I have decided to start using C#. One little thing seems to be a step in the wrong direction although I just may have to customise the IDE properly. When in VB, for instance, I had a listview control and wanted to change the View property in code I would type listView1.View = Typing the equals sign would show the members of the enumeration. (In this case Report, LargeIcon etc) Nice. In C# under VS2005 I currently don't get this and have to work out the name of the enumeration. Not a major problem but it takes more time. Can someone throw some light on this? Thanks.

Handling events issue in macros

Postby QWxleGFuZGVyIExva290a292 » Tue, 19 Oct 2004 17:47:06 GMT

Hi all,

I tried to handle MiscFilesEvents.ItemAdded in a macro but failed to do 
that. The code looks like this:

Public Module EnvironmentEvents
#Region "Automatically generated code, do not modify"
'skip that lengthy stuff
#End Region

'not sure if this code is required since
'the other events (SolutionItemsEvents) work properly without it
Public Sub DTEEvents_OnMacrosRuntimeReset() Handles 
        MiscFilesEvents = DTE.Events.MiscFilesEvents
End Sub

'This handler has never been invoked for some reason
    Private Sub MiscFilesEvents_ItemAdded(ByVal ProjectItem As 
EnvDTE.ProjectItem) Handles MiscFilesEvents.ItemAdded()

        MsgBox("Project item added: " & ProjectItem.Name)
        printText(msg, con)

    End Sub
End Module

What's wrong with this code? How can I catch the EnvDTE.ProjectItemsEvents 

Thanks in advance,

Similar Threads:

1.VS2005 Macro - Event Handles

I'm trying to access Handles from VS2005 Macros.
For now i'm able to access sub definition (EnvDTE80.CodeElement2 cast
to EnvDTE80.CodeFunction2)
but I need to access the "Handles Me.Click" part of the code to remove
Any idea?

VB Code :
   Private Sub frmMain_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Click
   End Sub

2.Want to raise event from Word macro and handle in C#

I'm working on a Word document which uses MacroButtons.  These call VB macros 
when the user double-clicks (see the checkboxes in MS's FAX templates for 
examples). This is fine, but the rest of my code is in C#, so I'd like to 
hand off to a C# handler from the VB Macro (or somehow get the MacroButton to 
call the C# code directly).  Is there some way to do this?

3.TableNewRow event handling issue

Using VS 2005 SP1; I created a simple form by dragging and dropping a data 
table.  I changed it to a details view, so I have a mixture of text boxes, 
combo boxes and a check box (no dgv).  I want to programatically populate the 
controls when the user clicks on the Add New button, so I added the following 
event handler:

void MyDataTable_TableNewRow(object sender, DataTableNewRowEventArgs e)
  int nIndex = int.Parse(this.bindingNavigatorPositionItem.Text);
  e.Row["Col0"] = 
  e.Row["Col1"] = 
  e.Row["Col2"] = 

This works surprisingly well; the user can select any row and use it as a 
template for the new row.  I tried to take this a step further; instead of 
setting the columns individually, I tried to use the CopyTo function as 

void MyDataTable_TableNewRow(object sender, DataTableNewRowEventArgs e)
  int nIndex = int.Parse(this.bindingNavigatorPositionItem.Text);

The code seems to execute, but all my controls are blank, like the CopyTo 
did nothing; what am I missing here?  Shouldn't this work?
Regards, Bob

4.multiple event handling issue

when I did this :

Private Sub mydatagrid_MouseDown(ByVal sender As Object, ByVal mouseEvent As 
System.Windows.Forms.MouseEventArgs, ByVal keyPressEvent As 
System.Windows.Forms.KeyEventArgs) Handles mydatagrid.MouseDown
end sub
I got error because it wouldn't allow pass into 2 delegrates? here?  But I 
wanted to be able pick up both mouse click and key press event in this 
subroutine.  Could you someone please tell me how do I do going about to get 
it to work?


5.Custom Event handling + thread handling.

I've written an event that tells me that I've connected properly to a 
remote telnet location.  When I know that I'm connected I fire the event 
which is being listened for in a bit of code that then goes on and does 
some work based on this event.

My problem is that once I fire that event, the thread that fired it 
waits until the thread that received it finishes.  I fixed the problem 
by making the bit of code that is listening for the event continue on 
with what it is doing in the background, but I'm wondering if there is a 
different way.

Specifically, the code is going through a csv file and then doing a few 
things on a remote system to get information based on something in the 
csv, and then processing that information once we get it.

Everything works fine, but I'd like to know what I'm doing wrong, in 
that I don't think that the thread should be tied up waiting for 
whatever was listening for the event to finish.

Any help, or pointing in the right direction is as usual, very much 


6. issue: calling a C# library function (COMInterop) from an excel macro (VBA)

7. issue: calling a C# library function (COMInterop) from an excel macro (VBA)

8. Macro issue. Waiting for Build to be completed

Return to Visual Studio .Net


Who is online

Users browsing this forum: No registered users and 15 guest