Click here to Skip to main content
Click here to Skip to main content

DHTML User Interface Library

By , 1 Mar 2013
 

Current Version: DHTMLUI v1.00 build 47

Index

Introduction

Have you ever wanted to make an application similar to Microsoft« Outlook Express« without resorting to ATL? The DHTMLUI library allows you to implement such an advanced DHTML user interface in your own MFC applications! This library is the latest version in a series of continuously updated classes which I have been using in one of my own projects. DHTMLUI started life as a part of my original application, but when my project crested more than 800K of raw source code, I decided to break my code into bite size chunks and so DHTMLUI was born.

    Microsoft« Outlook Express«
    Microsoft« Outlook Express«

My previous article, "Processing HTML Forms From a CHtmlView", shows a very basic technique for retrieving form data using a standard CHtmlView. This technique is fine for basic forms, but what if you want to notify your program when a selection is made from a list of radio buttons? Well, this library makes this all possible!

NOTE: This library is by no means what I would consider to be complete! There are classes in which functions have been defined, but there is no actual code in them. This is a result of laziness on my part! If you need to use a particular function and it has no code, let me know and I will fill in the details for you, unless of course you want to do it! Please submit a copy of any changed files to me via e-mail - crowtc@gmail.com - and I will make the changes to the master copy.

About the DHTMLUI Library

The DHTMLUI Library simplifies the use of the myriad COM methods and properties used in conjunction with a browser window. The library also allows you to override the functionality associated with almost every event, feature request and property change. This library allows you to implement almost every feature present in Internet Explorer! This kind of power comes at a cost though, browsing through the library source code is like trying to read a popular novel that has been translated into Old English!

This library is based on information I have collected from various sources, including the Microsoft Internet Explorer 5.5 SDK, MSDN and the Platform SDK. There are bits and pieces from Microsoft samples, pieces gleaned from numerous websites and a lot of my own "This function isn't documented, but let's see what I can do with it" original code.

Enjoy!

Using the DHTMLUI Library

Getting Started

Before using this library, you should make sure you have the Platform SDK installed and the paths are set in your Options...Directories tab. If you want to use Internet Explorer 5.x features, you want to make sure the SDK is installed as well, but it is not 100% necessary for normal operation. To make everything work, you must also have the corresponding version of Internet Explorer installed!

Extract the Library

Extract the DHTMLUI Library where you want, but be sure to configure the path in your directories tab.

Open and Compile the Project

Open the DHTMLUI workspace and open the class labeled __DHTMLUI_Config, or DHTMLUIConfig.h. This class is a dummy class to help me open the configuration file (lazy huh?). Well, anyway - go through the file and set the options for the library, it is pretty well documented in the file and should be pretty easy to do.

Save the file and do a complete rebuild both Debug and Release configurations, just to make sure they compile correctly. If they don't compile, please check the library dependencies before flaming me or blasting my email with epithets that would make a "Hell's Angel" ask to leave the room.

When you get it to compile, you may continue on with the next step.

Setting up your Project

I made this library to be used as a drop-in replacement for CHtmlView, so setting it up in an existing project is pretty easy. If you don't have an existing project, use the MFC AppWizard to create a project which uses Automation and set up the application's primary view as a CHtmlView. If your existing project does not have automation enabled, you will only need to add it if you want your embedded DHTML pages to be able to access your application via COM.

Once you have a project with a CHtmlView you will need to add the following lines (Bold) to the project's STDAFX.H file if they aren't already there:

// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//

#if !defined(AFX_STDAFX_H__1F9F46AD_DDF4_4D29_BC06_592204E7F660__INCLUDED_)
#define AFX_STDAFX_H__1F9F46AD_DDF4_4D29_BC06_592204E7F660__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxadv.h>
#include <afxdisp.h>        // MFC Automation classes

#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h>          // MFC ODBC database classes
#endif // _AFX_NO_DB_SUPPORT

#ifndef _AFX_NO_DAO_SUPPORT
#include <afxdao.h>         // MFC DAO database classes
#endif // _AFX_NO_DAO_SUPPORT

#include <afxdtctl.h>       // MFC support for Internet Explorer 4 Common 
                            // Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>         // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxhtml.h>        // MFC HTML view support

#include <dhtmlui.h>        // Dynamic HTML User Interface Library

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately 
// before the previous line.

