Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

How can I trigger a property's setter from unmanaged C++ code

$
0
0

Is there an easy way I can trigger a property setter from unmanaged code?

I have a property :

Dim _pcVirtualMemFolder As String _
      = "%GRASP3_DATAPATH%Meta\%G3_FileNameOnly%\"
Property m_pcVirtualMemFolder As String
    Get
        return _pcVirtualMemFolder
    End Get
    Set(value As String)
        _pcVirtualMemFolder = value
    End Set
End Property

Can I make a delegate to the setter and send the function pointer to C++ unmanaged code?

I can do this for a another function in my VB code:

Public Delegate Sub pfnStringReturnsVoid_t _
(ByVal strRunStatus As String)<DllImport(MMGRASPDLL)> Public Shared Function mmGrasp_UpdateMsg _ (ByVal pfnRunStatus As pfnStringReturnsVoid_t) As Int32 End Function

...

' Give the C++ code a function pointer
GraspLib.mmGrasp_UpdateMsg(g_vi, AddressOf myFrmGrasp.MyMsg)

How do I make a Delegate for the property setter?



//========================== // Michael Fitzpatrick //==========================





Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>