|
-
Jan 12th, 2004, 03:51 PM
#1
Thread Starter
Addicted Member
Modifying code at runtime?
Is there any way I can modify a procedure at code-level at runtime? Purpose of this would be maybe insert/execute Vb-code written in a textbox or something
-
Jan 12th, 2004, 04:02 PM
#2
Sleep mode
Why would you do that ? Are you really out of thoughts and can't write that code and compile it . I mean , you need to build your own compiler .
-
Jan 12th, 2004, 04:14 PM
#3
It'll probably be easier to load the code you need from a compiled assembly and just have the procedure dynamically choose from that what to execute. This is pretty standard plugin type activity. What specifically are you having trouble with?
-
Jan 13th, 2004, 10:40 AM
#4
Thread Starter
Addicted Member
No the thing is that I am writing an application where the users will be able to write their own mathematical algorithms. I've done this in vb6 and there I used vbscript through Microsoft Script Control. Using this control it's easy to evaluate and execute code written in a textbox. The problem is I can't use this component in .NET so I am thinking of another way. Are you getting my problem correct?
-
Jan 13th, 2004, 10:56 AM
#5
Sleep mode
Sorry I've never tried this before but why don't you import this component and use in .NET ?
-
Jan 13th, 2004, 02:00 PM
#6
Thread Starter
Addicted Member
as i just said, I can't. i get the message "Assebmly could not be converted"...
-
Jan 13th, 2004, 02:30 PM
#7
How did you try and add the control? I just added it to a project and it went fine. You should be adding it to the Toolbox on the left hand side. Right click on the tab you want to put it in and click 'Add/Remove Items...'. Then switch to the COM Components tab and check the box next to the 'ScriptControl Object'. Then hit ok and it will be in the Toolbox and from there it should work like any other control.
-
Jan 13th, 2004, 02:35 PM
#8
Thread Starter
Addicted Member
yeah, adding it to the toolbox works fine but try placing it on a form. I get an error message saying:
"Converting the library to a .NET assebmly failed. Exception from HRESULT: 0x80131019"
-
Jan 13th, 2004, 02:43 PM
#9
Hmm still worked fine for me. I added one to my form and there was no trouble. I didn't actually try using it for anything but the app did compile with one sitting on the form. This may also help:
http://getdotnetco.web101.discountas...wnloadPage.htm
-
Jan 13th, 2004, 02:47 PM
#10
Thread Starter
Addicted Member
thanks for the download! that example works fine. i wonder why my dll doesn't work. it still works in vb6. I might just use the dll shipped in the zip instead.!
thank you!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|