#endif //!defined(AFX_STDAFX_H__1F9F46AD_DDF4_4D29_BC06_592204E7F660__INCLUDED_)

    In your CHtmlView derived class header file, add a define to replace CHtmlView with CHtmlViewEx. This enables you to keep using the name CHtmlView when you refer to the class and there is a lot less typing involved.

    /////////////////////////////////////////////////////////////////////////////
    
    #define CHtmlView CHtmlViewEx
    
    /////////////////////////////////////////////////////////////////////////////
    
    class CWorksheetView : public CHtmlView
    {
    protected: // create from serialization only
        CWorksheetView();
        DECLARE_DYNCREATE(CWorksheetView)
    
    ...
    

      In your CDocument class, you should have an automation interface, this is where you will add property and method extensions to DHTML. The methods you add here will become available to JavaScript and VBScript through the window.external interface.

      Basically, if you add a method called LoadFormData defined as:

         afx_msg void LoadFormData( long PageNumber );
      
      ------
      
         void CWorksheetDoc::LoadFormData(long PageNumber)
         {
            GET_CURRENT_VIEW(pView);
      
            switch(PageNumber)
            {
               case 1:
          ...
               default:
                  break;
            }
         }
         

      You can call LoadFormData from your embedded web pages as such:

         <script language="JavaScript">
         <!--
      
         function window_onload( page )
         {
            window.external.LoadFormData( page );
         }
      
         //-->
         </script>
      

      You do basically the same thing for properties, except that return values of non-integral types are usually passed by reference.

      Special Features of this Library

      The DHTMUI Library has a number of capabilities which set it apart from CHtmlView. The number of features is too great to go into much detail on each of them, so I will include some of the header files and you can read more about them in the source code documentation.

      // HtmlViewEx.h : header file
      //
      //////////////////////////////////////////////////////////////////
      
      #ifndef __HTMLVIEWEX_H__
      #define __HTMLVIEWEX_H__
      
      #if _MSC_VER >= 1000
      #pragma once
      #endif // _MSC_VER >= 1000
      
      #ifndef __mshtmhst_h__
          #include <mshtmhst.h>
      #endif
      
      #include <mshtml.h>            // IE/MSHTML Interface Definitions
      
      // Forward Declarations
      class CHtmlViewExOccManager;
      
      // The available commands
      #define HTMLID_FIND 1
      #define HTMLID_VIEWSOURCE 2
      #define HTMLID_OPTIONS 3
      
      // Names for SetSecureLockIcon() values
      #define SECURELOCKICON_UNSECURE         0
      #define SECURELOCKICON_MIXED        1
      #define SECURELOCKICON_SECURE_UNKNOWNBITS    2
      #define SECURELOCKICON_SECURE_40BIT        3
      #define SECURELOCKICON_SECURE_56BIT        4
      #define SECURELOCKICON_SECURE_FORTEZZA    5
      #define SECURELOCKICON_SECURE_128BIT        6
      
      // Kill some of the MFC garbage
      #undef  AFX_DATA
      #define AFX_DATA
      
      
      ///////////////////////////////////////////////////////////////////
      // CHtmlViewEx class
      
      class _INS_EXT_CLASS CHtmlViewEx : public CFormView
      {
          DECLARE_DYNCREATE(CHtmlViewEx)
      
      ///////////////////////////////////////////////////////////////////
      // Construction
      ///////////////////////////////////////////////////////////////////
      public:
          CHtmlViewEx();
      
      ///////////////////////////////////////////////////////////////////
      // Attributes
      ///////////////////////////////////////////////////////////////////
      protected:
          CHtmlViewExOccManager* m_pHtmlViewExOccManager;
          int m_nFontSize;
          BOOL m_bNoStatusText;
          BOOL m_bOfflineIfNotConnected;
          BOOL m_bSilentMode;
          CString m_strUserAgent;
      
      public:
          void        SetNoStatusText(BOOL bNoStatus = TRUE);
          int        GetFontSize() const;
          void        SetFontSize(int fontSize = 2);
          CString        GetType() const;
          long        GetLeft() const;
          void        SetLeft(long nNewValue);
          long        GetTop() const;
          void        SetTop(long nNewValue);
          long        GetHeight() const;
          void        SetHeight(long nNewValue);
          void        SetVisible(BOOL bNewValue);
          BOOL        GetVisible() const;
          CString        GetLocationName() const;
          READYSTATE    GetReadyState() const;
          BOOL        GetOffline() const;
          void        SetOffline(BOOL bNewValue);
          BOOL        GetSilent() const;
          void        SetSilent(BOOL bNewValue);
          BOOL        GetTopLevelContainer() const;
          CString        GetLocationURL() const;
          BOOL        GetBusy() const;
          LPDISPATCH    GetApplication() const;
          LPDISPATCH    GetParentBrowser() const;
          LPDISPATCH    GetContainer() const;
          LPDISPATCH    GetHtmlDocument() const;
          CString        GetFullName() const;
          int        GetToolBar() const;
          void        SetToolBar(int nNewValue);
          BOOL        GetMenuBar() const;
          void        SetMenuBar(BOOL bNewValue);
          BOOL        GetFullScreen() const;
          void        SetFullScreen(BOOL bNewValue);
          OLECMDF        QueryStatusWB(OLECMDID cmdID) const;
          BOOL        GetRegisterAsBrowser() const;
          void        SetRegisterAsBrowser(BOOL bNewValue);
          BOOL        GetRegisterAsDropTarget() const;
          void        SetRegisterAsDropTarget(BOOL bNewValue);
          BOOL        GetTheaterMode() const;
          void        SetTheaterMode(BOOL bNewValue);
          BOOL        GetAddressBar() const;
          void        SetAddressBar(BOOL bNewValue);
          BOOL        GetStatusBar() const;
          void        SetStatusBar(BOOL bNewValue);
          CString        GetUserAgent() const;
          void        SetUserAgent(LPCTSTR strNewValue);
      
      ///////////////////////////////////////////////////////////////////
      // Operations
      ///////////////////////////////////////////////////////////////////
      
      public:
      #ifdef _DEBUG
          virtual void AssertValid() const;
          virtual void Dump(CDumpContext& dc) const;
      #endif
      
      ///////////////////////////////////////////////////////////////////
      // New CHtmlViewEx Operations
      //
      public:
          // Helper for OLE Commands to the WebBrowser
          void        ExecCmdTarget(DWORD nCmdID);
      
          // Helper for parsing POST Data
          CString        GetValueFromPostData(LPCTSTR strPostData, 
                                              LPCTSTR strValName);
      
          ///////////////////////////////////////////////////////////////////
          // Setup Functions
          ///////////////////////////////////////////////////////////////////
          // These functions are primarily for doing the initial setup
          // of a form upon load.  Most other actions should be performed
          // within the form page itself.
          ///////////////////////////////////////////////////////////////////
      public:
          IDispatch*    GetInputElementByName(LPCTSTR lpszElementName);
          IDispatch*    GetSelectElementByName(LPCTSTR lpszElementName);
          IDispatch*    GetTextAreaElementByName(LPCTSTR lpszElementName);
      
      protected:
          IHTMLOptionElementFactory*    GetOptionElementFactory();
      
      public:
          ///////////////////////////////////////////////////////////////////
          // General Input Controls
          BOOL        SetInputTextValue(LPCTSTR lpszFieldName, LPCTSTR lpszValue);
          CString     GetInputTextValue(LPCTSTR lpszFieldName);
      
          ///////////////////////////////////////////////////////////////////
          // Drop-down list / list box
          BOOL        RemoveAllOptionElements(LPCTSTR lpszFieldName);
          BOOL        AddOptionElement(LPCTSTR lpszFieldName, 
                                       LPCTSTR lpszOptionText, 
                                       LPCTSTR lpszOptionValue = NULL,
                                       BOOL bSelected = FALSE, 
                                       BOOL bDefault = FALSE,
                                       long nBefore = -1);
          BOOL        ClearSelection(LPCTSTR lpszFieldName);
          BOOL        SetOptionSelected(LPCTSTR lpszFieldName,
                                        LPCTSTR lpszOptionText);
      
          ///////////////////////////////////////////////////////////////////
          // Checkbox Specific
          BOOL        SetCheck(LPCTSTR lpszFieldName);
          BOOL        ClearCheck(LPCTSTR lpszFieldName);
      
          ///////////////////////////////////////////////////////////////////
          // Regular Button Specific
          BOOL        SetButtonAction(LPCTSTR lpszFieldName, LPCTSTR lpszAction);
      
          ///////////////////////////////////////////////////////////////////
          // Radio Button Specific
          BOOL        SetRadioSelected(LPCTSTR lpszFieldName, BOOL bSelected);
          BOOL        SetRadioDisabled(LPCTSTR lpszFieldName, BOOL bDisabled);
      
      public:
          ///////////////////////////////////////////////////////////////////
          // NOTE: If you use these functions, you must navigate to a
          //       page for them to take effect!
          //
          // Use "Navigate2(GetLocationURL(), 0, NULL, NULL);" to navigate
          // to the page currently displayed
          ///////////////////////////////////////////////////////////////////
      
          ///////////////////////////////////////////////////////////////////
          // DocHostUIHandler DoubleClick interface functions
          DWORD        GetUI_DblClk() const;
          void        SetUI_DblClk(DWORD dwSet);
      
          ///////////////////////////////////////////////////////////////////
          // DocHostUIHandler Flags interface functions
          DWORD        GetUI_Flags() const;
          void        SetUI_Flags(DWORD dwSet);
      
          BOOL        GetUIFlag_Dialog() const;
          BOOL        GetUIFlag_DisableHelpMenu() const;
          BOOL        GetUIFlag_No3dBorder() const;
          BOOL        GetUIFlag_NoScrollbar() const;
          BOOL        GetUIFlag_DisableScriptInactive() const;
          BOOL        GetUIFlag_OpenNewWin() const;
          BOOL        GetUIFlag_DisableOffscreen() const;
          BOOL        GetUIFlag_FlatScrollbar() const;
          BOOL        GetUIFlag_DivBlockDefault() const;
          BOOL        GetUIFlag_ActivateClientHitOnly() const;
      
          void        SetUIFlag_Dialog(BOOL bSet);
          void        SetUIFlag_DisableHelpMenu(BOOL bSet);
          void        SetUIFlag_No3dBorder(BOOL bSet);
          void        SetUIFlag_NoScrollbar(BOOL bSet);
          void        SetUIFlag_DisableScriptInactive(BOOL bSet);
          void        SetUIFlag_OpenNewWin(BOOL bSet);
          void        SetUIFlag_DisableOffscreen(BOOL bSet);
          void        SetUIFlag_FlatScrollbar(BOOL bSet);
          void        SetUIFlag_DivBlockDefault(BOOL bSet);
          void        SetUIFlag_ActivateClientHitOnly(BOOL bSet);
      
      ///////////////////////////////////////////////////////////////////
      // Basic CHtmlView Operations
      //
      public:
          void        GoBack();
          void        GoForward();
          void        GoHome();
          void        GoSearch();
          void        Navigate(LPCTSTR URL, DWORD dwFlags = 0, 
                               LPCTSTR lpszTargetFrameName = NULL, 
                               LPCTSTR lpszHeaders = NULL, 
                               LPVOID lpvPostData = NULL, DWORD dwPostDataLen = 0);
          void        Navigate2(LPITEMIDLIST pIDL, DWORD dwFlags = 0, 
                                LPCTSTR lpszTargetFrameName = NULL);
          void        Navigate2(LPCTSTR lpszURL, DWORD dwFlags = 0, 
                                LPCTSTR lpszTargetFrameName = NULL, 
                                LPCTSTR lpszHeaders = NULL, 
                                LPVOID lpvPostData = NULL, DWORD dwPostDataLen = 0);
          void        Navigate2(LPCTSTR lpszURL, DWORD dwFlags, 
                                CByteArray& baPostedData, 
                                LPCTSTR lpszTargetFrameName = NULL, 
                                LPCTSTR lpszHeader = NULL);
          void        Refresh();
          void        Refresh2(int nLevel);
          void        Stop();
          void        PutProperty(LPCTSTR lpszProperty, const VARIANT& vtValue);
          void        PutProperty(LPCTSTR lpszPropertyName, double dValue);
          void        PutProperty(LPCTSTR lpszPropertyName, LPCTSTR lpszValue);
          void        PutProperty(LPCTSTR lpszPropertyName, long lValue);
          void        PutProperty(LPCTSTR lpszPropertyName, short nValue);
          BOOL        GetProperty(LPCTSTR lpszProperty, CString& strValue);
          COleVariant     GetProperty(LPCTSTR lpszProperty);
          void        ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, 
                             VARIANT* pvaIn, VARIANT* pvaOut);
          BOOL        LoadFromResource(LPCTSTR lpszResource);
          BOOL        LoadFromResource(UINT nRes);
      
      ///////////////////////////////////////////////////////////////////
      // Overrides
      ///////////////////////////////////////////////////////////////////
          // ClassWizard generated virtual function overrides
          //{{AFX_VIRTUAL(CHtmlViewEx)
          public:
          virtual void OnDraw(CDC* pDC);
          virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
                              DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, 
                              UINT nID,CCreateContext* pContext = NULL);
          virtual BOOL OnAmbientProperty(COleControlSite* pSite, DISPID dispid, 
                                         VARIANT* pvar);
          //}}AFX_VIRTUAL
      
      ///////////////////////////////////////////////////////////////////
      // Overridable Event Notifications
      //
      public:
          virtual void OnNavigateComplete2(LPCTSTR strURL);
          virtual void OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags,    
                                         LPCTSTR lpszTargetFrameName, 
                                         LPCTSTR strPostedData,    
                                         LPCTSTR lpszHeaders, BOOL* pbCancel);
          virtual void OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags,
                                         LPCTSTR lpszTargetFrameName, 
                                         CByteArray& baPostedData,    
                                         LPCTSTR lpszHeaders, BOOL* pbCancel);
          virtual void OnStatusTextChange(LPCTSTR lpszText);
          virtual void OnProgressChange(long nProgress, long nProgressMax);
          virtual void OnCommandStateChange(long nCommand, BOOL bEnable);
          virtual void OnDownloadBegin();
          virtual void OnDownloadComplete();
          virtual void OnTitleChange(LPCTSTR lpszText);
          virtual void OnPropertyChange(LPCTSTR lpszProperty);
          virtual void OnNewWindow2(LPDISPATCH* ppDisp, BOOL* Cancel);
          virtual void OnDocumentComplete(LPCTSTR lpszURL);
          virtual void OnQuit();
          virtual void OnVisible(BOOL bVisible);
          virtual void OnToolBar(BOOL bToolBar);
          virtual void OnMenuBar(BOOL bMenuBar);
          virtual void OnStatusBar(BOOL bStatusBar);
          virtual void OnFullScreen(BOOL bFullScreen);
          virtual void OnTheaterMode(BOOL bTheaterMode);
          virtual void OnFilePrint();
      
          // Formerly unimplemented
          virtual void OnAddressBar(BOOL bAddressBar);
          virtual void OnAppCmd(LPCTSTR lpszAppCmd, LPCTSTR PostData);
          virtual void OnAdvancedContextMenu(DWORD dwID, CPoint ptPosition, 
                                             IUnknown* pCommandTarget, 
                                             IDispatch* pDispatchObjectHit);
          virtual void OnShowHelp(HWND hwnd, LPCTSTR pszHelpFile,
                                  UINT uCommand,DWORD dwData,POINT ptMouse,
                                  IDispatch __RPC_FAR *pDispatchObjectHit);
          virtual void OnShowMessage(HWND hwnd, LPCTSTR lpstrText,
                                     LPCTSTR lpstrCaption, DWORD dwType,
                                     LPCTSTR lpstrHelpFile, DWORD dwHelpContext, 
                                     LRESULT __RPC_FAR *plResult);
          virtual void OnViewSource();
          virtual void OnToolsInternetOptions();
          virtual void OnEditCut();
          virtual void OnEditCopy();
          virtual void OnEditPaste();
          virtual void OnEditSelectall();
          virtual void OnEditFindOnThisPage();
          virtual void OnWindowSetResizable(BOOL Resizable);
          virtual void OnWindowClosing(BOOL IsChildWindow, BOOL* Cancel);
          virtual void OnWindowSetLeft(long left);
          virtual void OnWindowSetTop(long Top);
          virtual void OnWindowSetWidth(long Width);
          virtual void OnWindowSetHeight(long Height);
          virtual void OnClientToHostWindow(long* CX, long* CY);
          virtual void OnSetSecureLockIcon(long SecureLockIcon);
          virtual void OnFileDownload(BOOL* Cancel);
      
      ///////////////////////////////////////////////////////////////////
      // Implementation
      ///////////////////////////////////////////////////////////////////
      protected:
          IWebBrowser2* m_pBrowserApp;
      
      public:
      
          virtual ~CHtmlViewEx();
          CWnd m_wndBrowser;
      
      ///////////////////////////////////////////////////////////////////
      // Event reflectors (not normally overridden)
      protected:
          virtual void NavigateComplete2(LPDISPATCH pDisp, VARIANT* URL);
          virtual void BeforeNavigate2(LPDISPATCH pDisp, VARIANT* URL, 
                                       VARIANT* Flags, VARIANT* TargetFrameName, 
                                       VARIANT* PostData, VARIANT* Headers,
                                       BOOL* Cancel);
          virtual void DocumentComplete(LPDISPATCH pDisp, VARIANT* URL);
      
      ///////////////////////////////////////////////////////////////////
      // Internal Helper Functions
      protected:
          char        CharTokenToChar(const CString &val);
          CString        ProcessCharCodes(LPCTSTR lpszInput);
          void        RemoveAllOptionElements_(IHTMLSelectElement* pSelectElem);
      
          // Custom UI Toggles
          void        UseCustomHelp(BOOL bSet);
          void        UseCustomMessage(BOOL bSet);
          void        UseCustomContextMenu(BOOL bSet);
          void        UseAdvancedContextMenu(BOOL bSet);
      
      ///////////////////////////////////////////////////////////////////
      // Generated message map functions
      protected:
          //{{AFX_MSG(CHtmlViewEx)
          afx_msg void OnSize(UINT nType, int cx, int cy);
          afx_msg void OnPaint();
          afx_msg void OnDestroy();
          //}}AFX_MSG
      
          DECLARE_MESSAGE_MAP()
          DECLARE_EVENTSINK_MAP()
      };
      
      #undef  AFX_DATA
      #define AFX_DATA
      
      /////////////////////////////////////////////////////////////////////////////
      //{{AFX_INSERT_LOCATION}}
      // Microsoft Developer Studio will insert additional declarations immediately
      // before the previous line.
      
      ///////////////////////////////////////////////////////////////////
      // Inline Functions (They looked too messy in this file)
      #include "HtmlViewEx.inl"
      
      #endif // __HTMLVIEWEX_H_
         

      In Conclusion

      As I said up above, this library is far from complete. If you have any bug fixes, comments or contributions to help make this library more complete, feel free to contact me via e-mail. You can do a LOT with the library just as it is, but as most code goes, it can always be better.

      You are free to use this library for anything, but if you are using it in an application that will be distributed commercially or for enterprise internal distribution, or want to include it in a larger library, you must contact me before you release it. I will not charge you for it, I just want to know where it's being used to consider providing full support for it.

      Thank You,

      Ted Crow
      Infinity Networking Solutions

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Ted Crow
Chief Technology Officer
United States United States
Member
Ted has been programming computers since 1981 and networking them since 1984. He has been a professional technology manager and computer networking consultant for more than 20 years.
 
