Example for debugging.
At line 30 debugger lost control.
#define UNICODE
#define WIN32_LEAN_AND_MEAN
//#define WIN32_DEFAULT_LIBS
#include <windows.h>
#include <ole2.h>
#pragma comment(lib, "ole32.lib")
CLSID const IID_IScriptControl = { 0x0E59F1D3, 0x1FBE, 0x11D0, {0x8F, 0xF2, 0x00, 0xA0, 0xD1, 0x00, 0x38, 0xBC} };
TCHAR *szAppName = TEXT("MSScriptTest");
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
HRESULT hr;
GUID clsid;
IDispatch *pISC = NULL;
hr = CoInitialize(NULL);
hr = CLSIDFromProgID(L"MSScriptControl.ScriptControl", &clsid);
if (hr)
MessageBox(0, TEXT("Error CLSIDFromProgID()"), szAppName, 0);
else {
hr = CoCreateInstance(&clsid, NULL, CLSCTX_ALL, &IID_IScriptControl, (void **)&pISC);
if (hr)
MessageBox(0, TEXT("Error CoGetClassObject()"), szAppName, 0);
else {
//MessageBox(0, "OK", szAppName, 0);
pISC->lpVtbl->Release(pISC);
pISC = NULL;
}
}
CoUninitialize();
return 0;
}