Public Class my_class
Public Sub my_sub()
Dim myvar as String
myvar = 10
Session("myvar") = myvar
End Sub
End Class
Then I have a ASP.NET page with a code-behind file, default.aspx and default.aspx.vb and I want to call my_class. I'm doing the following, but it doesn't work:
Imports System.Threading Public Class TestClass Private myClassThread As New Thread(AddressOf StartMyClassThread)
[code]....
The result:Application runs, no errors or exceptions.Displayed is the listbox and the Start button.I press the start button and a msgbox says "Not Invoked" as expected and upon clicking OK to that msgbox "Start Button Pressed" is added to the Output listbox control.Immediately following that the msgbox pops up again and says "Not Invoked". I was expecting "Invoked" as a separate thread is trying to use the Output listbox control.Of course this results in the Output.Items.Add being attempted which results in no visible result as the thread is not allowed to directly update the UI control.
i am having 2 class files a.vb and b.vb i have some public shared function in a.vb which i need to call in b.vb i have called it inthis way like the way i has called in normal .aspx pages in b.vb page i called the function of a.vb as
a.funcpwd("filedname") error BC30451: Name 'a' is not declared. </div>
I have a VB program that writes a batch file to allow me to run a line of the following format:java <my class file> [options]I then run the batch file using the Shell() routine in VB.When I do this it says it cannot find <my class file>. However if I run the same batch file from a dos prompt it works.why it works in a dos prompt but not in the Shell function?
This is probably a pretty dumb question but I am trying to use the BasicExcel class (from the CodeProject)and it is downloaded as a .cpp and a .hpp file. The project I want to use it in is in VB.NET.
I thought I just have to open the .cpp file in Visual Studio and save it as a vb class but it won't let me.
I can't seem to find a clear answer as to how to import the proper namespace for ReportingService [URL]. I tried to follow the instruction here [URL] but there is no Add Web Service option showing when I create a console application. There is a service account. Should I just use that instead?
I've created an add-in for outlook 2010.I have a ribbon that has a button on it. When you click that button, I want it to call a procedure in the ThisAddIn.vb.There are two files: ThisAddin.vb and Ribbon.vb.I've tried several things to no avail. I've also set all the procedures to public.
Call Testing123()
Call ThisAddIn.Testing123()
Etc
How do I properly call this procedure?
****Ribbon1.vb**** Imports Microsoft.Office.Tools.Ribbon Public Class MyOutlookTab[code].....
I have a code but cant get it to work. I have a .vb site with a namespace and a Class and a Sub.Then on my index.aspx site i cant to call this sub The 2 sites is in the root of my project, and the name of the project is CalendarWeek
My WeekController.vb is Imports System Imports System.Web.UI.WebControls.Calendar Imports System.Globalization
In order to call a java class in vb, I found the following procedure and I tried.
(1) create a java class (eg: MyTest .java)
as public class MyTest { public int myfunction(int value1, int value2) { return value1+value2; }
(2) compile to get a MyTest.class
(3)register Mytest.class using javareg.exe file from Microsoft SDK for Java using javareg /register /class:MyTest /progid:MyTest and see a MessageBox displayed with Succesfull register Class message
(4) copy MyTest.class to C:WinntJavaTrustlib
(5) open a New Project on Visual Basic. And paste this brief code on the Form Load event for example and run it. Set x = CreateObject("MyTest") MsgBox x.myfunction(1, 1)
I did all the above steps but when I run the vb program (Step 5), I get the error message "Cannot create ActiveX component". Unhandled Exception message.
Is there any way that a sub in class one can call the sub in class two?
In other words, I have a main class that instantiates objects from other classes, but I want one of those other classes to be able to 'talk back' to the main class without being polled.
I want to call the class radiostate by a button click on a form..Is this possible.. or should I rephrase it to say I want to call a function inside a class... either way im stuck.
I have been given an ASP.Net assignment at work because I had taken a few courses a couple of years ago. Currently, there are no ASP.Net programmers for me to ask here and I have searched several places (including Pro ASP Net book) to find a solution but have come up empty handed.
I have a class named spErrors which takes the values passed to it. Values passed include the offending page,function/sub, and other values and stores them in property values, then calls Response.Redirect("Errors.aspx") from the page's code behind page. In Errors.aspx, the values of the error/exception trapped in the Catch statement are displayed. This works fine from a web form. My question is, how do I call a web page from a class module?
Each class module has the ErrorHandler() procedure that passes these values to the class object. In the class, there is a Write Only property named Redirect and a method called Execute() which is used to display the error page if the error occurs in another class module. Since Response.Redirect() does not work in a class module, what namespace is needed in order for this to work?
Here is the code I'm using.
In the Catch block. Catch ex As Exception Err.Description = ex.Message ErrorHandler(Err, "function name")
essentially I need to create a class that houses the methods and then call the methods in the form but I can't seem to find out what the right code is to call it. I think there may be an issue with the conversion from a double to a string.
This is what I have for the Class
Public Class Aircraft Dim Names() As String = {"A-747", "A-737", "C-150", "D-240"} Dim TakeOffVelocity() As Double = {250, 264, 270, 240} Dim Acceleration() As Double = {33.5, 44.2, 37.1, 51.9}
I have a logging class that stores entries in a datatable dt. I then use SQLBULKCOPY to write that dt out to a sql table. Basic stuff. Problem is, I'd like to only call SQLBULKCOPY when there's say 50 entries in the dt. The problem is, what if I'm done (either intentionally or not, like if the code block that's using the log class throws an exception) with the logging object and there are still 15 rows in the dt?
I have to implement a COM class with VB.NET. An object of this class has then to be created from a VB6 DLL. The code for the COM dll is very simple:
Code: Public Class AdapterWrapper Implements SchemaCompInterfaces.IEFAdapter #Region "COM-GUIDs"
[code]....
Now when I'm running this code, I'm getting the Run-time error '13' Type mismatch in the CreateObject line. Late binding with
Code: Dim adapter as Object
seems to work for my test code, but is not a solution for me, because I can't change the proprietary VB6 code where the COM object is created. So somehow the interface "SchemaCompInterfaces.IEFAdapter" is not known... :sigh: In the project properties I checked the flag for registration with COM-Interop. Perhaps something to do with the ClassInterface?
I have a contact manager program and I would like to offer the feature to import csv files. The problem is that different data sources order the fields in different ways.I thought of programming an interface for the user to tell it the field order and how to handle exceptions.Here is an example line in one of many possible field orders:
Notice that in one data field "Name" there is a comma to separate last name and first name and in another there is not.My plan is to have a line for each field (ie ID, Name, City etc.) and a statement "import to" and list box with options like: Don't Import, Business>Join Date, First Name, Zip
and the program recognizes those as properties of an object...I'd also like the user to be able to record preset field orders so they can re-use them for csv files from the same download source.Then I also need it to check if a record all ready exists(is there a record for Anson Call all ready?) and allow the user to tell it what to do if there is a record(ie mailing address may have changes, so if that field is filled overwrite it, or this mailing address is invalid,leave the current data untouched for this person, overwrite the rest).
While I'm capable of coding this...i'm not very excited about it and I'm wondering if there's a tool or set of tools out there to all ready perform most of this functionality...
The project requires a form that has textboxes for a students name and the amount of books they have read, and a label where the points they have earned for their reading is displayed. Also a seperate form with About information and yet another seperate form for summary information.
I'm working on a base class right now, here's a basic rundown of it:[code]The problem is, in the Public Class bar example, some classes may implement MyInterface, and others don't. What I'd like to be able to do is have the sub New() in the structure in the base class "Foo" be able to tell if the class calling it (either the Base class, or the child class) implements MyInterface or not.
I have a Windows form Application that I am creating, could also be a Windows Service that I need to run.There are basically 2 Classes that were converted from java to vb.net and 1 xml file to this. for testing purposes I would like to use the Button.click event to manually run the code.However i get an error when trying to call the sub/function the normal way.I even tried to put this classes information in the Public Class Form1 but it keeps on giving me errors.This is the Sub:
Shared Sub Main(ByVal args() As String)
so how do I call it from a Button.click event?
normally i would just do a "call main()" and it works however this time it is not because of the (byVal args() as string)
I have a class as below in VB.NET. The issue is class calling itself. So vb.NET throwing Stock Overflow exception. But the same class is working fine in VB6 version of code in VB6.How to resolve this issue?
I am messing around with some Excel Automation just to get my feet wet and want to call some specific cells in my spreadsheet just for testing. I have one form in the project including a button. My question is how do I tell the button where to navigate to the cell to be tested?
My code for my Excel class is as follows: Public Class Waybill Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim oExcel As Object = CreateObject("Excel.Application") Dim oBook As Object = oExcel.Workbooks.Open("C:\TesterXL.xls") [Code] .....
control which will need to be reused in several forms in my program. It basically consists of several buttons in a panel. To start with, what I need to do is get the button values from the control into a text box on the first form. But I don't want to have a method calling the textbox directly from within the control, because then it won't be reusable in my other forms. Is there something I can do in VB like parentform.textbox.append for example, where you can generically call the methods of the form in which the control appears?
I have two forms Form1 and Form 2. I am passing a function with three values from Form1 and want the load event of form2 to trigger this function.. Basically I want to "paint" the values of qseq, midline and hseq on form2
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code].....
When I run this, nothing gets printed on form2 as when load event is triggered thee drawstring method is not called. how can I call drawstring from load method as drawstring takes in arguments and is called from Form1 class.
It is in the file ClientProfile I have placed in both App_Code and also App_Code/Models
In my code behind I have the following
[CODE]...
The last word, "ClientProfile" has the scary squiggly red line below it. It is not recognizing my class.Even the Intellisense is not picking up te class. Do I have to register the class file in any way?
I have this application which has one class. I need to return a recordset of data to the calling form. If i use Properties to return, it can only return only a single value at a time. Right now i'm returning a datareader object with one of the properties.Can anyone suggest a better way to return multiple rows of data to the calling method via Class Property?