473,387 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Using Comm dll file in vb.net 2003 error

gv
Hi all,

using vb.net 2003

Imported a com dll under Reference

Im trying to use one of the classes but keep getting an error:

"Object reference not set to an instance of an object."

Using it like this:

Dim getduration As String
Dim rd As BVEvent
getduration = rd.Duration
MessageBox.Show(getduration)

I tried changing this line to this, but gave same error and underlined rd:

Dim rd As New BVEvent

thanks for any help
GV
Nov 21 '05 #1
5 1028
"gv" <vi*****@musc.edu> schrieb:
Imported a com dll under Reference

Im trying to use one of the classes but keep getting an error:

"Object reference not set to an instance of an object."

Using it like this:

Dim getduration As String
Dim rd As BVEvent
getduration = rd.Duration
MessageBox.Show(getduration)

I tried changing this line to this, but gave same error and underlined rd:

Dim rd As New BVEvent


A runtime error or a compile time error? 'Dim rd As New BVEvent' should
work...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
gv
thanks for your help

thats what i thought but,

still underlines the rd with blue squiggly line?

thanks
GV
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
"gv" <vi*****@musc.edu> schrieb:
Imported a com dll under Reference

Im trying to use one of the classes but keep getting an error:

"Object reference not set to an instance of an object."

Using it like this:

Dim getduration As String
Dim rd As BVEvent
getduration = rd.Duration
MessageBox.Show(getduration)

I tried changing this line to this, but gave same error and underlined
rd:

Dim rd As New BVEvent


A runtime error or a compile time error? 'Dim rd As New BVEvent' should
work...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
You need to create a new reference to what you are needing to use:

Dim sClass As SomeClass

sClass.SomethingHere = SomeValue

' Object not set...

-----------------------------

Dim sClass As SomeClass

sClass = New SomeClass

sClass.SomethingHere = SomeValue

-----------------------------

Dim sClass As SomeClass = New SomeClass

sClass.SomethingHere = SomeValue

I think you get the idea

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #4
You may need to import the reference too

Imports SomeReference

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #5
"gv" <vi*****@musc.edu> schrieb:
thats what i thought but,

still underlines the rd with blue squiggly line?


Mhm... Doesn't it underline 'BVEvent'? If the namespace that contains
'BVEvent' is imported ('Imports <namespace>') and you are using 'As New'
your code should compile.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #6

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

Similar topics

1
by: Chetan | last post by:
Hi We have Oracle 8.1.7.4 and using .net framework 1.1 with Microsoft client. While executting the stored procedure we are getting an error message. Here is our code. here is the code that...
0
by: Jim dunn | last post by:
HI I am having problems with C# with regards to its compatibility with win32 API methods, I am trying to read from a windows CE comm port using C# and imported methods from coredll.dll, it seems...
1
by: Mike | last post by:
Sorry, don't know if this is the correct board for my question. I'm a novice so I guess I have a valid excuse My question : I'm using Visual C++ and I need to collect data from a serial port. ...
2
by: Paul Owen | last post by:
Hmm, nobody seems to want to answer any of my questions, but here goes again! I have a Detailview control that is bound to a data source. Within the Detailview control I have a number of...
6
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
8
by: mantrid | last post by:
Hello Im having problems working out why the following code does not work. I dont think its the sql as the error occurs on the first update which ever one is put there ($q1 or $q2). Ive swapped...
2
by: herat007 | last post by:
hi , i have developed a prog in vb to send sms , but i get an error error:8020 "Error reading from comm port" my prog for mscomm_oncomm() is Private Sub MSComm1_OnComm() Dim strMessage As...
12
by: mantrid | last post by:
Hello Can anyone point me in the right direction for the way to read a text file a line at a time and separate the fields on that line and use them as data in an INSERT to add a record to a mysql...
4
amitpatel66
by: amitpatel66 | last post by:
In real time applications, there is always a requirement to generate the data selected from database in XML format. using Oracle, generating XML Structured data becomes easier using the inbuilt...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.