I usually would like to take care of the warnings too. as for
DialogResult.OK being shared I have no control as it was part of the
framework. I looked into the help before but could not figure out a
solution. As it turned out it was bogus warning.
The only thing I am serious concerned about is the one related to warning
#12, and the olecmd saveas function
' save a document into file specified by filespec string
Public Sub saveAs(ByVal strFileSpec As String)
Dim doOpt As SHDocVw.OLECMDEXECOPT
doOpt = SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER
MsgBox("SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER=" &
vbCrLf & SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER,
MsgBoxStyle.Information, "SaveAs @debug")
Dim o As New Object()
Try
webBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_SAVEAS, doOpt,
CType(strFileSpec, Object), o)
Catch
Throw (New Exception(Err.GetException().Message))
End Try
End Sub ' saveAs
It does saveas but with prompt which I dont want.
Aha, I fount the discrepancies. supposedly
public struct OLECMDTEXT
{
public uint cmdtextf;
public uint cwActual;
public uint cwBuf;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=100)]public char rgwz;
}
// I have trouble translating the above to vb
// tried
// <MarshalAs(UnmanagedType.ByValTStr,SizeConst=100)>public char rgwz;
// also
// <MarshalAs(UnmanagedType.ByValTStr,SizeConst As Integer =100)>public char
rgwz;
//
[StructLayout(LayoutKind.Sequential)]
public struct OLECMD
{
public uint cmdID;
public uint cmdf;
}
But the example source code has Long in place of unit
<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 Long ' <== should be Uint32
Public cmdf As UInt64 ' <== should be unit32 according to KB329014
End Structure
despite the changes, I still have the prompt popping up on me
rowe_newsgroups said:
If you have access to the source code then you could remove the Shared
keyword from the constant if you wanted, but like you said it doesn't
seem to matter. - I am obcessive compulsive when it comes to warning
messages : )
Thanks,
Seth Rowe