473,412 Members | 2,304 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,412 software developers and data experts.

Function or Interface marked as restricted..in a COM wrapper

Hi
this is my test class which I want to use in COM:

<System.Runtime.InteropServices.InterfaceType(Runt ime.InteropServices.ComInterfaceType.InterfaceIsDu al), _

System.Runtime.InteropServices.GuidAttribute("2cd2 18b0-0026-48bb-87f1-144677d45f01")> _
Public Interface ILoadAssembly
Function GetValue(ByVal Value As Object) As Object
Function GetValueArray(ByVal Value() As Object) As Object()
End Interface

<System.Runtime.InteropServices.GuidAttribute("0c9 bbc63-096e-4364-9894-0ba7c932048b"), _
System.Runtime.InteropServices.ProgId("ExecuteDotN etFunction.LoadAssembly"),
System.Runtime.InteropServices.ClassInterface(Runt ime.InteropServices.ClassInterfaceType.None)> _
Public Class LoadAssembly
Implements ILoadAssembly

Public Function GetValue(ByVal Value As Object) As Object Implements
ILoadAssembly.GetValue
Return Value
End Function

Public Function GetValueArray(ByVal Value() As Object) As Object()
Implements ILoadAssembly.GetValueArray
Return Value
End Function

End Class

this is how the VB6 code looks like:

Dim test As ExecuteDotNetFunction.LoadAssembly
Dim strA As String
Dim strB As String
Dim astrA() As String
Dim astrB() As String

Set test = New ExecuteDotNetFunction.LoadAssembly

strA = "Niklas"
strB = test.GetValue(strA)

ReDim astrA(1)
astrA(0) = "Niklas"
astrA(1) = "Fjellman"
astrB = test.GetValueArray(astrA)

GetValue works fine, but GetValueArray generates a compile error:
"Function or Interface marked as restricted, or the function uses an
Automatioin type not supported in Visual Basic". Does this mean that arrays
are not supported or have I done something wrong?

Regards
/Niklas
Nov 21 '05 #1
0 1787

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

Similar topics

7
by: vegetax | last post by:
I i need a decorator that adds a local variable in the function it decorates, probably related with nested scopes, for example: def dec(func): def wrapper(obj = None): if not obj : obj = Obj()...
6
by: Adrian | last post by:
I am trying to pass the address of a C++ function into a Fortran routine to enable the Fortran routine to call this C++ function. I have to do it this way as our build process does not allow...
10
by: Martin Vorbrodt | last post by:
Example code in one of my books intrigues me: class B { public: B* Clone() const { B* p = DoClone(); assert(typeid(*p) == typeid(*this)); return p; }
35
by: michael.casey | last post by:
The purpose of this post is to obtain the communities opinion of the usefulness, efficiency, and most importantly the correctness of this small piece of code. I thank everyone in advance for your...
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
5
by: harishashim | last post by:
I have gone through necessary step and have been able to use a .Net libraries (created using C#) in VB6. It run good untill I try to use certain function in the library that is using Int64 type as...
3
by: Beta What | last post by:
Hello, I have a question about casting a function pointer. Say I want to make a generic module (say some ADT implementation) that requires a function pointer from the 'actual/other modules'...
23
by: I.M. !Knuth | last post by:
A while back, I was mucking around with a recursive function. For brevity's sake, I'll define it like this: int func_recurs(int arg1, int arg2, int prev_pos) { int crnt_pos = 0; int result; ...
6
by: DDB | last post by:
I have application that runs without any problem on all PCs except one where it produced error obn currentDB line: Function or interface marked as restricted, or the function uses an Automation type...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.