Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • Leaders
Posted
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.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...