UG Guru Posted October 18, 2005 Posted October 18, 2005 I'm trying to compile a vb file to a dll using the windows vbc.exe file I can almost get it to compile however a few commands come up with Name 'Function' is not declared. The functions are as follows: Mid Len InstrRev MsgBox vbcr Which assembly .dll file do I need to reference to get this to work. I already have the following references: System.Windows.Forms.dll system.dll I've tried referencing Microsoft.VisualBasic.dll as well but it tells me this is done as default. It looks to me like it hasn't as these look like old vb commands. Any help would be greatfully received. Quote
Leaders snarfblam Posted October 19, 2005 Leaders Posted October 19, 2005 You need to import the Microsoft.VisualBasic namespace. This is done as a project-wide import by default in the IDE. This is not the case when using the command-line compiler, so you must either fully qualify the function (Microsoft.VisualBasic.String.Len() [oddly enough, Microsoft.VisualBasic.Len() seems to work as well]) or import the namespace explicitly. Quote [sIGPIC]e[/sIGPIC]
UG Guru Posted October 25, 2005 Author Posted October 25, 2005 I would do that but I'm creating all my code in a text editor as I don't have visual studio. Quote
Administrators PlausiblyDamp Posted October 25, 2005 Administrators Posted October 25, 2005 At the top of the source file you can add the line Imports Microsoft.VisualBasic [code=visualbasic] Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.