Feel free to connect with Ted on LinkedIn

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralJavascript Callback in a DLLmemberochoteau22 Oct '07 - 3:05 
I have implemented a Browser which is created from a DLL.
 
I have 2 problems :
- Frown | :( Events (IDispatch:Invoke) are fired in main App and not in the DLL, so events cannot be catched
- Frown | :( Javascript CallBack function(s) must be in main App (called by window.external.XXX in html page)
 
With the following code below the first problem is solved Smile | :) (ConnectionPoint+Advise).
Confused | :confused: But how to define Javascript CallBack function in DLL and not in App ???
 

// create WebBrowser control
m_pBrowserWindow = new CWnd;
m_pBrowserWindow->CreateControl(CLSID_WebBrowser,NULL,dwStyle,rect,pParentWnd,nID);
// get control interfaces
LPUNKNOWN unknown = m_pBrowserWindow->GetControlUnknown();
unknown->QueryInterface(IID_IWebBrowser2,(void **)&m_pBrowser);
// get connexion point
IConnectionPointContainer* pCPContainer;
m_pBrowser->QueryInterface(IID_IConnectionPointContainer,(void**)&pCPContainer);
pCPContainer->FindConnectionPoint(DIID_DWebBrowserEvents2, &m_pConnectionPoint);
m_pBrowserDispatch = new CBrowserDispatch(BrowserListener);
// Intercept events
m_pConnectionPoint->Advise(m_pBrowserDispatch, &m_dwCPToken);
// Free connection point
if (pCPContainer) { pCPContainer->Release(); }

 
Regards, OCH
GeneralHelp me pleasememberMarmouse27 May '07 - 16:33 
Great work. But I can compile it. Help me please. The Compiling message is:
 
--------------------Configuration: DHTMLUI - Win32 Debug--------------------
Compiling...
HtmlViewEx.cpp
c:\program files\microsoft visual studio\vc98\atl\include\atldbcli.h(76) : error C2065: 'DBFILETIME' : undeclared identifier
c:\program files\microsoft visual studio\vc98\atl\include\atldbcli.h(76) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\atl\include\atldbcli.h(76) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio\vc98\atl\include\atldbcli.h(76) : error C2447: missing function header (old-style formal list?)
HtmlViewExSite.cpp
c:\program files\microsoft visual studio\vc98\atl\include\atldbcli.h(76) : error C2065: 'DBFILETIME' : undeclared identifier
c:\program files\microsoft visual studio\vc98\atl\include\atldbcli.h(76) : error C2059: syntax error : ')'
c:\program files\microsoft visual studio\vc98\atl\include\atldbcli.h(76) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio\vc98\atl\include\atldbcli.h(76) : error C2447: missing function header (old-style formal list?)
Generating Code...
Error executing cl.exe.
 
DHTMLUID.dll - 8 error(s), 0 warning(s)

GeneralApplet in WebBrowsermembercolin-12313 Sep '06 - 0:34 
When I open a html ,which has a Applet, by the WebBrowser Control (the Control is hosted in a Dialog-based Application ) ,I got some error
("Free block 0x**** modified after it was freed")
What's the reason ?
The problem still exists when I use CHtmlView.
 
colin

GeneralErrormemberDevil for ever29 Nov '05 - 7:26 
nice article but there is a header i didn't have! it is cald #include <../src/implcc.h>... maybe you should use #include ... that functionate!°!°
GeneralRe: ErrormemberTed Crow1 Dec '05 - 3:30 
#include <../src/implcc.h>
 
You may want to check your build tree - I don't remember that particular header file as being one of mine.
 
Make sure you have the full MFC Library source code and the Platform SDK installed before trying to compile this library. I know this compiled perfectly as-is the last time I needed it.
 


deep magic
n. [poss. from C. S. Lewis's "Narnia" books] An awesomely arcane technique central to a program or system, esp. one neither generally published nor available to hackers at large; one that could only have been composed by a true wizard. Compiler optimization techniques and many aspects of OS design used to be deep magic; many techniques in cryptography, signal processing, graphics, and AI still are.


GeneralRe: ErrormemberMMs_xH4 Apr '06 - 21:37 
comment these lines and add in file
 
"StdAfx.h"
 
this line:
 
#include < afxocc.h >
 

GeneralA small improvementmemberMario Orlandi4 Mar '04 - 3:03 
First of all, thanks to Ted for a *VERY* interesting article.
I'ld like to share some ideas for possible small improvements.
 
I've noticed some redundant code in the following methods:
GetInputElementByName()
GetSelectElementByName()
GetTextAreaElementByName()
 
All these methods start by retrieving the elements collection, so why not incapsulate this code in a single function ?
This could perhaps be useful by it's own to the application; more importantly, it simplifies the implementation of each method.
 

IHTMLElementCollection* CHtmlViewEx::GetDocumentElements()
{
LPDISPATCH pDocDisp;
//IDispatch* pOutDisp = NULL;
IHTMLDocument2* pHTMLDocument = NULL;
IHTMLElementCollection* pHTMLElements = NULL;
 
if(SUCCEEDED(m_pBrowserApp->get_Document(&pDocDisp)))
{
if(SUCCEEDED(pDocDisp->QueryInterface(IID_IHTMLDocument2, (void**)&pHTMLDocument)))
{
pHTMLDocument->get_all(&pHTMLElements);
}
}
 
RELEASE(pHTMLDocument);
RELEASE(pDocDisp);
 
return pHTMLElements;
}

 
The caller is responsable to RELEASE() the IHTMLElementCollection interface.
 
Having retrieved the elements' collection, we can avoid a sequention iteration on every single element by using the first parameter of pHTMLElements->item() as follows:
 

IHTMLElement* CHtmlViewEx::GetElementByIdOrName( const char* lpszElementId, int idx = 0 )
{
IHTMLElementCollection* pHTMLElements = GetDocumentElements();
IHTMLElement* pElem = NULL;
 
if ( pHTMLElements )
{
_variant_t name(lpszElementId);
_variant_t index((long)idx);
IDispatch* pDisp = NULL;
if ( SUCCEEDED(pHTMLElements->item(name, index, &pDisp )) && pDisp )
{
pDisp->QueryInterface( __uuidof( IHTMLElement), (void **)&pElem );
RELEASE(pDisp);
}
RELEASE(pHTMLElements);
}
 
return pElem;
}

 
This code fragment finds the first (if any) element with given name or id;
if you have more then one element with same id and/or name (no so common) you can retrieve each one supplying a suitable value to the optional parameter idx (0-based).

Questionhow to bypass intermediate response pagesmembershivsun13 Jun '03 - 0:50 
I have specific requirement to write the html(response) pages obtained using the WebBrowser controls.So, I wrote a event handler to the OnDocumentComplete event.Inside the handler, I am caling the getDocument function and obtained the html page.When doing like this, the intermediate pages are also stored.I mean the pages which contain meta http-equvi=refresh.I need only the final response page that is diaplayed on the browser window.Is there any way to do this. Please help me. Can any of you tell me the usage and significance of the option OLECMDID_HTTPEQUIV in execWB()call.Will this be helpful to solve my issue.If so, please give me some ideas on its usage.Cry | :((
GeneralLoad an eml message directly into webbrowsermemberJuan Martin16 May '03 - 3:27 
Hi, i am working on a project in visual basic, is a mail client for personal use wich will have the capabilities that i want.
Now i am investigating how to load an email message into the webbrowser component without a file, so i will have a database with the messages stored in and don´t have to save it into a file to view it.
I know the webbrowser interprets eml files as do with mht files and even files without extention when you call to navigate method, and then loads the content of the file with all the mime content, but how to do it without a file.
How does this outlook express, eudora, etc?
Thanks!Smile | :)
GeneralRe: Load an eml message directly into webbrowsersussSebastián Araya23 Dec '03 - 6:03 
See http://www.numisys.com.ar/chdviewer.html
GeneralHelp me,please!memberLittleFox27 Apr '03 - 19:39 
-------------------Configuration: DHTMLUI - Win32 Debug--------------------
Compiling...
HtmlDialog.cpp
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlDialog.cpp(124) : error C2664: 'long (struct HWND__ *,struct IMoniker *,struct tagVARIANT *,char *,struct tagVARIANT *)' : cannot convert parameter 4 from 'unsigned short *' to 'c
har *'
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
HtmlViewEx.cpp
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1126) : error C2065: 'CONTEXT_MENU_VSCROLL' : undeclared identifier
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1126) : error C2051: case expression not constant
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1129) : error C2065: 'CONTEXT_MENU_HSCROLL' : undeclared identifier
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1129) : error C2051: case expression not constant
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1671) : error C2065: 'IHTMLInputElement' : undeclared identifier
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1671) : error C2065: 'pElem' : undeclared identifier
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1671) : warning C4552: '*' : operator has no effect; expected operator with side-effect
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1673) : error C2065: 'IID_IHTMLInputElement' : undeclared identifier
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1675) : error C2227: left of '->get_name' must point to class/struct/union
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1685) : error C2227: left of '->Release' must point to class/struct/union
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1693) : error C2227: left of '->Release' must point to class/struct/union
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1901) : error C2065: 'pInputElem' : undeclared identifier
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1901) : warning C4552: '*' : operator has no effect; expected operator with side-effect
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1906) : error C2227: left of '->put_value' must point to class/struct/union
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1913) : error C2227: left of '->Release' must point to class/struct/union
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1930) : warning C4552: '*' : operator has no effect; expected operator with side-effect
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1935) : error C2227: left of '->get_value' must point to class/struct/union
C:\Documents and Settings\Administrator\&#26700;&#38754;\Temp\DHTMLUI\DHTMLUI\HtmlViewEx.cpp(1942) : error C2227: left of '->Release' must point to class/struct/union
Generating Code...
Error executing cl.exe.
 
