pass vb.net function pointer to Managed C++ 
Author Message
 pass vb.net function pointer to Managed C++

Howdy,

I would like to pass a function pointer of a sub or
function created in CSharp or vb.net to a Managed C++ DLL,
so I can call the function from the Managed C++ DLL at a
later time.

IN vb.NET
dll.fptr = addressOf me.fptr

...then in dll

__property void set_fptr(_value as fptr){m_fptr = _value}

...then later in program
void RunMyExternalDotNetFunction()
{
(*m_fptr)();

Quote:
}



Thu, 20 Jan 2005 06:56:52 GMT  
 pass vb.net function pointer to Managed C++
I would suggest to use a real delegate for this.

Ronald Laeremans
Visual C++ compiler and libraries team


Quote:
> Howdy,

> I would like to pass a function pointer of a sub or
> function created in csharp or vb.net to a Managed C++ DLL,
> so I can call the function from the Managed C++ DLL at a
> later time.

> IN vb.NET
> dll.fptr = addressOf me.fptr

> ...then in dll

> __property void set_fptr(_value as fptr){m_fptr = _value}

> ...then later in program
> void RunMyExternalDotNetFunction()
> {
> (*m_fptr)();
> }



Fri, 21 Jan 2005 11:25:43 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to pass a function pointer from Managed C++ to unmanaged c++

2. Question about converting code from VB .NET to Managed C++ / C#

3. problem passing unmanaged pointer from one managed member function to another

4. Passing System::String to Managed C++ Functions

5. Passing managed objects through non-managed exported functions

6. Passing pointers to C++ ActiveX controls in VB

7. function parameters to pass a VB string array to a C++ DLL

8. Passing VB DAO objects to C++ DLL functions?

9. Passing address of a VB function to C++

10. Passing a pointer to member function in Visual C++ 6.0

11. Inherit unmanaged c++ classes from .Net platform (managed c++ or c#)

12. Convert Conventioal C++ Program to Managed C++ of Visual C++.NET

 

 
Powered by phpBB® Forum Software