查看单个帖子
旧 2009-04-13, 08:45 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】addin in vb.ne

addin in vb.net
for those who write addin in vb.net
do you turn "option strict" on or off?
if it's on, then
swapp = ctype(createobject("sldworks.application"), sldworks.sldworks)
instead of:
createobject("sldworks.application")
thx, chris
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
option strict just prevents automatic explicit casting of objects. by default c# and other languages have to cast objects to the correct type, the exception is vb. if you turn the option on vb does not do it automatically so you have to cast it to the correct type.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)