By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,389 Members | 1,844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,389 IT Pros & Developers. It's quick & easy.

How to use the following Microsoft function

P: n/a
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/de.../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

M.*********@HRO.NL
***** 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;
}
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Maurice Hoeneveld" <m.*********@hro.nl> wrote in message
news:80*************************@posting.google.co m...
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/de...owser/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>


Jul 19 '05 #2

P: n/a
On 6 Aug 2003 03:14:32 -0700, m.*********@hro.nl (Maurice Hoeneveld) wrote:
I want to put the function inside my program but I have no idea how to
use it.


Copy the source code.

Call the function.

What's the problem?

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.