©MicroSE®, Take Control! / Mijn website
Hier staat een mooie uitleg over bovenstaand stukje code maar dan in C# / .NET 
Inderdaad C#.net, het werkt allemaal wel. Alleen lukt het mij dus niet om dit correct te conventeren naar VB.Net
.. Kan iemand me daarbij helpen? Of weet iemand iets wat makkelijk is en wat in VB.Net werkt?
edit:
Ik hoef alleen te weten hoe de URL / het document, in het 2e venster geopend wordt?
[code=c#]
//Include the following interface declaration just before your application's namespace
//declaration to add a reference to the Microsoft HTML (MSHTML) IOleCommandTarget interface
[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Unicode)]
public struct OLECMDTEXT
{
public uint cmdtextf;
public uint cwActual;
public uint cwBuf;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=100)]public char rgwz;
}
[StructLayout(LayoutKind.Sequential)]
public struct OLECMD
{
public uint cmdID;
public uint cmdf;
}
// Interop definition for IOleCommandTarget.
[ComImport,
Guid("b722bccb-4e68-101b-a2bc-00aa00404770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOleCommandTarget
{
//IMPORTANT: The order of the methods is critical here. You
//perform early binding in most cases, so the order of the methods
//here MUST match the order of their vtable layout (which is determined
//by their layout in IDL). The interop calls key off the vtable ordering,
//not the symbolic names. Therefore, if you switched these method declarations
//and tried to call the Exec method on an IOleCommandTarget interface from your
//application, it would translate into a call to the QueryStatus method instead.
void QueryStatus(ref Guid pguidCmdGroup, UInt32 cCmds,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] OLECMD[] prgCmds, ref OLECMDTEXT CmdText);
void Exec(ref Guid pguidCmdGroup, uint nCmdId, uint nCmdExecOpt, ref object pvaIn, ref object pvaOut);
}
[/code]
die code dus..
Ik hoef alleen te weten hoe de URL / het document, in het 2e venster geopend wordt?
[code=c#]
//Include the following interface declaration just before your application's namespace
//declaration to add a reference to the Microsoft HTML (MSHTML) IOleCommandTarget interface
[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Unicode)]
public struct OLECMDTEXT
{
public uint cmdtextf;
public uint cwActual;
public uint cwBuf;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=100)]public char rgwz;
}
[StructLayout(LayoutKind.Sequential)]
public struct OLECMD
{
public uint cmdID;
public uint cmdf;
}
// Interop definition for IOleCommandTarget.
[ComImport,
Guid("b722bccb-4e68-101b-a2bc-00aa00404770"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOleCommandTarget
{
//IMPORTANT: The order of the methods is critical here. You
//perform early binding in most cases, so the order of the methods
//here MUST match the order of their vtable layout (which is determined
//by their layout in IDL). The interop calls key off the vtable ordering,
//not the symbolic names. Therefore, if you switched these method declarations
//and tried to call the Exec method on an IOleCommandTarget interface from your
//application, it would translate into a call to the QueryStatus method instead.
void QueryStatus(ref Guid pguidCmdGroup, UInt32 cCmds,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] OLECMD[] prgCmds, ref OLECMDTEXT CmdText);
void Exec(ref Guid pguidCmdGroup, uint nCmdId, uint nCmdExecOpt, ref object pvaIn, ref object pvaOut);
}
[/code]
die code dus..
sanderev66 wijzigde dit bericht 08-02-2005 19:30 (80%)
©MicroSE®, Take Control! / Mijn website
Visual Basic .NET:
1 | Private Sub wb_NewWindow2(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_NewWindow2Event) Handles wb.NewWindow2
|
Dat is de oplossing die ik zelf gevonden heb
Hier kun je de uitwerking downloaden
sanderev66 wijzigde dit bericht 22-10-2005 09:13 (11%)
©MicroSE®, Take Control! / Mijn website
Berichten: 39.409
Reg. datum: 26 december 2000
Reg. datum: 26 december 2000
C# moet je makkelijk kunnen omzetten naar VB.NET; gewoon een kwestie van een andere syntax, en that's all
Pagina: 1