How to make function call from VB.Net to C++/CLI DLL (Both areVS2005)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lia.leon@gmail.com

    How to make function call from VB.Net to C++/CLI DLL (Both areVS2005)

    Can anyone give me a simple example to demonstrate the captioned
    question?

    Actually, instead of PInvoke, we'd like to utilize the united .Net
    platform to support our requirement:-
    VB.Net sends a structure (includes 3-dimensional array) to C++/CLI
    Dll, and the C++/CLI Dll will return a structure (includes 2-
    dimensional array) back to VB.Net for future handling

  • =?Utf-8?B?RGF2aWQgQW50b24=?=

    #2
    RE: How to make function call from VB.Net to C++/CLI DLL (Both are VS2

    Just use C++/CLI to create an assembly referenced by the VB app.

    The C++/CLI syntax for a value type with a 2-dimensional array of integers is:
    public value class Foo //or you can use 'value struct'
    {
    public:
    array<int, 2^myArray = gcnew array<int, 2>();
    .... <other members....
    };

    The only difference between 'value class' and 'value struct' is that the
    default access is private for 'value class'. If it's a reference type you
    want, use 'ref class' or 'ref struct'.

    Similarly, the syntax for a 3-dimensional array of integers is:
    array<int, 3^myArray = gcnew array<int, 3>();

    If its actually jagged arrays that you want instead of true 'rectangular'
    multi-dimensional arrays, then the syntax is:
    array<array<int >>
    array<array<arr ay<int>>>
    etc.
    --
    Source code converters: Convert between C#, C++, Java, VB, and Python with the most accurate and reliable source code converters

    C++ to C#
    C++ to VB
    C++ to Java
    VB & C# to Java
    Java to VB & C#
    Instant C#: VB to C#
    Instant VB: C# to VB
    Instant C++: VB, C#, or Java to C++/CLI


    "lia.leon@gmail .com" wrote:
    Can anyone give me a simple example to demonstrate the captioned
    question?
    >
    Actually, instead of PInvoke, we'd like to utilize the united .Net
    platform to support our requirement:-
    VB.Net sends a structure (includes 3-dimensional array) to C++/CLI
    Dll, and the C++/CLI Dll will return a structure (includes 2-
    dimensional array) back to VB.Net for future handling
    >
    >

    Comment

    Working...