Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / September 2008



Tip: Looking for answers? Try searching our database.

ShowHTMLDialog not using my params passed in pchOptions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rhardy - 22 Sep 2008 23:34 GMT
I have a plain Win32 App in which I'm trying to display an HTML resource
using ShowHTMLDialog.  It works okay, but it does not apply the window
ornaments that I specify in 4th argument of ShowHTMLDialog, pchOptions.  I
specify the dialog window size and make it resizeable.  Would someone take a
look at my code and tell me what I'm doing wrong.

HINSTANCE   hMsHtmlDll = LoadLibrary(TEXT("MSHTML.DLL"));

if(hMsHtmlDll)
{
    SHOWHTMLDIALOGFN  *pfnShowHTMLDialog;

    pfnShowHTMLDialog = (SHOWHTMLDIALOGFN*)GetProcAddress(hMsHtmlDll,
        "ShowHTMLDialog");

    if(pfnShowHTMLDialog)
    {
        IMoniker *pMoniker;
        char     szTemp[MAX_PATH*2];
        OLECHAR  bstr[MAX_PATH*2];

        strcpy(szTemp, TEXT("res://"));
       
        GetModuleFileName(hInst, szTemp + lstrlen(szTemp),
            (sizeof(szTemp)/sizeof(szTemp[0])) - lstrlen(szTemp));
       
        sprintf(&szTemp[strlen(szTemp)], "/%d", IDR_HTML_HELP);

        bstr[0] = 0;
        MultiByteToWideChar(CP_ACP, 0, szTemp, -1, bstr,
            sizeof(bstr)/sizeof(bstr[0]));

        CreateURLMoniker(NULL, bstr, &pMoniker);

        if(pMoniker)
        {
            strcpy(szTemp, "resizeable:yes; dialogWidth:640px; dialogHeight:480px;");

                      // szTemp IS BEING IGNORED HERE.  WHAT'S WRONG?
            (*pfnShowHTMLDialog)(hWndMain, pMoniker, NULL, szTemp, NULL);

            pMoniker->Release();
        }
    }
    FreeLibrary(hMsHtmlDll);
}
Thorsten Albers - 22 Sep 2008 23:47 GMT
rhardy <rhardy@discussions.microsoft.com> schrieb im Beitrag
<B208ED32-146C-4757-BF06-A537EF476350@microsoft.com>...
> Would someone take a look at my code and tell me what I'm doing wrong.

Your code is C/C++ code - but this newsgroup is for MS Visual Basic <= 6
aka 'classic' only. Please ask your question in a newsgroup dealing with
C/C++ coding of which there are plenty on the net.
Be aware of the fact that with questions regarding C/C++ and the Windows
API usually you don't have to search a special group for Windows API coding
but may ask your question in a 'normal' C/C++ group since C/C++ coding for
Windows without using the Windows API is nearly impossible.

Signature

----------------------------------------------------------------------
Thorsten Albers                               albers(a)uni-freiburg.de
----------------------------------------------------------------------

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.