DHTMLUID.dll - 16 error(s), 3 warning(s)
----------------------------------------------------------------
Why?Eek! | :eek:

 
&#19990;&#38388;&#33258;&#26377;&#20844;&#36947;&#65292;
&#20184;&#20986;&#24635;&#26377;&#27719;&#25253;&#12290;
&#35828;&#21040;&#19981;&#22914;&#20570;&#21040;&#65292;
&#35201;&#20570;&#23601;&#20570;&#26368;&#22909;&#12290;

GeneralRe: Help me,please!memberTed Crow2 May '03 - 5:38 
It's been quite a while since even *I* have used this library. I'm afraid I have moved on to VS.NET and most of my development work right now is ASP.NET/C# based. I haven't had a need to convert the library to use in VS.NET yet, I think someone else was planning to port it though.
 
WTF | :WTF: Yikes, has it already been two years since I posted this article?
 
Confused | :confused: I seem to vaguely remember this set of errors occuring when compiling without the Internet Explorer 5.x SDK installed. I don't think I ever updated this library for IE 6.x, but the IE SDK is supposed to be backwards compatible. If anyone out there has more recent experience with DHTMLUI, maybe they could comment on these errors.
 
- Ted
 
deep magic
n. [poss. from C. S. Lewis's "Narnia" books] An awesomely arcane technique central to a program or system, esp. one neither generally published nor available to hackers at large; one that could only have been composed by a true wizard. Compiler optimization techniques and many aspects of OS design used to be deep magic; many techniques in cryptography, signal processing, graphics, and AI still are.

GeneralRe: Help me,please!membertrue6420 Jul '05 - 2:14 
deep magic
 
I like this. Laugh | :laugh:
wizards like to make their work untouchable by most of the folks out there. we shall call them black artist.Cool | :cool:
GeneralRe: Help me,please!memberraymond xu7 Nov '05 - 18:36 
Hello, Guys!, I'm Chinese too. This problem has happened to me when I first complie the lib. If you have install the VS2003, you will have been installed a Windows Platform SDK, then change your include directory's order with SDK's includes first, or you can add this directory in your VC6's includes directory.;)
 
