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

How to retrieve the changed value of a reference parameter

Hi all,

In VB.net,using Type.InvokeMember to call a method of
a class in COM dll,the method has a reference
parameter,It seems that there is no way to return the
changed value of that reference parameter by the method
of the class.

For example,
an COM class named myclass ,it has a method named
mymethod an its VB code is like this:

Public Class myClass
Public Function mymethod(ByVal a As Integer, ByVal b
As Integer, ByRef c As Integer) As Integer
c = a - b
Return a + b
End Function
End Class

The class has been compiled into a COM dll named
myTest.dll,then use it in VB.NET,like this:

Dim Aobj() As Object = {15, 6, 3}
MsgBox(Aobj(2))
Dim obj As New myTest.myclass()
Dim T As Type = Type.GetTypeFromProgID("myTest.myclass")
dim d as object
d= T.InvokeMember("mymethod",
Reflection.BindingFlags.Public Or
Reflection.BindingFlags.InvokeMethod Or
Reflection.BindingFlags.Instance, Nothing, obj, Aobj)
MsgBox(Aobj(2))
MsgBox(d)

IN the code,the desired value of Aobj(2) is 9,but it
remains 3.
what shall I do ? Whther I must use "ParameterModifier"?
and how to use it?

Who can save me?
Thanks a lot!

An early reply will be appreciated.

Jul 21 '05 #1
0 1094

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

Similar topics

5
by: David Rasmussen | last post by:
Some sites seem to be session driven in the sense that if I visit the homepage and do a few clicks I can navigate anywhere I want, but if I paste the current location into a new browser window...
36
by: Riccardo Rossi | last post by:
Hi all! How does Python pass arguments to a function? By value or by reference? Thanks, Riccardo Rossi.
1
by: Eugfene | last post by:
I have the following function in a html file: function selectEdit(fileID, processCode, processID, fileName,fileDesc) { document.forms.recordID.value = fileID; document.forms.processor.value =...
4
by: Carlos Gomez | last post by:
In VB6 the default for passing variables was ByRef. It was faster and used less memory. Why did MS changed that? Are there any advantages using ByVal over ByRef? (other than ByVal impeding you from...
0
by: peter | last post by:
Hi all, In VB.net,using Type.InvokeMember to call a method of a class in COM dll,the method has a reference parameter,It seems that there is no way to return the changed value of that...
4
by: Learner | last post by:
Hi there, I have a storec proc that schedules a Sql job and finally it returns 0 then it was successfull and if it returns 1 then its unsuccessful. Now when i run the stored proc in the query...
1
by: tomjbr.32022025 | last post by:
I have started looking at the nhibernate framework, but do not really like the string based API which makes it impossible to use automatic refactoring of a property name without the risk of getting...
5
by: =?Utf-8?B?QXhlbCBEYWhtZW4=?= | last post by:
Hi, I've created a class library assembly containing several string resource files, like: - TableColumns.resx - TableColumns.de.resx - General.resx - General.de.resx
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...

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.