How to use the following Microsoft function

  • Thread starter Maurice Hoeneveld
  • Start date
M

Maurice Hoeneveld

Hello

Let me first tell you that I am not a die-hard C programmer

I building a small C++ application that has to check the version of MS
Internet Explorer.

On MSDN at;
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/license/licensing.asp

I found the function as listed below.
I can compile the function as a DLL but I want to d the following;

My small program checks some system variables before a presentation
starts up and also has to check the version of shdocvw.dll
I want to put the function inside my program but I have no idea how to
use it.

Is there anyone who can give me a hint?
Any help is appreciated. Thanks for your time and help in advance.

Maurice Hoeneveld
Network Security Management
Facilitaire Dienst ICT Afdeling
Hogeschool Rotterdam

+31 (0)10 2414197
+31 (0)6 48133104

(e-mail address removed)


***** LISTING from MSDN

The following function retrieves the major and minor version numbers
of the
Shdocvw.dll that is installed on the local system.

#include <windows.h>
#include <shlwapi.h>

HRESULT GetBrowserVersion(LPDWORD pdwMajor, LPDWORD pdwMinor)
{
HINSTANCE hBrowser;

if( IsBadWritePtr(pdwMajor, sizeof(DWORD)) ||
IsBadWritePtr(pdwMinor, sizeof(DWORD)))
return E_INVALIDARG;

*pdwMajor = 0;
*pdwMinor = 0;

//Load the DLL.
hBrowser = LoadLibrary(TEXT("shdocvw.dll"));

if(hBrowser)
{
HRESULT hr = S_OK;
DLLGETVERSIONPROC pDllGetVersion;

/*
You must get this function explicitly.
*/
pDllGetVersion = (DLLGETVERSIONPROC)GetProcAddress(hBrowser,
TEXT("DllGetVersion"));

if(pDllGetVersion)
{
DLLVERSIONINFO dvi;

ZeroMemory(&dvi, sizeof(dvi));
dvi.cbSize = sizeof(dvi);

hr = (*pDllGetVersion)(&dvi);

if(SUCCEEDED(hr))
{
*pdwMajor = dvi.dwMajorVersion;

*pdwMinor = dvi.dwMinorVersion;
}
}
else
{
/*
If GetProcAddress failed, there is a problem with the DLL.
*/
hr = E_FAIL;
}

FreeLibrary(hBrowser);

return hr;
}

return E_FAIL;
}
 
J

Josephine Schafer

Maurice Hoeneveld said:
Hello

Let me first tell you that I am not a die-hard C programmer

I building a small C++ application that has to check the version of MS
Internet Explorer.

On MSDN at;
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/license/
licensing.asp

I found the function as listed below.
I can compile the function as a DLL but I want to d the following;

My small program checks some system variables before a presentation
starts up and also has to check the version of shdocvw.dll
I want to put the function inside my program but I have no idea how to
use it.

Wrong newsgroup!
Try microsoft.public.vc.language on news.microsoft.com server.
Is there anyone who can give me a hint?
Yes..a lilltle hint :).

<OT>
IE version and Update version can be known from the registry keys for sure.
Search a little you will find it.
As far as finding the version of a file are concerned look at
GetFileVersionInfo() in msdn.
</OT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top