vb.net - How to solve code conversion issue? -


public function savecommentstreecomments(byref f system.windows.forms.form) integer     dim isnewsubcomment boolean     dim isnewcommentwithsub boolean     dim sql string     dim rs new adodb.recordset     dim commentid short     dim subcommentid short     dim index short     'wmb 1/28/2004 nextval     dim csql string     dim crs new adodb.recordset     dim cseq double      on error goto savecommentstreecommentserror      savecommentstreecomments = -1      if not validatecommentstreecomments(f)         savecommentstreecomments = -2         exit function     end if       if f.commentstext(commentstextabbreviation).enabled , f.commentstext(subcommentstextdescription).enabled         isnewcommentwithsub = false 

i getting error below above code while upgrading vb6 vb.net. don't know class missing.

'commentstext' not member of 'system.windows.forms.form'

you should change:

public function savecommentstreecomments(byref f system.windows.forms.form) integer 

to:

public function savecommentstreecomments(f yourformclassname) integer 

this changes 2 things, first f of right type , have commentstext property, field or function. secondly, when passing parameters default vb6 byref, when vb.net developed, realized mistake , corrected it, conversion not analysis necessary determine if byref required or not. since it's not necessary in case, should removed or changed byval.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -