# C1.Util.DX.CppObject.ToCallbackPtr

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_CppObject_ToCallbackPtr_" data-uid="C1.Util.DX.CppObject.ToCallbackPtr*">ToCallbackPtr Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_CppObject_ToCallbackPtr_" data-uid="C1.Util.DX.CppObject.ToCallbackPtr*"></a>
<h4 id="C1_Util_DX_CppObject_ToCallbackPtr__1_C1_Util_DX_ICallbackable_" data-uid="C1.Util.DX.CppObject.ToCallbackPtr``1(C1.Util.DX.ICallbackable)">ToCallbackPtr&lt;TCallback&gt;(ICallbackable)</h4>
<div class="markdown level1 summary"><p>Return the unmanaged C++ pointer from a <a class="xref" href="C1.Util.DX.ICallbackable.html">ICallbackable</a> instance.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static nint ToCallbackPtr&lt;TCallback&gt;(ICallbackable callback) where TCallback : ICallbackable</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function ToCallbackPtr(Of TCallback As ICallbackable)(callback As ICallbackable) As IntPtr</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.ICallbackable.html">ICallbackable</a></td>
      <td><span class="parametername">callback</span></td>
      <td><p>The callback.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">nint</a></td>
      <td><p>A pointer to the unmanaged C++ object of the callback</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">TCallback</span></td>
      <td><p>The type of the callback.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