raymond xu
Questionwhat can it do?memberwpwpwp27 Mar '03 - 3:59 
i use frameset html, i can't get any value from pages.
 
and i don't know the use of there classes
 
who can give me same example.

 
bruce
QuestionWhy ?memberhlpwyx30 Nov '02 - 17:31 
DHTMLUI.cpp
Globals.cpp
HtmlDialog.cpp
D:\book\DHTML\DHTMLUI\HtmlDialog.cpp(124) : error C2664: 'long (struct HWND__ *,struct IMoniker *,struct tagVARIANT *,char *,struct tagVARIANT *)' : cannot convert parameter 4 from 'unsigned short *' to 'char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
HtmlViewEx.cpp
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1126) : error C2065: 'CONTEXT_MENU_VSCROLL' : undeclared identifier
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1126) : error C2051: case expression not constant
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1129) : error C2065: 'CONTEXT_MENU_HSCROLL' : undeclared identifier
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1129) : error C2051: case expression not constant
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1671) : error C2065: 'IHTMLInputElement' : undeclared identifier
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1671) : error C2065: 'pElem' : undeclared identifier
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1671) : warning C4552: '*' : operator has no effect; expected operator with side-effect
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1673) : error C2065: 'IID_IHTMLInputElement' : undeclared identifier
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1675) : error C2227: left of '->get_name' must point to class/struct/union
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1685) : error C2227: left of '->Release' must point to class/struct/union
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1693) : error C2227: left of '->Release' must point to class/struct/union
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1901) : error C2065: 'pInputElem' : undeclared identifier
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1901) : warning C4552: '*' : operator has no effect; expected operator with side-effect
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1906) : error C2227: left of '->put_value' must point to class/struct/union
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1913) : error C2227: left of '->Release' must point to class/struct/union
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1930) : warning C4552: '*' : operator has no effect; expected operator with side-effect
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1935) : error C2227: left of '->get_value' must point to class/struct/union
D:\book\DHTML\DHTMLUI\HtmlViewEx.cpp(1942) : error C2227: left of '->Release' must point to class/struct/union
HtmlViewExSite.cpp
Generating Code...
Error executing cl.exe.
 
DHTMLUID.dll - 16 error(s), 3 warning(s)
Poke tongue | ;-P
 
help
AnswerRe: Why ?sussAnonymous20 Jul '03 - 21:48 
make sure that include SDK before VC,then you will ome through it
GeneralSetSilent API of web browser ctrl not functioningsussRakhi21 Oct '02 - 1:32 
Hi Ted,
 
I am using Microsoft's Web browser Control in my application (MFC application on Windows 2000). I have to suppress the file open dialog box that pops up when attaching files to emails (say thru yahoo/ hotmail). I came across the API SetSilent() provided by IWebBrowser2 which determines whether the object can show any dialog boxes. If TRUE, dialog boxes are not displayed; if FALSE, dialog boxes are displayed.
But even on setting the Silent property of web browser ctrl to TRUE, the dialog boxes are still poping up.
Would you have any idea why is it so?
 
Also is there any alternate solution to suppress choose file dialog that pops up on clicking 'Add/Delete Attachment' on any mailing site.
 


 
Rakhi Govil
GeneralRe: SetSilent API of web browser ctrl not functioningmember__Stephane Rodriguez__21 Oct '02 - 1:59 

Use Spy++ to identify the control IDs.
 
Then fill the editboxes, ... and send the OK message.

 


How low can you go ?
(MS retrofuck)
GeneralHTMLDialogsussAnonymous15 Aug '02 - 12:01 

excellent library. i think it would be better if it wasnt a library but only the source files, i had much trouble building my app with static bindings, and in addition, i wanted only one small exe, so i decided to create the classes and copy the code manually in these classes, but your code helped me very much with some special problems (window.external)...
 
also, i found a bug regarding the html dialog. i had problems setting the size of the dialog. the line
 
WCHAR* pchOptions = (WCHAR*)(m_strOptions.IsEmpty() ? NULL : m_strOptions.GetBuffer(0));
 
is not what we want, because you do a typecast from CHAR to WCHAR (???). this is not kosher, we need to translate the string explicitly into a wide char string:
 
