Passing Url Based Argument
Mar 27, 2011
I have written an application to register a url type extension at startup so in short if user inputs dld:// in any browser it loads my app now, what I want to do I want to somehow move a bit further like if user goes dld://about the application loads and shows the about page
View 5 Replies
ADVERTISEMENT
Jan 14, 2012
In VB.NET, can we pass an original object as an argument without instantiating it? For example, I have two forms in my project formA and formB. Now I have this code.
[Code]...
Apart from this, in VB.NET in any class like formA, if I type formA, I can see all the objects and controls present there but not in C#. Again, I have to make a new instance to see all the controls. This becomes a problem if I want to manipulate two running and working instances with each other. So what basic thing am I missing here?(I am an amateur programmer migrating from VB.NET to C#. Things are going nice and clean expect for the ones I've recently figured out.)
View 3 Replies
Aug 12, 2010
I'm using VB.NET 2003 with .NET Framework v1.1. I know it's getting a bit old now but I'm stuck with an existing program and don't have the time/knowhow to convert it to anything newer.
My question would probably be solved very easily with Generics in .NET 2.0 but as I can't use that right now, I'd like to know if the following is possible:
I have a load of manager classes which inherit from DictionaryBase and hold collections of my custom classes. For example, I have a Employee class, a Batch class, a Supplier class, etc... and each of these has a Manager classwhich holds a collection of them - eg: my PlantTrayMgr class holds collections of PlantTrays, etc..
I have one particular form where I have to populate loads of comboboxes with the contents of various Manager objects. What I currently do in my form load event to populate comboboxes is this:
Code:
Option Strict On
Option Explicit On
Private _plantTrayMgr As PlantTrayMgr
[Code].....
View 4 Replies
Mar 7, 2010
In my vb.net code I want to call a dll file created by Qt4.
Now everything works fine untill and unless I pass some string argument to the function.
Here is the function in dll file:
const char* QtEngineDll::randInt(char url[])
{
QString result;
/*QTextCodec *codec = QTextCodec::codecForName("UTF-8");
[Code]....
When the function returns some constant value, say if i put result = "Abhijit" then it returns the value properly. But if I want result to return value url the it is returning some garbage values.
View 8 Replies
Feb 1, 2010
I have a DLL written in fortran that I know works because I am getting it from a working software package that we use daily. I am trying to call it from anything but am having problems i believe with passing the correctly formatted arguments in and out of it, so i decided to try and access it from a VB program. I chose VB because I have contacted the developer of the software package we are using and he gave me his DLL function call in VB6, even though he is not allowed to show me the FORTRAN source.
Problem is (perhaps, i think) that I am writing in VB.NET, which has different data types than VB6. Can anyone see why i am am having problems. The error i get upon running is: "AccessViolationException was unhandled: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
[Code]...
View 3 Replies
Jan 5, 2009
I'm designing an interface using visual basic .NET with visual studio tool. In my program I have to call an extern .exe using the function shell() and pass a FileName to it. The problem is that what it passes to the executable is never the file path. My code is this one and I think it should work but I don't know why, it doesn't.
Public Class FormMain
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[code].....
View 15 Replies
Feb 28, 2010
When I try to do the same in .net the "array argument" value of the second sub is either Nothing or I get an error saying "Value of type 'String' cannot be converted to'System.Array'."I've tried converting the array to a system.array but it will not hold all the Types of data it needs to hold. (I tried 3 days ago and don't remember what Types would cause an error. My 1st value is a string and the second is an integer and this caused some error.)
View 1 Replies
May 18, 2012
is there a way i can do like this in vb.net
[Code]...
what i want is that idx keeps incrementing after each line, without incrementing it on a seperate line.
View 1 Replies
Sep 16, 2010
I have an old unmanaged dll function and I want to pass an array to it.The dll function expects the array to be passed by reference.Sometimes I can do that and sometimes I need to pass a pointer in a variable.Is it possible to override the declare for the function so that I could pass either the array by ref, or a pointer to it if I need to?
View 15 Replies
Dec 15, 2011
I am a beginner using Visual Studio Express 2010 to create a small console app to use as a utility accompanying another primary app that can pass a command line to the utility. I would like to set it up so that the utility will not run independently but only run and load its only form (Form1) if it is launched by the primary app using a "/run" command line parameter. (I can set up the primary app to launch and pass a command line parameter. I need help with the utility's code.)
The utility already has some VB code, so I need to figure out what code to add to receive and act on the " /run" command line and even more challenging for me, where to place this new code so it works.
pseudo-code:
initial event to read the command line, then if it is " /run" load Form1, else do not open and run utility app.
View 13 Replies
Jan 15, 2012
my current solution as you can see is by using shared variable within a class in order to pass a value.
on the form load of my application i called: workerSample.RunWorkerAsync
Dim finalList As List(Of String)
Private Sub workerSample_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles workerSample.DoWork
[Code].....
View 1 Replies
Apr 20, 2011
Im trying to pass a array as a argument to a Javascript function from code behind(vb.net)
Code im trying
[code].....
View 2 Replies
Jun 21, 2012
I can't get to pass structure as argument through subs/functions in different files of single vbnet project like I use to in earlier MS basic versions.[code]File "mysetup.dat" is reachable and data is saved correctly what I can see with HxD.But read part seem's to not work as expected. Please any help on reliable passing structure as argument without too much public elements based on upper example.
View 1 Replies
Mar 23, 2010
VB.NET is not letting me dance with both feet, or piss with both hands. I've got one foot and one arm tied behind my back at every turn. I want to use this statement in a function:
Return CType(Formatter.Deserialize(FS), DS)
Seems doable, right?
Function ReadFileStream(ByRef FS As FileStream, ByRef DS As Object)
Dim Formatter As New BinaryFormatter
FS.Position = 0
Return CType(Formatter.Deserialize(FS), DS)
End Function
Right? I mean, CType only accepts a class name as the second argument. I can't give it an instance of a class, or it croaks. Yet if I try to pass the class name as the argument to that function:
DataInfo = ReadFileStream(FileStream1, DataStruct)
VB.NET croaks on this, too, complaining that "'DataStruct' is a type and cannot be used as an expression.". It's used as an expression by CType just fine outside of the function. Does the VB.NET legislature provide a clause that allows for a 'Type' to be passed as an argument in a function? Writing all the supporting code ten million times to deserialize a file using CType ten million times in a large application will get very complicated and tricky very quickly. It should be handled by a routine so that any cases and adjustments that come up can be dealt with in one spot.
View 8 Replies
Nov 1, 2011
I get this error when clicking on any of the letter buttons in my repeater. The sql statement I have works in sql server, but on my page it just errors out. The only thing that is different is that in sql server I change '@CompanyID' to an actual ID and '{0}' to 'a' so the query will run. All the posts I have found online with this problem say something about this-->{0}, but I don't see anywhere that I might be trying to pass more than one argument or have this wrong.[code]
View 1 Replies
Jan 27, 2011
I have a class and method exposed to a client asp.net app. The class looks like
<DataContract()> _
Public Class Class1
Private v_string As String
Private v_integer As Integer
[code]....
The method is declared as
<OperationContract()> _
Function GetStuff(ByVal bar As Class1) As String
In the client code I create an instance of Class1 and set the values for v_string and v_integer, but using Wireshark to look at the xml being sent to the server only a value for v_string is being sent as part of Class1. I'm guessing this is because it considers the value of v_integer to be null/not set. Here is an example of the client code.
Dim MyService as New Service1.ServiceClient
Dim test as New Service1.Class1
test.P_integer = 1
[code]....
how different types are passed/used since Integer is a intergral type and String is a class, but can't seem to work out what to do to fix the problem.
View 4 Replies
Feb 2, 2012
I created a .NET application that reports to a log file the contents of a registry key. My code works perfectly but it is choking on one of the string values found in the registry. The code that works normally is below.
[Code]...
View 8 Replies
Apr 18, 2009
Sub Users_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Users.Click
Dim fmtstr As String = "{0,-15} {1} {3}"
[code]....
View 3 Replies
Oct 12, 2011
I have the following VB function which takes a FileInfo object as a parameter:
Public Shared Shadows Sub Start(ByVal filePath As FieldInfo)
XmlConfigurator.ConfigureAndWatch(New System.IO.FileInfo(filePath.ToString()))
End Sub
In another class I have the following code calling that 'Start' method. But VisStudio indicates there is a problem with the 'FilePath' argument that I'm passing.
[Code]...
View 1 Replies
Dec 5, 2011
I made this procedure re-use a select query:
[code..]
And I use it like this if I would want the selected value placed in a textbox and it works fine
[code...]
However if I want the value to be passed in a string like so:
[code...]
The string ends up having an empty string value. How do I assign the value I queried to that String?
View 2 Replies
Apr 6, 2011
I am creating a project in VB.NET in which one of the reports require that the name of employees should be displayed as column names and whatever work they have done for a stated period should appear in rows below that particular column.Now as it is clear, the columns will have to be added at runtime. Am using an ODBC Data source to populate the grid. Also since a loop will have to be done to find out the work done by employees individually, so the number of rows under one column might be less or more than the rows in the next column.Is there a way to create an empty data table and then update its contents based on columns and not add data based on addition of new rows.
View 1 Replies
Feb 9, 2011
1) is vb6 is interpreter based languge or compiler based or both interpreter and compiler based language?
2) is VB.Net interpreter based languge or compiler based or both interpreter and compiler based language?
3) if any of above mentioned is both interpreter and compiler based so tell me please when it compiles and when it interprets?
View 6 Replies
Feb 24, 2011
In a vb 2010 project, I have 2 win forms: Form1 and Form2.
In the Form1 class there is a server-based timer: when the "elapsed event" fires, then I update the text of a Label1 on the Form2. A very simple code:
View 13 Replies
Feb 15, 2012
FORTRAN allows one to use a procedure (function or subroutine) as an argument to another procedure. For example:
SUB Procedure1(x)
----
----
RETURN
[code]....
Does Visual Basic 2010 allow this functionality, directly or indirectly?
View 9 Replies
May 4, 2009
I have a sub declared inside a module which accepts form as argument.
sub display(fname as form)
What I need is to call the sub form the load event of a form.I tried the following.
display(me)
But cant access the controls of the form inside the sub.
sub display(fname as form)
fname. 'no controls of the form are listed?????????????
end sub
View 6 Replies
Nov 9, 2009
Hi. The assignment reads code the application using an idependent sub procedure to both calculate the display the bonus amount. Also use a sub procedure to clear the contents of the bous label when the text change event occurs. In addition code each texts box enter event procedure. When I call the calcbonus, it says argument is not specified for the parameter.
' Project name: Bonus Calculator Project
' Project purpose: Calculate a 10% bonus
' Created/revised by: Jessica Falcetta on 11/07/09
[code]....
View 4 Replies
Apr 4, 2009
error BC30455: Argument not specified for parameter 'pTools' of 'Public FunctionfragPacket(ByRef pTools As Object) As Integer'.!I get this code while trying to get something to work.. heres the code
if (pName.Length >= 13) andalso (pName.SubString(0,13) = "actor_display") then
dim aid as Integer = pTools.FourByteToNum(pBytes,2)
if (aid <= 4000000) and (aid <> ownAID) then
[code].....
View 5 Replies
Jul 16, 2011
Argument Not Specified For Parameter. [code]...
the error show to me in this line (( Adddata(TextBox1.Text, TextBox2.Text.ToString, TextBox3.Text.ToString, TextBox4.Text.ToString, TextBox5.Text.ToString) ))
View 2 Replies
Jan 5, 2011
I am currently working on a sample Invoice application. I have created a product class with a constructor and various methods and properties. In my form class I have added dim statements to create variables to hold my product objects and other various objects I have created.[code]....
View 4 Replies
Jun 3, 2012
A fast-food vendor sells pizza slices ($1.75), fries ($2.00), and soft drinks ($1.25).Write a program to compute a customer�s bill.The program should request the quantity of each item ordered in a Sub procedure, calculate the total cost with a Function procedure, and use a Sub procedure to display an itemized bill. A sample output is shown in Fig. 5.26.Coded it out but when I try to break it down to separate functions I keep getting:
Error1Argument not specified for parameter 'CalculateFries' of 'Public Function CalculateTotal(CalculatePizza As Double, CalculateFries As Double, CalculateSoft As Double) As Double'.
Error1Argument not specified for parameter 'CalculatePizza' of 'Public Function CalculateTotal(CalculatePizza As Double, CalculateFries As Double, CalculateSoft As Double) As Double'.
[code].....
View 5 Replies