9、在cmydialog.h中增加头文件:
#include <activscp.h>
#include "myscriptobject.h"
10、在onok()这前加入如下代码:
class myactivescriptsite : public iactivescriptsite {
private:
ulong m_dwref; // reference count
public:
iunknown *m_punkscriptobject; // pointer to your object that is exposed
// to the script engine in getiteminfo().
myactivescriptsite::myactivescriptsite() {m_dwref = 1;}
myactivescriptsite::~myactivescriptsite() {}
virtual hresult _stdcall queryinterface(refiid riid, void **ppvobject) {
*ppvobject = null;
return e_notimpl;
}