"Kristian Frost" <kf****@gmail.comwrote in message news:op***************@rndskycomwin.domain...
I know we're only working with pseudocode here, but is the problem that
you haven't called your constructor?
I've dug out the one time I ever used a COM object in VB6, and the code
there says, basically:
dim namedCOMObject as COMObject
namedCOMOBJECT = new COMObject
If you're calling methods to the COM object directly, they may work
without you having an instance of the object, but if you want to use
information from an instance of the object, I'm fairly certain you have to
spread constructing it over two lines, as above.
I'm only a student though. I might be talking nonsense
KF
On Wed, 06 Sep 2006 15:28:56 +0100, Peter Piry <pe********@reflex.at>
wrote:
>
"Phill W." <p-.-a-.-w-a-r-d@o-p-e-n-.-a-c-.-u-kwrote in message
news:ed**********@south.jnrs.ja.net...
>Peter Piry wrote:
>>I've writte a DLL in VB.NET which is called from VB6.
When I try to call some methods of the DLL in a sub Procedure I get
the following error: "Object reference not set to an instance of an
object."
Do you get this error on /some/ methods, or on *all* of them?
>>But when i try this, I get an error:
Sub Main
Dim myDLL as new Wrapper.Wrapper
Call callMethodFromDLL
End Sub
Sub callMethodFromDLL(ByRef myDLL as Wrapper.Wrapper)
'here i get the error
What error???
/You've/ seen it - /we/ haven't ...
>>myDLL.CallMethod
End Sub
Are you /sure/ that's where the error is?
The above code won't even compile.
callMethodFromDLL requires one argument - a reference to your Wrapper
object. According to the above, you haven't supplied one.
yes, sorry, i've forgotten to write the Argument. The right line: Call
callMethodFromDLL(mydll). i have this line in my code.
> Sub Main
Dim myDLL as new Wrapper.Wrapper
Call callMethodFromDLL( myDLL )
End Sub
HTH,
Phill W.
Hi,
I've solved the problem. It was a writing protection on the document, which the sub procedure opens.
Mysteriously it works at the first time.
br
Peter