Click here to Skip to main content
15,899,825 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionCrystal Report and VB.net 2005 Pin
SCHOTM11-Feb-09 10:45
SCHOTM11-Feb-09 10:45 
QuestionCheck for Framework version Pin
ivo7511-Feb-09 8:46
ivo7511-Feb-09 8:46 
AnswerRe: Check for Framework version Pin
Dave Kreskowiak11-Feb-09 10:18
mveDave Kreskowiak11-Feb-09 10:18 
AnswerRe: Check for Framework version Pin
Ranjit Viswakumar11-Feb-09 17:36
Ranjit Viswakumar11-Feb-09 17:36 
GeneralRe: Check for Framework version Pin
Dave Kreskowiak11-Feb-09 19:08
mveDave Kreskowiak11-Feb-09 19:08 
QuestionVB.Net 2005 FTP Automation Pin
hariyansa11-Feb-09 7:54
hariyansa11-Feb-09 7:54 
AnswerRe: VB.Net 2005 FTP Automation Pin
Dave Kreskowiak11-Feb-09 8:12
mveDave Kreskowiak11-Feb-09 8:12 
QuestionImplemented IOleCommandTarget in VB.NET 2005 Browser Helper Object - NOW WHAT? Pin
David Seger11-Feb-09 5:51
David Seger11-Feb-09 5:51 
I have implemented the IOleCommandTarget interface in a VB.NET 2005 Browser Helper Object. First, I wanted to share the code with everyone since it took me a while to get it working and I couldn't find any examples on the 'Net.

Now I want to be sure I know what to do with my new found toy. Specifically:

Do I need to output something from the Exec sub?
What do I output from the QueryStatus sub to answer Internet Explorer's interrogation?


Thanks! Here's the code:

Imports System
Imports System.Runtime.InteropServices

Namespace MyPopUpBHO

#Region "Interface Definition"
    <structlayout(layoutkind.sequential,> _
    Public Structure OLECMDTEXT
        Public cmdtextf As UInt32
        Public cwActual As UInt32
        Public cwBuf As UInt32
        Public rgwz As Char
    End Structure

    <structlayout(layoutkind.sequential)> _
    Public Structure OLECMD
        Public cmdID As UInt32
        Public cmdf As UInt32
    End Structure

    ' Interop definition for IOleCommandTarget.
    <comimport(),>        InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
    Public Interface IOleCommandTarget

        Sub QueryStatus( _
            ByRef pguidCmdGroup As Guid, _
            ByVal cCmds As UInt32, _
            <marshalas(unmanagedtype.lparray,> ByVal prgCmds() As OLECMD, _
            ByRef pCmdText As OLECMDTEXT)

        Sub Exec( _
            ByRef pguidCmdGroup As Guid, _
            ByVal nCmdId As Integer, _
            ByVal nCmdExecOpt As Integer, _
            ByRef pvaIn As IntPtr, _
            <marshalas(unmanagedtype.sysint)> ByRef pvaOut As IntPtr)

    End Interface

#End Regino

    <guidattribute("b722bccb-4e68-101b-a2bc-00aa00404770")> _
    Public Class ctvb

        Implements IOleCommandTarget

        Public Sub Exec( _
            ByRef pguidCmdGroup As Guid, _
            ByVal nCmdId As Integer, _
            ByVal nCmdExecOpt As Integer, _
            ByRef pvaIn As IntPtr, _
            <marshalas(unmanagedtype.sysint)> ByRef pvaOut As IntPtr) Implements IOleCommandTarget.Exec
            System.Windows.Forms.MessageBox.Show("Hiya Exec!")
        End Sub

        Public Sub QueryStatus(ByRef pguidCmdGroup As Guid, _
          ByVal cCmds As UInt32, _
          <marshalas(unmanagedtype.lparray,> ByVal prgCmds() As OLECMD, _
          ByRef pCmdText As OLECMDTEXT) Implements IOleCommandTarget.QueryStatus
            System.Windows.Forms.MessageBox.Show("Hiya QueryStatus!")
        End Sub
    End Class

End Namespace

AnswerRe: Implemented IOleCommandTarget in VB.NET 2005 Browser Helper Object - NOW WHAT? Pin
Dave Kreskowiak11-Feb-09 6:35
mveDave Kreskowiak11-Feb-09 6:35 
QuestionHow do you format the date time to just date? Pin
Muhammad Fahim Baloch11-Feb-09 5:45
Muhammad Fahim Baloch11-Feb-09 5:45 
AnswerRe: How do you format the date time to just date? Pin
Fernando Soto11-Feb-09 6:29
Fernando Soto11-Feb-09 6:29 
AnswerRe: How do you format the date time to just date? Pin
EliottA11-Feb-09 7:02
EliottA11-Feb-09 7:02 
GeneralRe: How do you format the date time to just date? Pin
Luc Pattyn11-Feb-09 11:57
sitebuilderLuc Pattyn11-Feb-09 11:57 
GeneralRe: How do you format the date time to just date? Pin
EliottA11-Feb-09 13:01
EliottA11-Feb-09 13:01 
Question2/6/2009 12:00:00 AM Pin
Muhammad Fahim Baloch11-Feb-09 5:40
Muhammad Fahim Baloch11-Feb-09 5:40 
AnswerRe: 2/6/2009 12:00:00 AM Pin
vaghelabhavesh11-Feb-09 5:48
vaghelabhavesh11-Feb-09 5:48 
GeneralRe: 2/6/2009 12:00:00 AM Pin
Jay Royall11-Feb-09 6:15
Jay Royall11-Feb-09 6:15 
QuestionHow to bring the form to front vb.net 2009 Pin
Pankaj Garg11-Feb-09 0:31
Pankaj Garg11-Feb-09 0:31 
AnswerRe: How to bring the form to front vb.net 2009 Pin
Steven J Jowett11-Feb-09 0:53
Steven J Jowett11-Feb-09 0:53 
AnswerRe: How to bring the form to front vb.net 2009 Pin
Dave Kreskowiak11-Feb-09 1:35
mveDave Kreskowiak11-Feb-09 1:35 
GeneralRe: How to bring the form to front vb.net 2009 Pin
Pankaj Garg11-Feb-09 1:47
Pankaj Garg11-Feb-09 1:47 
Questionhow to use crystal report in vb.net Pin
NaliniNagarajan10-Feb-09 23:50
NaliniNagarajan10-Feb-09 23:50 
AnswerRe: how to use crystal report in vb.net Pin
Rupesh Kumar Swami11-Feb-09 0:13
Rupesh Kumar Swami11-Feb-09 0:13 
AnswerRe: how to use crystal report in vb.net Pin
Steven J Jowett11-Feb-09 0:44
Steven J Jowett11-Feb-09 0:44 
QuestionTERMINAL SERVICE CONTROL IN VB.6 Pin
bono from indo10-Feb-09 21:33
bono from indo10-Feb-09 21:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.