int iLength = m_strOptions.GetLength();
LPWSTR lpWideCharStr = NULL;
lpWideCharStr = new wchar_t[iLength+1];
if(MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,m_strOptions.GetBuffer(0),iLength+1,lpWideCharStr,sizeof( wchar_t ) * (iLength) ))
{
hr = (*pfnShowHTMLDialog)(m_hWndParent, pmk, &m_varArgs, lpWideCharStr, &m_varReturn);
}
 
so this will convert and display the dialog with the options we have passed...

GeneralCHtmlView and SwingmemberSky17 Jul '02 - 22:45 
I have used the class CHtmlView to make a web browser but when I run applet that use javax.swing, my web browser doesn't work, it doens't accept swing...
How to make my web browser accept swing ?
 
Thx a lot,
 
Sky
QuestionHow to insert an ActiveX ctrl into an HTML document ?memberLucian Bumbuc1 Jul '02 - 8:23 
Hi everyone,
I have to deal with an MFC app that's used as an HTML editor by reusing
mshtml.dll.
I wonder if there's some COM interface into mshtml.dll that let me write
some code to insert an ActiveX control into the HTML document ?
Some sample or refferences are wellcome.
Thanks,
Lucian Bumbuc
lbumbuc@asp-gmbh.de
 

GeneralC:\Backup2\projects\DHTMLUI\DHTMLUI\HtmlDialog.cpp(124) : error C2664: 'long (struct HWND__ *,struct IMoniker *,struct tagVARIANT *,char *,struct tagVARIANT *)' : cannot convert parameter 4 from 'unsigned short *' to 'char *'memberJoeSox29 May '02 - 4:46 
I can not get to compile did tools>options>directories
and
Projects Settings > working directory for all
 
I am developing in MS VC++ 6.0 sp5, IE6.0, win98se
 
Any Ideas??!!Cry | :((
GeneralRe: C:\Backup2\projects\DHTMLUI\DHTMLUI\HtmlDialog.cpp(124) : error C2664: 'long (struct HWND__ *,struct IMoniker *,struct tagVARIANT *,char *,struct tagVARIANT *)' : cannot convert parameter 4 from 'unsigned short *' to 'char *'sussAnonymous4 Oct '02 - 22:49 
I had same problem, updated ms platform sdk and it's ok now
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
GeneralRe: C:\Backup2\projects\DHTMLUI\DHTMLUI\HtmlDialog.cpp(124) : error C2664: 'long (struct HWND__ *,struct IMoniker *,struct tagVARIANT *,char *,struct tagVARIANT *)' : cannot convert parameter 4 from 'unsigned short *' to 'char *'memberJoeSox5 Oct '02 - 10:28 
Thanks, I'll try that
GeneralRe: C:\Backup2\projects\DHTMLUI\DHTMLUI\HtmlDialog.cpp(124) : error C2664: 'long (struct HWND__ *,struct IMoniker *,struct tagVARIANT *,char *,struct tagVARIANT *)' : cannot convert parameter 4 from 'unsigned short *' to 'char *'membercpt. holister6 Oct '02 - 3:32 
No problem, I considered If i should answer 5 month old question Laugh | :laugh: OMG | :OMG: Wink | ;-) )
GeneralMind reader? :)memberPhilip Patrick25 May '02 - 10:47 
Hey, are you a mind reader? Smile | :)
I have used DHTML interface also, and many times thought to put my code in separate library, but never had a free time to do that Frown | :(
You just done a very good job by doing this. Keep it up! Smile | :)
 
BTW, found many features that I didn't have, so it will be very useful for me... Smile | :)
 
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
 
Need Web-based database administrator? You already have it!
GeneralDHTML and VC7 (Visual Studio .NET)memberTBiker2 May '02 - 5:59 
I used Ted Crow's library under Studio 6 and added a lot of support to handle ActiveX controls embedded in HTML pages, frame-based HTML, display refresh fixes, etc.. When .NET came out as a final release, I decided to peek at their new CDHtmlDialog class (Microsoft's idea of dialog support using DHTML). But, of course, Microsoft only scratched the surface in carrying out "proper" support (no support for frames, etc.). So I took the DHtmlDialog class and reworked the classes so that the idea of rendering HTML to a view (CHtmlView) and the idea of processing DHTML events (CDHtmlDialog) could be combined easily and used as a common engine for HTML-based application design. I will be posting my new classes shortly (lots of testing this week) but you will get an event management class (CHtmlEvent) and a simple class derived from CHtmlView to notify the event class when documents are ready to process.
 

GeneralRe: DHTML and VC7 (Visual Studio .NET)memberShog2 May '02 - 15:23 
TBiker wrote:
I will be posting my new classes shortly
 
Cool! I can hardly wait Smile | :)
GeneralRe: DHTML and VC7 (Visual Studio .NET)memberpeterchen22 Jul '06 - 21:56 
Don't hold your breath Smile | :)
 


Some of us walk the memory lane, others plummet into a rabbit hole

Tree in C# || Fold With Us! || sighist

GeneralRe: DHTML and VC7 (Visual Studio .NET)memberTed Crow4 May '02 - 9:03 
I finally received my copy of VS.NET and was planning on doing some porting work myself. I would be very interested to see what you came up with!
GeneralRe: DHTML and VC7 (Visual Studio .NET)memberEd K19 Aug '03 - 8:52 
Did you ever post this article??
 
ed
 
Regulation is the substitution of error for chance.
GeneralRe: DHTML and VC7 (Visual Studio .NET)sussAnonymous19 Aug '03 - 16:03 
I didn't bother back then. I can submit the two classes if there is still interest. They work well.
GeneralRe: DHTML and VC7 (Visual Studio .NET)memberEd K19 Aug '03 - 17:00 
Please do...or if you could please send them to me. I am about to start a project which could make good use of them.
 
ed
 
Regulation is the substitution of error for chance.
GeneralRe: DHTML and VC7 (Visual Studio .NET)memberNavi2 Mar '04 - 14:11 
Still waiting for the two classes. Could you simply email them to me at navisingh@yahoo.com.
 
Thanks.
GeneralRe: DHTML and VC7 (Visual Studio .NET)memberHung2k27 Feb '05 - 19:09 
Where did you post these classes code ?
I'm interested in how to intercept the user events such as double-click, scroll up and down, and drag and drop occur on my HTMLView.
Can you help me with the advice, if these classes were not posted as yet
 
Thank you very much
Hung
GeneralE-Mail to TedmemberUrs Brunner25 Apr '02 - 10:35 
Hi
I try to send a question to Ted by E-mail but it was not deliverd.
 
