Re: Class not getting built

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I did try to run a makeBitHandling.bat file from the console and put the
..dll into a bin folder that I created which is how I did it in VS 2003.

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

The .bat file wouldn't work correctly. It gave me the error:

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

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.

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????

Thanks,

Tom


"tshad" <tfs@xxxxxxxxxxxxxx> wrote in message
news:ewW2dVdFJHA.3288@xxxxxxxxxxxxxxxxxxxxxxx
I need to find out why this is not compiling.

I can't go any further without it. I am getting "not defined" errors for
all the functions in this class.

This is just a class not an aspx.vb page. And it is included in the
project.

It is a very simple Web Site project with very little in it at this point.

It has the App_Code, Images, and CSS folders and default.aspx is in the
root.

I have put my BitHandling.vb in the root and in the App_Code folder and it
seems to ignore it.

Why is that?

Thanks,

Tom

"tshad" <tfs@xxxxxxxxxxxxxx> wrote in message
news:uEpckkWFJHA.4260@xxxxxxxxxxxxxxxxxxxxxxx
I have the following class in my VS 2008 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.
*************************************************

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 tried putting this file in the root as well as the under a folder
called "Classes" as I had it in my 2003 project and I also tried putting
it in the App_Code folder. None of which worked.

What am I missing?

Thanks,

Tom







.



Relevant Pages

  • RE: Can some please explain about code regarding authentication
    ... > Imports System.Security.Permissions ... 'The FormatMessage function formats a message string that is passed as ... 'The GetErrorMessage function formats and then returns an error message ... Public Shared Function GetErrorMessageAs ...
    (microsoft.public.dotnet.general)
  • Re: How does a VB.Net program access a share?
    ... Imports System.Runtime.InteropServices ... Public Class Impersonation ... Public Shared Function LogonUser(lpszUsername As String, ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: About files
    ... System.IO is great for most handling of the file system. ... Imports System.IO ... For Each Filename as String in Directory.GetFiles ... >> to copy the files from one folder to another folder. ...
    (microsoft.public.dotnet.languages.vb.controls)
  • Re: Icon files
    ... add the icon and set the build to "embedded". ... >> Imports System.Reflection ... >> Public Shared Function GetIcon(ByVal IconName As String) As Icon ... >> Public Shared Function GetImageAs Bitmap ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Icon & embedded resource
    ... Imports System.Reflection ... Public Shared Function GetIcon(ByVal IconName As String) As Icon ... Public Shared Function GetImageAs Bitmap ...
    (microsoft.public.dotnet.languages.vb)