<div>I am writing a DLL that gets injected into another process, and creates pointers to the target processes functions. The target process uses all 3 calling conventions, __stdcall, __fastcall and __cdecl.</div>
<div>�</div>
<div>I have created a class whos constructor gets the address of the function, and passes it to the base class boost::function:</div>
<div>�</div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>template &lt;typename _Signature, enum LibraryId _LibraryId, int _Offset&gt;</div>
<div>class FunctionPointer: protected OffsetPointer,�public boost::function&lt;_Signature&gt;</div>
<div>{</div>
<div>public:</div>
<div>��� FunctionPointer(void)</div>
<div>��� : boost::function&lt;_Signature&gt;(�OffsetPointer::_getOffset(_LibraryId, _Offset�)</div>
<div>��� { return; }</div>
<div>};</div></blockquote>
<div>�</div>
<div>I instantiate this with:</div>
<div>�</div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">FunctionPointer&lt;return_type__stdcall( argument_types ), LibraryId, Offset&gt; Function;</blockquote>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">FunctionPointer&lt;return_type __cdecl( argument_types ), LibraryId, Offset&gt; Function;</blockquote>
<div>�</div>
<div>Whatever calling convention Visual Studio is setup to use (__cdecl by default), works just fine. But trying to instantiate it with another calling convention gives the following error:</div>
<div>�</div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Error�1�error C2504: &#39;boost::function&lt;Signature&gt;&#39; : base class undefined</blockquote>
<div>�</div>
<div>It seems weird that it would work for some calling conventions, and not others..</div>
<div>�</div>
<div>Any ideas?</div>
<div><br>-- <br>+ Brian J. Rowlett<br></div>