Results 1 to 4 of 4

Thread: [Resolved] Raise Event from c# to VB6

  1. #1

    Thread Starter
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575

    Resolved [Resolved] Raise Event from c# to VB6

    I need to be able to raise an c# event - and that event to be listened to in VB6. However I can't find a way to do this - any suggestions?

    Rob
    Last edited by THEROB; Dec 20th, 2007 at 03:40 AM.
    My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: Raise Event from c# to VB6

    What are you trying to do? Is this a .Net DLL being referenced in VB6 or a VB6 com component being referenced in the C# application? Or are they completely seperate and you want one to work with the other?
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  3. #3

    Thread Starter
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575

    Re: Raise Event from c# to VB6

    Thanks for the reply. I am trying to fire an event from c# and this to be listened to by vb6 com.

    I found out how to do it:
    just place this before the class definition:
    [ComSourceInterfaces(typeof(AttributesEventInterface))]
    [ClassInterface(ClassInterfaceType.AutoDual)]
    [Guid("4AF51BE7-6C50-4422-8F76-40DC35219780")]
    My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]

  4. #4
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: [Resolved] Raise Event from c# to VB6

    Events are slower than directly calling a method. Why not just call your method in the com object?
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width