473,769 Members | 5,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

object conversion with option strict on

I'm using a 3rd party dll to retrieve some data (I have no choice in this!),
this returns an Object variable that I know contains an array of singles. The
following code works fine if I set option strict to off, but with it on I get
the error:
Option Strict On disallows implicit conversions from 'System.Object' to
'1-dimensional array of Single'.

Dim myValues As Object
Dim mySngArr() As Single

' code to retrieve myValues goes here
mySngArr = myValues ' this line gives the error w/ option strict on

My question is: how can I create the array of singles from this object with
option strict on?

--

Thanks, Jerry

Nov 22 '05 #1
0 1201

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

Similar topics

0
1144
by: JerryH | last post by:
I'm using a 3rd party dll to retrieve some data (I have no choice in this!), this returns an Object variable that I know contains an array of singles. The following code works fine if I set option strict to off, but with it on I get the error: Option Strict On disallows implicit conversions from 'System.Object' to '1-dimensional array of Single'. Dim myValues As Object Dim mySngArr() As Single
0
301
by: JerryH | last post by:
I'm using a 3rd party dll to retrieve some data (I have no choice in this!), this returns an Object variable that I know contains an array of singles. The following code works fine if I set option strict to off, but with it on I get the error: Option Strict On disallows implicit conversions from 'System.Object' to '1-dimensional array of Single'. Dim myValues As Object Dim mySngArr() As Single
4
6489
by: Nikhil Patel | last post by:
Hi all, I am a VB6 programmer and learning C#. I am currently reading a chapter on types. I have question regarding enums. Why do we need to convert enum members to the value that they represent? Thanks in advance... -Nikhil
3
3989
by: Rich | last post by:
Hello, I am converting an app from VB6 to VB.Net and have encountered the following problem. I have the following loop which retrieves objects from a collection of objects. Dim entry As Domino.NotesViewEntry Dim obj As Object, str1 As String .... For Each obj In entry.ColumnValues.ToString
1
3772
by: m830266 | last post by:
I'm trying to use the APAX serial I/O control (www.turbocontrol.com/AProZilla.htm) in a VB.NET project and I'm having trouble with its 'data received' events. The data is supplied by APAX as a variant which appears to VB.NET as a System.Object. I want to convert this to a System.Array so that I can iterate over its elements. The VB6 usage is described at www.turbocontrol.com/TechTips/20020426.htm. If I try something similar in...
2
1413
by: Carl Fenley | last post by:
Help a newbie out. I cannot seem to explicitly convert an Object to a Reflection.AssemblyCompanyAttribute type using DirectCast(). Turning Option Strict "Off" is not an option. Here is the Error: Option Strict On disallows implicit conversions from 'System.Object' to 'System.Reflection.AssemblyCompanyAttribute'. Here is the code:
2
2251
by: andycool1 | last post by:
I get the following error in my code when I set Option Strict to On: Option Strict On disallows implicit conversions from 'System.Object' to 'System.Drawing.Image' The blue error underline starts at "ResMan" and goes to the end of the line in this line of code: Dim i As System.Drawing.Image = ResMan.GetObject("logo.gif") ResMan is declared in another module as follows: Public ResMan As New...
3
1328
by: c676228 | last post by:
Hi all, I have the following code, without option Strict on, it seems work OK, but when option strict is on. I have a problem for the assignment. Dim ctrlarr(5) As PeopleInfo 'poepleinfo is user control in project Dim i As Integer If Not Session("ctrlarr") Is Nothing Then ctrlarr = Session("ctrlarr") End If It says option strict on disallows implicit conversion from 'system.object'
6
3674
by: Larry | last post by:
Hi All, I am in .NET 2003 I have a form and a toolbar on the form. When the user clicks on a button on the toolbar I call the following Sub I get a crash on the last line: tlbSearch.Buttons(0).Enabled = True ' Enable search
1
3720
by: =?Utf-8?B?QU1lcmNlcg==?= | last post by:
I have a strange situation with vb 2005 regarding option strict that looks like a compiler bug to me. Consider: Dim f1 As New Font("Arial", 8.25) Dim f2 As New Font("Arial", 8.25, FontStyle.Bold) ' f1 is ok with option strict on or off ' f2 is ok with strict on, but with off I get an overload resolution failure The complete diagnostic is:
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.