:
Sorry, no mailbox here by that name. (#5.1.1)
 
Who know his E-mail address
 
Smile | :)
GeneralRe: E-Mail to TedmemberTed Crow2 May '02 - 4:33 
You should be able to send a message to me via CodeProject... My e-mail address has changed, but the address is updated in the codeproject database.
GeneralRe: E-Mail to TedmemberEd K25 Aug '03 - 10:57 
Ted!
 
Where is the sample for this article??
 
ed
 
Regulation is the substitution of error for chance.
GeneralOnly example of overriding container in MFCmemberAnonymous21 Feb '02 - 10:38 
Thanks for posting this. I searched MSDN and elsewhere and couldn't find an example of overriding the container so that you can set your own client site when using CHtmlView.
 
I found the SetUIHandler() approach to adding a IDocHostUIHandler buggy in IE 6 (The GetDropTarget wasn't being called while others were). Also, wanted to get at the IDocHostShowUI. Finding this to get me started was what I needed.
 
Smile | :) Smile | :) Smile | :)
GeneralCan't get to compile.memberSibilant6 Feb '02 - 15:57 
Compiling...
StdAfx.cpp
Compiling...
HtmlViewEx.cpp
c:\program files\microsoft visual studio\vc98\include\transact.h(226) : error C2059: syntax error : 'constant'
c:\program files\microsoft visual studio\vc98\include\transact.h(271) : error C2143: syntax error : missing ';' before '}'
c:\program files\microsoft visual studio\vc98\include\oledb.h(17149) : error C2143: syntax error : missing ';' before '}'
c:\program files\microsoft visual studio\vc98\include\oledb.h(17149) : error C2143: syntax error : missing ';' before '}'
c:\program files\microsoft visual studio\vc98\include\oledb.h(17149) : error C2143: syntax error : missing ';' before '}'
c:\program files\microsoft visual studio\vc98\mfc\src\olebind.h(19) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio\vc98\mfc\src\olebind.h(19) : error C2447: missing function header (old-style formal list?)
HtmlViewExSite.cpp
c:\program files\microsoft visual studio\vc98\include\transact.h(226) : error C2059: syntax error : 'constant'
c:\program files\microsoft visual studio\vc98\include\transact.h(271) : error C2143: syntax error : missing ';' before '}'
c:\program files\microsoft visual studio\vc98\include\oledb.h(17149) : error C2143: syntax error : missing ';' before '}'
c:\program files\microsoft visual studio\vc98\include\oledb.h(17149) : error C2143: syntax error : missing ';' before '}'
c:\program files\microsoft visual studio\vc98\include\oledb.h(17149) : error C2143: syntax error : missing ';' before '}'
Generating Code...
Skipping... (no relevant changes detected)
DHTMLUI.cpp
Globals.cpp
HtmlDialog.cpp
Error executing cl.exe.
 
DHTMLUID.dll - 12 error(s), 0 warning(s)
 
Any sugestions would be greatly appreciated.
GeneralRe: Can't get to compile.sussNewGuy19 Jul '02 - 22:59 
Just rename the "transact.h" in the vc98 folder to something else. Then, the transact.h file in the sdk directories will be used. I'm not sure why the .h in vc98 was being used in my compile environment as the directories were in the correct order. That is, with the sdk folders at the top. Good luck.
GeneralRe: Can't get to compile.sussTong12 Nov '02 - 8:13 
You need to install MDAC SDK and then compile it again. Good luck!Smile | :)
GeneralObject Doesn't support this property or methodmemberchidu3 Jan '02 - 11:01 
Hi
 
I am trying to use this library for accessing function from javascript to vc++ application.
This works fine when I created a new application with automation in it. But adding the automation to already existing project and then adding this library gives out the following error when asked to execut any script from the html file.
 
is there anybody who can help me out.
 
thanks

GeneralDHTML simple example requestmemberTBiker11 Dec '01 - 9:01 
Hi,
 
Could you provide a really simple example of using this library with a Forms based HTML page that reacts to clicks on radio buttons (for example). It would be good to see how various form based controls have their values set and their values retrieved using MFC calls.
 
Thanks for the support.
GeneralFor the many people using the DHTMLUI LibrarymemberTed Crow24 Nov '01 - 5:01 

I have received dozens of e-mails concerning this library and have had the time to respond to only a few. I have been extremely busy at the office, rolling out new operating systems, and designing the new network infrastructure for next year's upgrade. Through all of this, I have also been dealing with the purchase of a new home!
 
In the near future (after I have moved into my new home and set up my broadband internet) I will be seting up a web site to provide limited support and open a forum to cover issues that have arisen with certain build configurations. This project will continue to be an Open Source venture and I may do this through SourceForge, but the library will continue to be updated here, as this is still my favorite repository for windows development.
 
I am considering adding an ASP compatible scripting engine into this library, porting it to C#, etc. but I need to get this project organized first. I can't do this until I get things settled in my personal life. When I get everything going, I may even be looking for some help!

GeneralE-Mail Problems ... and a Hard Drive CrashmemberTed Crow12 Sep '01 - 3:17 
Dead | X|
I have recently suffered a major hard disk crash which resulted in the loss of a substantial number of email messages from you, the users of this library. I was answering the messages in the order they were received but with 5 to 10 new messages per day, they were beginning to pile up. (I don't have as much free time as I did) I will able to recover the bulk of my source code libraries (They were on a secondary partition, away from where the disk head impacted the platter) But I esimate I will be effectively down for at least a week or two.
 
When all is back to relative normalcy, I plan to release an update to the library which fixes some of the build problems and updates the library to support the latest Platform SDK and will include some updated build code to help you track down the libraries you are missing.
 
If you have updates you sent to me in the past 2 months, please send them again. The last message I remember responding to was recieved in July, but I cannot be 100% sure all updates were committed to the library code base.
 
Thank You
Ted Crow
GeneralCannot build static LibrarymemberSamYuen10 Sep '01 - 17:19 
I am very impressed with your library. It is very helpful. But unfortunately, I cannot build the static library when I try to use MFC Static DLL. Would you please help? Thanks
 

Sam
Smile | :)
 
Samuel
GeneralExcellent!memberMatt Gullett14 Aug '01 - 13:14 
I just wanted to let you know that I really appreciate the hard work you have put into this. It has saved me a tremendous amount of time! Keep up the great work!
 
Thanks,
 
Matt Gullett
GeneralCan't find IHtmlInputElementmemberPål25 Jan '01 - 5:38 
Frown | :( I'm not able to compile the source code because IHTMLInputElement can't be found. Does the code require a special version of something. The MSHTML.h contains a lot of IHTMLInput****
elements like button and li but not Element itself. Where can I find what I want
 
Thanks in advance

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 2 Mar 2013
Article Copyright 2001 by Ted Crow
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid