Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with ScriptControl (MSSCRIPT.OCX)

31 views
Skip to first unread message

Peter Huyghe

unread,
Nov 15, 1999, 3:00:00 AM11/15/99
to
Hi all,

I am trying to use the MS ScriptControl from a non-MFC C++ application. (VC++ 6.0)
I have included the headerfile msscpctl.h
My WinMain() looks like this:

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    PSTR pszErr = NULL;
//  hInst=hInstance;

    HRESULT hr=CoInitialize(NULL);
    ASSERT(SUCCEEDED(hr));

    hr = CoCreateInstance(CLSID_ScriptControl, NULL, CLSCTX_INPROC_SERVER,
                          IID_IScriptControl, (void**)&pScript);
    CHECK_ERROR (pScript, "CoCreateInstance Failed");

//  DoMainBOX(NULL);

done:
    SAFERELEASE(pScript);
    CoUninitialize();

    return 0;
}

But the linker shows these 2 errors:

Linking...
ScriptTest.obj : error LNK2001: unresolved external symbol _CLSID_ScriptControl
ScriptTest.obj : error LNK2001: unresolved external symbol _IID_IScriptControl
Debug/ScriptTest.exe : fatal error LNK1120: 2 unresolved externals

(BTW: IID_IScriptControl and CLSID_ScriptControl are defined in that headerfile)
(BTW: I do not want to use the #import method. I think it should also work without #import,
      because I've done that with the MS XML parser component.)

What do I need to do to fix this ?

Thanks,
 

0 new messages