473,378 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How do you get .vb file to compile

I have the following class in my VS 2008 Web Site project that has a
namespace of

MyFunctions.

*********************************
Imports System
Imports System.Text.RegularExpressions

Namespace MyFunctions

Public Class BitHandling

'*----------------------------------------------------------*
'* Name : BitSet *
'*----------------------------------------------------------*
'* Purpose : Sets a given Bit in Number *
'*----------------------------------------------------------*
Public Shared Function BitSet(ByVal Number As Integer, _
ByVal Bit As Integer) As Long
If Bit = 31 Then
Number = &H80000000 Or Number
Else
Number = (2 ^ Bit) Or Number
End If
BitSet = Number
End Function

'*----------------------------------------------------------*
'* Name : BitClear *
'*----------------------------------------------------------*
'* Purpose : Clears a given Bit in Number *
'*----------------------------------------------------------*
Public Shared Function BitClear(ByVal Number As Integer, _
ByVal Bit As Integer) As Long
If Bit = 31 Then
Number = &H7FFFFFFF And Number
Else
Number = ((2 ^ Bit) Xor &HFFFFFFFF) And Number
End If

BitClear = Number
End Function

'*----------------------------------------------------------*
'* Name : BitIsSet *
'*----------------------------------------------------------*
'* Purpose : Test if bit 0 to bit 31 is set *
'*----------------------------------------------------------*
Public Shared Function BitIsSet(ByVal Number As Integer, _
ByVal Bit As Integer) As Boolean
BitIsSet = False

If Bit = 31 Then
If Number And &H80000000 Then BitIsSet = True
Else
If Number And (2 ^ Bit) Then BitIsSet = True
End If
End Function

End Class

Public Class Strings

'*----------------------------------------------------------*
'* Name : StripHtml *
'*----------------------------------------------------------*
'* Purpose :Strip HTML tags from Text *
'*----------------------------------------------------------*
Public Shared Function stripHTML(ByVal strHTML As String) As String
'Strips the HTML tags from strHTML

Dim strOutput As String
Dim objRegExp As New Regex("<(.|\n)+?>", RegexOptions.IgnoreCase)

'Replace all HTML tag matches with the empty string
strOutput = objRegExp.Replace(strHTML, "")

'Replace all < and with &lt; and &gt;
strOutput = strOutput.Replace("<", "&lt;")
strOutput = strOutput.Replace(">", "&gt;")

stripHTML = strOutput 'Return the value of strOutput
End Function

End Class

End Namespace

**********************************

In my default.aspx.vb I have:

Imports MyFunctions

But I am getting an error:

*************************************************
Namespace or type specified in the project-level Imports 'MyFunctions'
doesn't contain any public member or cannot be found. Make sure the
namespace or the type is defined and contains at least one public member.
Make sure the alias name doesn't contain other aliases.
*************************************************

When I added "Imports", Intellisense didn't have MyFunctions in the list
even when the .vb file was in the root or App_Code folder.

But the above, namespace does exist and has public members (all of which
give me errors in my code saying that they are not declared?

I then tried to manually compile the program using a makeBitHandling.bat
file, which also didn't seem to work as it did in VS 2003. This is the
actual file I used in my VS 2003 project:

vbc /t:library bitHandling.vb /r:system.dll
attrib ..\bin\bitHandling.dll -r
copy bitHandling.dll ..\bin\*.*

But it doesn't seem to read it correctly. I get the following error:

???vbc' is not recognized as an internal or external command,
operable program or batch file.

Where the ??? are actually strange characters.

Not sure what the prefix characters are but if I copy the lines and paste
them into the console, it works fine and puts the .dll file into the bin
folder that I created.

Now when I type in:

Imports MyFunctions

It recognizes it. When I type it "Imports ", Intellisense shows MyFunctions
in the list - so it does see it.

but all the functions: BitClear, BitSet and BitIsSet all show as undefined.
And you can see the class below where all the functions are private.

Why doesn't the program see them????

Can't I get the VS 2008 to compile the .vb files?

Do they have to be aspx.vb files?

Thanks,

Tom

Sep 13 '08 #1
0 1062

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Omid | last post by:
Hi. I have problems when I try to redirect everything that is sent to cout to a file. I have one piece of code that works and one that does not work. The only difference is which headers I use....
4
by: Frank | last post by:
Could someone tell me how to open a file at run time that I didn't know the name of at compile time? I know how to open a file at compile time when I know what the name is going to be. FILE...
4
by: veereshai | last post by:
i want to copy the functions from my source file into a new file...and convert each function into a new object file by compiling it. now, i want to invoke the function using the object file i have...
6
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked...
10
by: ptass | last post by:
Hi In asp.net 2.0 an aspx files .cs file is a partial class and all works fine, however, I thought I’d be able to create another class file, call it a partial class and have that compile and...
9
by: Anubhav Jain | last post by:
Hi, I am having few .net source files(.cs or .vb) and I want to dynamically generate the corresponding .net project file(.csproj or .vbproj) for them without using visual studio.So that I could...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
5
by: Torben Laursen | last post by:
Hi Often I just want to compile one c++ file in a project the check it for errors. Now I can right click on a *.cpp file and select "Compile" But is there a way and short cut to compile a file...
8
by: Jeff | last post by:
I have a db that has a couple of times closed Access completely when Saving work. So I usually compact and decompile and this seems to fix the problem. But not his time. It has come back again....
17
by: Michael A. Covington | last post by:
I had a lot of code in Form1.cs, so I moved some of it into another file, Form1Op.cs, which is still a partial class of Form1 : Form. Whenever I open Form1Op.cs, it wants to open in Form Designer...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.