Trouble figuring out DirectCall interface

"goobamarino" <[email protected]> Tue, 30 Sep 2003 23:56:09 -0000
Newsgroups gmane.lisp.corman
Message-ID <[email protected]>
Has anyone gotten the call back functions to work via the 
DirectCall interface? I keep getting a Memory access violation. 

I am trying to do something like this:

(defun-direct-callback add2numbers ((a long)(b long))
    (+ a b))


(save-image "math.img")

// SimpleMath.h

.
.
.
typedef long (__stdcall *pfadder)(long, long);

pfadder m_pfAdder;

// SimleMath.cpp


STDMETHODIMP CSimpleMath::add(long a, long b, long* c)
{
	if(!m_pfAdder)
	{
	
		HRESULT hr = m_iLispCall->GetFunctionAddress
(L"ADD2NUMBERS",L"WIN32",(LPVOID*)&m_pfAdder);
	}

	*c = m_pfAdder(a, b);
	//*c = a + b;
	return S_OK;
}


//end
The initialize and the BlessThread all return S_OK, the 
connectionpoint to ICormanLispTextOutput is successful, corman text 
output flows through, but it errors out 
on the GetFunctionAddress call. Any ideas out there?




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Upgrade to 128-Bit SSL Security!
http://us.click.yahoo.com/p7cEmB/s7qGAA/yigFAA/SyjtlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/