how can one compile vb code into dll?

G

gg

how can one compile vb code into dll?

The vstdio build project it tends to build exe. When I looked at the build
in help I did not find anything about configuring for DLL. I even try
custom build but did not see anything like dll.

When I looked at the command line tools and sample, I only saw c code not
vb. for dll

the environment I have is
V7.1.3
ms .net frame work 1.1.4322
Installed products: ms vb .net

I would very much appreciate help. even if only a push towards some
documentation will help greatly
 
A

Armin Zingler

gg said:
how can one compile vb code into dll?

The vstdio build project it tends to build exe. When I looked at
the build in help I did not find anything about configuring for DLL.
I even try custom build but did not see anything like dll.

When I looked at the command line tools and sample, I only saw c
code not vb. for dll

the environment I have is
V7.1.3
ms .net frame work 1.1.4322
Installed products: ms vb .net

I would very much appreciate help. even if only a push towards some
documentation will help greatly


http://msdn.microsoft.com/library/en-us/vbcon/html/vbconClassLibraryTemplate.asp


Or, after creation of an Exe project, change the "output type" in the
project properties:
http://msdn.microsoft.com/library/en-us/vsintro7/html/vxurfgeneraltab-projectpropertiespage.asp

Armin
 
C

CT

I'm not sure which edition of VB .NET you have and if your edition allows
you to create class libraries, which will result in a DLL assembly and not
an EXE assembly. When in the IDE, check the properties for your project and
try changing the project type to a Class Library.
 
L

Larry Lard

gg said:
how can one compile vb code into dll?

The vstdio build project it tends to build exe. When I looked at the build
in help I did not find anything about configuring for DLL. I even try
custom build but did not see anything like dll.

When I looked at the command line tools and sample, I only saw c code not
vb. for dll

the environment I have is
V7.1.3
ms .net frame work 1.1.4322
Installed products: ms vb .net

I would very much appreciate help. even if only a push towards some
documentation will help greatly

In the New Project dialog, choose the 'Class Library' template. This
sets the Output Type, found on the General page of the Project
Properties screen to Class Library, which in turn sets the output file
to be a DLL rather than an EXE.
 
H

Herfried K. Wagner [MVP]

gg said:
how can one compile vb code into dll?

The vstdio build project it tends to build exe. When I looked at the
build
in help I did not find anything about configuring for DLL. I even try
custom build but did not see anything like dll.

When I looked at the command line tools and sample, I only saw c code not
vb. for dll

the environment I have is
V7.1.3
ms .net frame work 1.1.4322
Installed products: ms vb .net

Creating class libraries with the Standard edition of Visual Basic .NET
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=standardclasslibraries&lang=en>
 
C

Chris Dunaway

Create a ClassLibrary project. That will compile to a .dll. Or from
the command line compiler use the /target:library
 
H

Herfried K. Wagner [MVP]

Chris Dunaway said:
Create a ClassLibrary project. That will compile to a .dll.

Yeah, but the Standard Edition of VB.NET neither includes this template nor
does it support setting the output type in the project properties to "Class
Library".
 
G

gg

Thank you. that was very helpful documentation I sorely need.
Thanks for everyone else being so helpful too
 
G

gg

OOPS, could not find vbc anywhere!
Of course, there is no class library template in my standard version of
dotnet 2003
Worse, changing output type in the vbproject does not do anything either.

For a while I thought I got an easy solution for the standard edition of dot
2003 with vbc.exe.

Looks like I have to do some digging ( so far no luck with google nor msdn)

Help!
 
R

Robert S. Liles

Go to the directory where your source files are. Find a file named with
your source name, but without an extension, it will be labelled a "Visual
Basic .NET Project". Open that file with Notepad. Find the line with
"Output type" in it. Change the text following it to "Library" and and save
it. You are done.

Bobbo
 
A

Armin Zingler

gg said:
OOPS, could not find vbc anywhere!
Of course, there is no class library template in my standard
version of dotnet 2003
Worse, changing output type in the vbproject does not do anything
either.

For a while I thought I got an easy solution for the standard
edition of dot 2003 with vbc.exe.

Looks like I have to do some digging ( so far no luck with google
nor msdn)

Help!



vbc.exe is part of the .Net Framework somewhere @
c:\windows\microsoft.net\framework....


Armin
 
R

Robert S. Liles

Something I think we all forgot to add, in addition to setting "OutputType"
to "Library" instead of "WinExe" or "Exe", set "StartupObject" to "". If
you do BOTH of these, it really SHOULD work. It works fine for me. If it
still won't work, email me. I was doing this so often that I wrote a VB
program to do it for me. I can email the program to you as an attachment.
You run the program then pick the solution you want as a DLL. The program
then makes the changes for you.

Bobbo
 
G

gg

Great! I found it. I will give that a shot.. thank you

I was looking at the custom install <sdk> directory forgetting the windows
directory!

Btw, is there anything I should watch out for if I want non.net app and
possibly some third part non Microsoft C based app to access the functions
in the dll for my custom functions

for example

mystringclass.vb has

public class mystringclass
......
public function myfcn(byRef strIn as String, byVal istart as Integer,
byVal iend as Integer, ByRef iFoundPos as Integer() ) as string()

End function

....
end class
 
A

Armin Zingler

gg said:
Great! I found it. I will give that a shot.. thank you

I was looking at the custom install <sdk> directory forgetting the
windows directory!

Btw, is there anything I should watch out for if I want non.net app
and possibly some third part non Microsoft C based app to access the
functions in the dll for my custom functions

for example

mystringclass.vb has

public class mystringclass
.....
public function myfcn(byRef strIn as String, byVal istart as
Integer, byVal iend as Integer, ByRef iFoundPos as Integer() ) as
string()

End function

....
end class



The language must be based on the .Net Framework. Or wrap the assembly as a
COM component if the other language is able to access COM components.

Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top