|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Option strictI'd assume on, but then so many things break looks like it will take long time to rewrite existing prog. example: Option Strict On disallows implicit conversions from 'Object' to 'Autodesk.AutoCAD.Interop.AcadApplication'. but the variable wasn't declared as Object it was early bound Private m_AcadApp As AcadApplication = Nothing ....then later Private Function GetAutoCADInstance() As AcadApplication Try m_AcadApp = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication Catch ex As Exception End Try Return m_AcadApp End Function sorry but i don't see the implicit conversion thanks for any info mark Am 25.04.2010 20:23, schrieb mp:
> Should that be on or off? (i know, dumb question) Always fasten your seat belt. But AFAIK, here in Germany, taxi drivers> I'd assume on, but then so many things break looks like it will take long > time to rewrite existing prog. are allowed to drive without it if they are transporting a passenger. So, this strict rule has an exception. Still I say: Always fasten seat belt. Show quoteHide quote > example: What is the type of 'AcadApplication'? If it's 'Object', it could> Option Strict On disallows implicit conversions from 'Object' to > 'Autodesk.AutoCAD.Interop.AcadApplication'. > but the variable wasn't declared as Object it was early bound > Private m_AcadApp As AcadApplication = Nothing > > ....then later > > Private Function GetAutoCADInstance() As AcadApplication > Try > m_AcadApp = > Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication > Catch ex As Exception > End Try > Return m_AcadApp > End Function > > > > sorry but i don't see the implicit conversion be of any type. Did you consider this? Are you sure that 'AcadApplication' will _always_ be of type Autodesk.AutoCAD.Interop.AcadApplication? If you are, then cast the object to that type before the assignment. -- Armin
Show quote
Hide quote
"Armin Zingler" <az.nospam@freenet.de> wrote in message oh, i think i see what you mean...news:e$uv7lK5KHA.4740@TK2MSFTNGP06.phx.gbl... > Am 25.04.2010 20:23, schrieb mp: >> Should that be on or off? (i know, dumb question) >> I'd assume on, but then so many things break looks like it will take long >> time to rewrite existing prog. > > Always fasten your seat belt. But AFAIK, here in Germany, taxi drivers > are allowed to drive without it if they are transporting a passenger. > So, this strict rule has an exception. Still I say: Always fasten seat > belt. > >> example: >> Option Strict On disallows implicit conversions from 'Object' to >> 'Autodesk.AutoCAD.Interop.AcadApplication'. >> but the variable wasn't declared as Object it was early bound >> v>> >> ....then later >> >> Private Function GetAutoCADInstance() As AcadApplication >> Try >> m_AcadApp = >> Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication >> Catch ex As Exception >> End Try >> Return m_AcadApp >> End Function >> >> >> >> sorry but i don't see the implicit conversion > > What is the type of 'AcadApplication'? If it's 'Object', it could > be of any type. Did you consider this? Are you sure that 'AcadApplication' > will _always_ be of type Autodesk.AutoCAD.Interop.AcadApplication? > If you are, then cast the object to that type before the assignment. > > > -- > Armin i should have had Private m_AcadApp as Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication = Nothing instead of... Private m_AcadApp As AcadApplication = Nothing ....is that what you mean? thanks mark Am 25.04.2010 22:38, schrieb mp:
Show quoteHide quote >>> Option Strict On disallows implicit conversions from 'Object' to Not really.>>> 'Autodesk.AutoCAD.Interop.AcadApplication'. >>> but the variable wasn't declared as Object it was early bound >>> v>> >>> ....then later >>> >>> Private Function GetAutoCADInstance() As AcadApplication >>> Try >>> m_AcadApp = >>> Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication >>> Catch ex As Exception >>> End Try >>> Return m_AcadApp >>> End Function >>> >>> >>> >>> sorry but i don't see the implicit conversion >> >> What is the type of 'AcadApplication'? If it's 'Object', it could >> be of any type. Did you consider this? Are you sure that 'AcadApplication' >> will _always_ be of type Autodesk.AutoCAD.Interop.AcadApplication? >> If you are, then cast the object to that type before the assignment. >> >> >> -- >> Armin > > oh, i think i see what you mean... > i should have had > Private m_AcadApp as > Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication = Nothing > instead of... > Private m_AcadApp As AcadApplication = Nothing > ...is that what you mean? The type of the 'Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication' property (as I assume) should not be 'Object'. However, maybe this is out of your control. In this case, read the documentation on the property carefully. Maybe a cast ('DirectCast') is required to cast the returned value to 'AcadApplication'. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Show quote
Hide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message Thanks, I'll check it outnews:%23jZ4PAM5KHA.1888@TK2MSFTNGP05.phx.gbl... > Am 25.04.2010 22:38, schrieb mp: >>>> Option Strict On disallows implicit conversions from 'Object' to >>>> 'Autodesk.AutoCAD.Interop.AcadApplication'. >>>> but the variable wasn't declared as Object it was early bound >>>> v>> >>>> ....then later >>>> >>>> Private Function GetAutoCADInstance() As AcadApplication >>>> Try >>>> m_AcadApp = >>>> Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication >>>> Catch ex As Exception >>>> End Try >>>> Return m_AcadApp >>>> End Function >>>> >>>> >>>> >>>> sorry but i don't see the implicit conversion >>> >>> What is the type of 'AcadApplication'? If it's 'Object', it could >>> be of any type. Did you consider this? Are you sure that >>> 'AcadApplication' >>> will _always_ be of type Autodesk.AutoCAD.Interop.AcadApplication? >>> If you are, then cast the object to that type before the assignment. >>> >>> >>> -- >>> Armin >> >> oh, i think i see what you mean... >> i should have had >> Private m_AcadApp as >> Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication = >> Nothing >> instead of... >> Private m_AcadApp As AcadApplication = Nothing >> ...is that what you mean? > > Not really. > > The type of the > 'Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication' > property (as I assume) should not be 'Object'. However, maybe this is out > of your control. In this case, read the documentation on the property > carefully. Maybe a cast ('DirectCast') is required to cast the returned > value to 'AcadApplication'. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://dotnet.mvps.org/dotnet/faqs/> mark
after debug "Can't write dll because a process has it open"
Changes not getting saved to data source return value, exit function Add inner control event. send the class type as a parameter. simmulate real rowEnter on DataGridView object. Update command to update field signing certificate error... Sending messages between windows Setting Event Log Size setting |
|||||||||||||||||||||||