473,386 Members | 1,803 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,386 software developers and data experts.

Late Binding produces DISP_E_MEMBERNOTFOUND when returned from a function

I converted a large VB6 ap to VB.NET 2005.

I have found that a Late Binding works in VB6 but not in VB. NET when a Function is used.

Ex.

Select Case Type
case 1
LineObj = Type1
case 2
LineObj = Type2
end Select

The below works without a problem
LineObj.itemref.fullname.setvalue(mItem)


But the below fails after it does it FindMe 438 Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))
QBSetVal(LineObj.ItemRef.fullname, mItem)

QBSetVal does some checking and eventual does a
pObj.setvalue(mItem)

Public Function QBSetVal(pObj,.....)
pObj.setvalue(mItem)

And the value IS SET properly but when control to returned back to the caller after the RETURN it gets the MEMBER NOT FOUND.

I do not understand how it can set the variable properly in the object but throw the error just on the return.

Can someone tell me what is occurring?

Please help!!!!
Mar 10 '08 #1
1 2749
QVeen72
1,445 Expert 1GB
Hi,

Few things i could notice:
When you set an Object May be use "New" KeyWord..
LineObj = New Type1case 2

And by default the Variables passed to Function are ByVal, I Guess, you need to use "ByRef"..

Public Function QBSetVal(ByRef pObj,.....)

I'am not sure, but you can give it a try..

REgards
Veena
Mar 10 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Andy Franks | last post by:
Hi All, This is driving me nuts, especially since I have this working for my main application with no problem. I suspect it might be due to Namespace conflicts, but I'm not positive. Any help...
9
by: Zlatko Matić | last post by:
I was reading about late binding, but I'm not completely sure what is to be done in order to adjust code to late binding... For example, I'm not sure if this is correct: early binding: Dim ws...
5
by: mark | last post by:
I know I am being incredibly dunderheaded about this consider the following: STRICT ON Dim a(,) As Double = {{1, 2}, {3, 4}, {5, 6}} Private Sub T1(ByVal a As Array) Dim i, j As Integer For i =...
1
by: Dean Slindee | last post by:
Can someone explain how to remedy the two late binding errors below when Option Strict On: Public Function ControlDataRowArrayListPaint(ByRef frm As Form, _ ByRef ctl As Control, _ ByRef...
2
by: Dean Slindee | last post by:
Can someone explain how to remedy the two late binding errors below when Option Strict On: Public Function ControlDataRowArrayListPaint(ByRef frm As Form, _ ByRef ctl As Control, _ ByRef dr...
7
by: Entwickler | last post by:
hello, i have the following problem. i want to write a code that enables the user to call functions from a unmanaged code .dll at running time . so i have to use the late binding . i tried the...
6
by: Stephany Young | last post by:
Using VS2005 and VB.NET and given a Windows Forms application with a single form (Form1) with 2 buttons (Button1 and Button2), I am attempting to instantiate an instance of Excel utilising late...
4
by: beatTheDevil | last post by:
I searched, I swear. All my keywords were ignored by the search engine. Or I may just suck at searching with the right keywords, but I've been unable to find information about this. Perhaps somebody...
14
by: Siv | last post by:
hi, I am converting an application that writes to an Excel spreadsheet and the code trips the "option Strict" that I would like on because the parser says "option Strict On disallows late...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.