home *** CD-ROM | disk | FTP | other *** search
-
- #include <objbase.h>
- #include <initguid.h>
- #include <stdio.h>
-
- /*class IUpperStr : public IUnknown
- {
- public:
- virtual STDMETHODIMP_(char *) Upper(char *) = 0;
- };
-
- const CLSID CLSID_CUpperStr =
- { 0x80fa6ee0, 0x120, 0x11d0, {0xa6, 0xa0, 0x0, 0xaa, 0x0, 0x60, 0x25, 0x53}};
-
- const CLSID IID_IUpperStr =
- { 0x80fa6ee2, 0x120, 0x11d0, {0xa6, 0xa0, 0x0, 0xaa, 0x0, 0x60, 0x25, 0x53}};
- */
-
- // These equivalent definition will be from lst33_i.c
-
-
- #include "..\lst33\lst33.h"
-
-
- void main()
- {
-
- HRESULT hr;
- ILst33 * m_pILst33; // interface pointer
- CLSID clsid;
-
-
-
- hr = CoInitialize(NULL);
- hr = CLSIDFromProgID(L"LST33.Lst33Object.1",&clsid);
-
- hr = CoCreateInstance(clsid,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_ILst33,
- (LPVOID*)&m_pILst33);
-
- if(FAILED(hr))
- {
- printf("can not create Lst33");
- CoUninitialize();
- return;
- }
-
- char *lpLowerString;
-
-
- m_pILst33->Lower("HELLO", &lpLowerString );
-
- printf("the return string is %s\n", lpLowerString);
-
- m_pILst33->Release();
- CoUninitialize();
- }