home *** CD-ROM | disk | FTP | other *** search
-
- #include <windows.h>
- #include <stdio.h>
- #include <olectl.h>
- #include <initguid.h>
- #include <olectlid.h>
-
- // the class ID of the server exe
- // {4F126D90-1319-11d0-A6AC-00AA00602553}
- const CLSID CLSID_CLowerStr =
- {0x4f126d90, 0x1319, 0x11d0, {0xa6, 0xac, 0x0, 0xaa, 0x0, 0x60, 0x25, 0x53}};
-
- // {4F126D91-1319-11d0-A6AC-00AA00602553}
- const CLSID IID_ILowerStr =
- {0x4f126d91, 0x1319, 0x11d0, {0xa6, 0xac, 0x0, 0xaa, 0x0, 0x60, 0x25, 0x53}};
-
-
- class ILowerStr: public IUnknown
- {
- public:
- virtual STDMETHODIMP Lower(char* lpInput, char **lpOutput)=0;
- };
-
- void __cdecl main(int argc, char *argv[])
- {
- ILowerStr *pILowerStr = NULL;
- HRESULT hr;
-
-
- hr = CoInitialize(NULL);
- if (FAILED(hr))
- {
- printf("CoInitialize failed [0x%x]\n", hr);
- exit(1);
- }
-
- hr = CoCreateInstance(CLSID_CLowerStr, 0, CLSCTX_LOCAL_SERVER,
- IID_ILowerStr,(void**)&pILowerStr);
-
- if (FAILED(hr))
- {
- printf("CoCreateInstance failed [0x%x]\n", hr);
- if (hr == REGDB_E_CLASSNOTREG)
- {
- printf("Run lst32.exe /REGSERVER to install server program.\n");
- }
- exit(1);
- }
-
- char *lpOutput;
-
- pILowerStr->Lower("HELLO", &lpOutput);
-
- printf("this is it %s\n", lpOutput);
-
- pILowerStr->Release();
- CoUninitialize();
- }
-
-