<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 <typename _Signature, enum LibraryId _LibraryId, int _Offset></div> <div>class FunctionPointer: protected OffsetPointer,�public boost::function<_Signature></div> <div>{</div> <div>public:</div> <div>��� FunctionPointer(void)</div> <div>��� : boost::function<_Signature>(�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<return_type__stdcall( argument_types ), LibraryId, Offset> Function;</blockquote> <blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">FunctionPointer<return_type __cdecl( argument_types ), LibraryId, Offset> 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: 'boost::function<Signature>' : 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>