By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,033 Members | 1,285 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,033 IT Pros & Developers. It's quick & easy.

Using Comm dll file in vb.net 2003 error

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
You may need to import the reference too

Imports SomeReference

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #5

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.