Thread: Feedback wanted - DispHelper

  1. #1
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002

    Feedback wanted - DispHelper

    DispHelper aims to allow Windows C/C++ programmers to use COM objects in a simple, script like manner.

    If anyone wants to try it out or give feedback feel free. Suggestions, criticisms, bugs, crushing silence, you know the sort of thing.

    Download DispHelper Version 0.75(BETA) - 90KB

    The following samples are provided. All samples can be compiled as C or C++.

    Demonstrates outputting formatted text to a Word document and getting user feed back with the help of the office assistant. Demonstrates using Word as a spell checker.

    Demonstrates outputting formatted data to Excel and using it to create a chart. Demonstrates using a safe array to efficiently insert data into Excel.

    Demonstrates sending an email with CDO, Outlook and Eudora.

    Demonstrates reading and manipulating data from a data source using ActiveX Data Objects.

    Demonstrates outputting formatted text to a WordPerfect document.

    Demonstrates using Microsoft Agent and SAPI to provide text-to-speech.

    Demonstrates ui-less html parsing and manipulation of the html document object model(DOM) using MSHTML. Provides functions to parse html from a string, a website or a file.

    Demonstrates using the VBScript.RegExp object to provide support for regular expressions. Provides a function to extract hrefs from a web page using a regular expression.

    Demonstrates using MSMXL to download a web page, read an RSS feed and read and manipulate XML with the XML document object model(DOM).

    Demonstrates using Windows Management Instrumentation(WMI). Samples include enumerating installed hot fixes, purging print queues, starting a program, monitoring starting and terminating processes, and monitoring file creation. All of these samples can target the local or a remote computer.

    Demonstrates using the PocketSoap toolkit to utilise several web services. Play the 'Who wants to be a millionaire' quiz with the help of a web service.

    Demonstrates using the MSSoap toolkit to utilise several web services. Web services demonstrated include Google search, spell checker and cache viewer.

    Demonstrates controlling Internet Explorer via COM. Demonstrates using an Internet Explorer window to display or retrieve information from the user.

    Demonstrates using the MSScriptControl to run a VBScript or JScript.

    Demonstrates controlling Microsoft's new help system for developers, dexplore.

    Demonstrates one way of accessing a remote COM object using alternate credentials.

    Demonstrates using Windows Image Acquisition(WIA) to manipulate images. Demonstrates taking a snapshot from a video device.

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Sorry about the extra post, didn't want to make the
    previous post unreadable with 'wide' code.

    Here's a couple of samples(error checking ommitted):

    /* ***********************************************
     * RSSRead:
     *   Demonstrates reading an rss feed using MSXML.
    void RSSRead(LPCTSTR szURL) {
    	struct RSS {
    		LPWSTR szTitle, szLink, szDescription;
    	} RSSItem;
    	/* Load the rss document from the URL */
    	dhCreateObject(L"MSXML.DOMDocument", NULL, &xmlDoc) );
    	dhPutValue(xmlDoc, L".Async = %b", FALSE) );
    	dhCallMethod(xmlDoc, L".Load(%T)", szURL) );
    	FOR_EACH1(xmlNode, xmlDoc, L".documentElement.getElementsByTagName(%S)", L"item") {
    		ZeroMemory(&RSSItem, sizeof(RSSItem));
    		dhGetValue(L"%S", &RSSItem.szTitle,       xmlNode, L".selectSingleNode(%S).text", L"title");
    		dhGetValue(L"%S", &RSSItem.szLink,        xmlNode, L".selectSingleNode(%S).text", L"link");
    		dhGetValue(L"%S", &RSSItem.szDescription, xmlNode, L".selectSingleNode(%S).text", L"description");
    		wprintf(L"Title: %s\nLink: %s\nDescription: %.140s\n\n",
    				 RSSItem.szTitle, RSSItem.szLink, RSSItem.szDescription);
    	} NEXT(xmlNode);
    /* ********************************************
     * MonitorProcessActivity:
     *   Monitors process startup and termination on local or remote computer.
     * =========================================== */
    void MonitorProcessActivity(LPCWSTR szComputer) {
    	dhGetObject(getWmiStr(szComputer), NULL, &wmiSvc) );
    	dhGetValue(L"%o", &wmiEventSrc, wmiSvc, L".ExecNotificationQuery(%S)",
    	         L"SELECT * FROM __InstanceOperationEvent WITHIN 1 WHERE (__Class = '__InstanceCreationEvent' OR __Class = '__InstanceDeletionEvent') AND TargetInstance ISA 'Win32_Process'") );
    	while (TRUE) {
    		LPWSTR szProcessName = NULL;
    		LPWSTR szClassName   = NULL;
    		dhGetValue(L"%o", &wmiLatestEvent, wmiEventSrc, L".NextEvent") );
    		dhGetValue(L"%S", &szProcessName, wmiLatestEvent, L".TargetInstance.Name");
    		dhGetValue(L"%S", &szClassName,   wmiLatestEvent, L".SystemProperties_(%S)", L"__Class");
    		if (szClassName && 0 == wcscmp(L"__InstanceDeletionEvent", szClassName))
    			wprintf(L"TERMINATED: \t%s\n", szProcessName);
    			wprintf(L"STARTED:    \t%s\n", szProcessName);

  3. #3
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    That bad? I wasn't serious about the crushing silence!

    I can understand if no one can be bothered having a look but can anyone comment on whether this is a worthwhile project or should I give it a ceremonial burial at sea.

    The 'how do I put a chart in Excel' or 'how do I send an email' sort of questions seem to come up fairly regularly so I thought this might be of some use. However, I may have been deluding myself.

    No one thinks any of the samples listed could be at all useful?


  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    1. It would be better on the windows board
    2. Everyone is on holiday
    I am not a windows programmer, so I can't comment on it in any depth
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Regular Expression Feedback
    By sean in forum Tech Board
    Replies: 13
    Last Post: 05-28-2009, 02:26 PM
  2. Getting a message with wanted lparam from queue
    By BrownB in forum Windows Programming
    Replies: 6
    Last Post: 12-24-2007, 08:37 PM
  3. Developers Wanted
    By Quasicom in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 08-24-2005, 12:46 AM
  4. I just wanted....
    By ILoveVectors in forum C++ Programming
    Replies: 0
    Last Post: 06-22-2005, 09:29 PM
  5. Primary game build, feedback welcome
    By Clyde in forum Game Programming
    Replies: 37
    Last Post: 07-10-2002, 05:34 AM