Is N1 Actually Being Defined As A Variant
Jan 25, 2011in the line dim n1,n2 as integer...is n1 actually being defined as a variant ?
View 2 Repliesin the line dim n1,n2 as integer...is n1 actually being defined as a variant ?
View 2 RepliesFunction "SetUserName" is used to download the specified user's name data to the appointed terminal.
[Format]
BOOL SetUserName(
long DeviceKind,
long dwMachineNumber,
long dwEnrollNumber,
[Code]...
I'm having trouble using a COM based DLL in that one of the parameters is of type VARIANT.
The C++ definition of the structure is as follows:
typedef struct CSimData
{
DWORD dwSigId;
[Code].....
From debugging i've been able to determine that the COM server is getting no value in vValue. Is there some sort of Marshaling that needs to be done to be able to set that VARIANT up on my side so that it can use it?
I have been tasked to convert out VB6 program to VB.NET. In my research online everyone seems to say I need to go through my code and get rid of any Variants I have. I have had pretty good luck so far, but I am having an issue in replacing this one.
[code]...
I am still pretty new to VB (either 6 or .net) and I am having a hard time finding an alternative for this. Will the convert tool in VB.net handle this just fine? Or do I need to change this? If I do, is there a better alternative for this? Forgive my noobness.
I am creating a wrapper class in .NET (VB.NET as it happens but is equally related to C#) that is exposed to COM and one of the properties I am trying to wrap is a Variant. I thought I would just be able to use an Object, but I get an error: Public Property FieldValue([vFieldID As Object = -1]) As Object cannot be exposed to COM as a property 'Let'. You will not be able to assign non-object values (such as numbers or strings) to this property from Visual Basic 6.0 using a 'Let' statement.*
My property declaration looks like this:
Public Property FieldValue(Optional ByVal vFieldID As Object = -1) As Object
Get
[code].....
I want to extract a field (field name is variant, i.e. depend on what the user's choice) from a table using sql statement. How do I do that? Do I have to declare some variables?
View 4 RepliesI have a simple problem and I believe that the solution is with module using but I could not resolve it yet. Here is the scene:In Form1 I have a variant that gets its value from the selections of a listbox. The code is:OPtext) in Form2 because this selection from Listbox (in Form 1) should also trigger some events in Form 2. I tried to use a module and declare the variant using Public. I did this and I now can use the variant in Form 2. But the value selected in Form1 does not come to Form 2.
View 7 RepliesIn VB6 I could assign an Excel range directly to a variant array dim vArr as variant vArr = xlSheet.range("A2:A10").value and then work with vArr to pull out the values I needed. This doesn't work in VB 2010. Is there a replacement procedure to allow me to read in a range (perhaps large) all at once and then process the data without needing Excel?
[Code]...
I am trying to redirect command line output to a list box in a vba macro, and I've found some code that I think might point me in the right direction, but I keep on getting the same error. When I use this code [code]It gives me the error in the title and highlights the first declaration line.What does it take to define a new "process".
View 1 RepliesThe following code works fine in VBA Goal of the code is to find (select) all cells in an Excel worksheet where the backgrounf cell color is Yellow (6) or Rose (38)
Sub SelectColorsViaArray()
Dim e As Variant
Dim r As Range
Dim x As Range
[code]....
3) With the above, I still do not understand how to integrate the Variant and Array differences from VB6 to VB.Net. I know what to do with all other like: Application.FindFormat.Interior.ColorIndex ... etc.
I have some ActiveX that was written for VB6. They all seem to return Variant types. Ex.
[Code]....
In this case the GetPosition control is returning a robot axis position. It looks to me like the values coming back from the function is not getting converted to object type properly.
[Code]...
a messagebox appear that show user-defined type not defined i had try another code but it still same error.. i'm using vb6
Now I'm creating at app in VB (Microsoft's, Visual Basic 2010) which will be in full screen but I want to know if I can put all my content in the centre of the screen. At the moment it's at the far top, left of the screen. When the screen size varies I want it will stay in the middle for all shapes and sizes. Like :
<div style="margin: 0 auto; width: 500px;"></div>
But this is for web pages using HTML and CSS.
Why isnt this working?Sub Macro1()
[Code]...
i am trying to read an existing excel 2007 file from vb.net i used a form with single button and i written code in button click event code is :[code...]
View 1 RepliesI have some VB6 code that can't be modified easily that looks like this:
Dim cCount as Long
Dim rCount as Long
Dim result()
Set mx = CreateObject("Component.Class")
Dim rtn = mx.GetList(rCount,cCount,result)
The method it calls is currently a VB6 component that we've migrated to .NET with one issue. We're not sure what type the result() is looking for since it's a variant type. We've tried object, object[], object[][], string, string[], etc, none of which have worked.
Here's an example:
public bool GetList(ref long rCount, ref long cCount, ref object result)
{
...
}
I've even tried setting the third param to VariantWrapper since it will add ByRef as necessary:
public bool GetList(ref long rCount, ref long cCount, VariantWrapper result)
{
...
}
what I can set the incoming result to be so that I don't have an unhandled exception?I've created a test Interface (for COM), test Class, and test VB6 app to ensure it was an issue with the Variant. So, it's defined like so:
.NET Interface:
[DispId(1)]
[ComVisible(true)]
string Test(ref object[] value);
[code]....
I heard once that .net introduced an already defined delegate with no parameter that we could use instead of creating one.
View 1 RepliesI am trying to update some code. I have a vb file that begins with this...
Imports System.Data.SqlClient
Imports System.Data.Sql
Imports System.Data.SqlTypes
[Code].....
...and it accepts it. Why do I need to explicitly write out System.Data.SqlClient every time I use an object from that class???
I want to use a variable in a sub, but that variable is defined in another sub.It's like this:
vb
Private Sub Sub1()
Dim myVariable As String = "This is a variable"
[code].....
I'm currently having trouble declaring HttpUtility. I've tried a couple of things.
1. System.Web.HttpUtility.UrlEncode and find that I don't have that option
2. I've tried the code below and it gives me returnVale [code]
Error1Operator '&' is not defined for types 'String' and 'System.Exception'.L:\Programming\thingy\Mail.vb3720thingy
not much else i can think to add here but it's making it hard to work...i'm using it like...
Dim Temp As String = "Hello" & vbCrLf & "Hi Again"
I'm having an error on the red font ...it says operator '+' not defined for type dbnull and type dbnull [code]...
View 7 RepliesI have done a search for this and I am unable to find an answer. I am trying to write a sub routine to pull hardware information and display it in a text box.[code]...
View 3 RepliesThis is the code I am having trouble with.
CultureInfo As Any (this is where it said: Type 'Any' is not defined)
Dim string1 As String = "strWordGuessed"
Dim string2 As String = "StrWordToGuess"
[code].....
I work for a web hosting company and was handed a VB script which I apparently have to compile with some updated settings by 1 of our clients who knows less about it than I do. But when trying to compile the code I receive an error "'Enums.NoticeType' is not defined". As expected I haven't a clue. Am I missing some of the code, or do I have to add some libraries in my Visual Basic 2008 Express Edition? I have pasted the line of code below. If requested I can provide the whole script.
Code:
Public Function UpdateNotices(ByVal intNoticeID As Integer,
ByVal strNoticeTitle As String, ByVal dtDateFrom As Date, ByVal dtDateTo
As Date, ByVal intTypeID As Enums.NoticeType, ByVal boolPrimaryItem As
Boolean, ByVal boolActive As Boolean) As Int32
i am trying to save information in to my access database , i created new instance of an ADODB.Connection object and ADODB.Recordset object but visual studio 2005 is given me an error message that ADODB.connection and ADODB.Recordset are defined?
this is my code
Public Class Form1
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim str As String
[code]....
am trying to save information in to my access database , i created new instance of an ADODB.Connection object and ADODB.Recordset object but visual studio 2005 is given me an error message that ADODB.connection and ADODB.Recordset are definedthis is my code
Public Class Form1
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
[code]......
This is really more of an academic question, but where is this function defined? Within .NET, I'm used to working in an object oriented manner. However, if I define a VB.NET class as follows:
[code]...
Is MsgBox defined in a class? I am not required to reference a static class or inherit from another class. I'm not even required to import a namespace. I did find this link from msdn. But my question remains, where is this defined and how does the CLR just load up a function?
Public Shared Sub ControlCHandler(ByVal consoleEvent As ConsoleCtrl.ConsoleEvent)
If (ConsoleCtrl.ConsoleEvent.CTRL_C = consoleEvent) Then
System.Console.WriteLine("Got Control+C")
ServerInstance.StopService()
End If
End Sub
I have a service project with the above code and the ConsoleCtrl.ConsoleEvent is detected to be type not defined.What am I missing from the project?
I simply want to generate an example that duplicates the documentation of DataContractAttribute on .Net 4.0 windows forms application that is defined here:[URL]..When creating a new .Net 4.0 windows forms application and pasting the DataContractAttribute example into it, this compile error is generated:
"Type is not defined" for DataContract, DataMember, IExtensibleDataObject, ExtensionDataObject, DataContractSerializer. The MSDN documentation states that all of these should be available in the System.Runtime.Serialization namespace.
[Code]...