Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ShowHTMLDialog not working in Windows 7

ShowHTMLDialog not working in Windows 7

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharpc++visual-studiohelp
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    doug25
    wrote on last edited by
    #1

    Hi, I thought I'd cracked this problem but it seems that I was wrong. Although I know now that the problem lies with the operating system. I want to display a web page in a window. I realized that this is possible with the ShowHTMLDialog function, however it only works in windows XP not windows 7. There is something else though: I can get a web page to display when I run the program directly in visual studio but not when I run it as a stand-alone application(in windows 7). So I think the problem is that some required dlls are being loaded when I run it in visual studio but not as standalone. It seems that the only dll i need for ShowHTMLDialog is mshtml.dll but I'm not sure if other dlls with different versions from windows XP are being used. What's going on when I run the program from visual studio that is different from running the program on it's own ? How do I get ShowHTMLDialog to work in windows 7 ? (I'm not using MFC) thanks,

    C 1 Reply Last reply
    0
    • D doug25

      Hi, I thought I'd cracked this problem but it seems that I was wrong. Although I know now that the problem lies with the operating system. I want to display a web page in a window. I realized that this is possible with the ShowHTMLDialog function, however it only works in windows XP not windows 7. There is something else though: I can get a web page to display when I run the program directly in visual studio but not when I run it as a stand-alone application(in windows 7). So I think the problem is that some required dlls are being loaded when I run it in visual studio but not as standalone. It seems that the only dll i need for ShowHTMLDialog is mshtml.dll but I'm not sure if other dlls with different versions from windows XP are being used. What's going on when I run the program from visual studio that is different from running the program on it's own ? How do I get ShowHTMLDialog to work in windows 7 ? (I'm not using MFC) thanks,

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      What kind of error are you getting? Not really sure what you mean when you say it only works on Windows XP, not Windows 7. You might be able to try using the dependancy walker application to find out what DLLs are needed by your application, thouhg. :)

      Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

      D 1 Reply Last reply
      0
      • C Chris Meech

        What kind of error are you getting? Not really sure what you mean when you say it only works on Windows XP, not Windows 7. You might be able to try using the dependancy walker application to find out what DLLs are needed by your application, thouhg. :)

        Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

        D Offline
        D Offline
        doug25
        wrote on last edited by
        #3

        the error is that the program crashes on a call to ShowHTMLDialog(only on windows 7) and no dialog window appears. thanks, I will check out the dependancy walker

        C 1 Reply Last reply
        0
        • D doug25

          the error is that the program crashes on a call to ShowHTMLDialog(only on windows 7) and no dialog window appears. thanks, I will check out the dependancy walker

          C Offline
          C Offline
          Chris Meech
          wrote on last edited by
          #4

          Now that I checked here[^], I doubt that Dependancy Walker will help. You are going to have step through your code and find out which line of code is failing. My wild-ass guess would be that a call to GetProcAddress is probably not behaving as you expect it to.

          Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

          D 1 Reply Last reply
          0
          • C Chris Meech

            Now that I checked here[^], I doubt that Dependancy Walker will help. You are going to have step through your code and find out which line of code is failing. My wild-ass guess would be that a call to GetProcAddress is probably not behaving as you expect it to.

            Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

            D Offline
            D Offline
            doug25
            wrote on last edited by
            #5

            Ah, the problem is where I convert a char string to wide char string. I need to convert the url I want to display to a wide char string and if I leave that code out and just specify google as the url, the program works in windows 7. I'm not sure what I'm doing wrong with the conversion ?

            char url[MAX_PATH];

            _getcwd(url, MAX_PATH);
            std::string file = url;
            file += "\\Help.html\0";

            OLECHAR* oleChar = NULL;
            oleChar = (OLECHAR*)calloc(file.length(), sizeof(OLECHAR));
            MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, file.c_str(), -1, oleChar, sizeof(OLECHAR)*file.length());

            BSTR bstrURL = SysAllocString(oleChar);

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups