|
From: William S F. <ws...@fu...> - 2006-10-05 20:38:13
|
John Whitley wrote:
> Hi all,
>
> I've got a SWIG wrapper for an MFC extension DLL. The SWIG wrapper DLL
> (i.e. what gets linked as a module into the target language) is itself a
> full MFC DLL. This implies that I must incant the magic phrase
> "AFX_MANAGE_STATE(AfxGetStaticModuleState())" at every DLL entry point
> to appease MFC and avoid spurious crashes everywhere.
>
> Is there a straightforward user-level hook to add code at the start of
> every SWIG generated wrapper function, or will this require modification
> of the SWIG source code?
>
I can't think of anyway to add code at the very beginning of the wrapper
function before the marshalling starts. %exception might do what you
want though:
%exception {
AFX_MANAGE_STATE(AfxGetStaticModuleState())
$action
}
William
|