M
mp
more beginner questions
Is option strict recommended practice in general with vbnet?
if i turn it on i get hundreds of errors
for example the first one
(this line is fine without option strict)
m_AcadApp = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication
it occurs in this function in a class:
Function Init2(ByVal bDebug As Boolean) As Boolean
m_Debug = bDebug
Try
m_AcadApp =
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication
m_acadDoc = m_AcadApp.ActiveDocument
Return True
Catch ex As Exception
Return False
End Try
End Function
and the variable is defined thus at the top of the class
Private m_AcadApp As AcadApplication = Nothing
and i have this imports line above that
Imports Autodesk.AutoCAD.ApplicationServices.Application
but with option strict on i get the following error and don't know how to
more explicittly define the variable.
error: Option Strict On disallows implicit conversions from 'Object' to
'Autodesk.AutoCAD.Interop.AcadApplication'.
I'm not declaring it as object(late binding) but that's what the compiler
says i'm doing
how to handle this with option strict or is option strict not necessary?
thanks
mark
Is option strict recommended practice in general with vbnet?
if i turn it on i get hundreds of errors
for example the first one
(this line is fine without option strict)
m_AcadApp = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication
it occurs in this function in a class:
Function Init2(ByVal bDebug As Boolean) As Boolean
m_Debug = bDebug
Try
m_AcadApp =
Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication
m_acadDoc = m_AcadApp.ActiveDocument
Return True
Catch ex As Exception
Return False
End Try
End Function
and the variable is defined thus at the top of the class
Private m_AcadApp As AcadApplication = Nothing
and i have this imports line above that
Imports Autodesk.AutoCAD.ApplicationServices.Application
but with option strict on i get the following error and don't know how to
more explicittly define the variable.
error: Option Strict On disallows implicit conversions from 'Object' to
'Autodesk.AutoCAD.Interop.AcadApplication'.
I'm not declaring it as object(late binding) but that's what the compiler
says i'm doing
how to handle this with option strict or is option strict not necessary?
thanks
mark