473,320 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to use the following Microsoft function

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
2 2304

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Greener | last post by:
Hi, I need help badly. Can you do client-side programming instead of server-side to capture the Browser type info? If this is the case, what's wrong with the following? <script...
2
by: Al | last post by:
I have a useful framework, written in a different language (PowerBuilder), which I'd like to replicate in .Net and Forms, but I'm unsure of how to approach it, as the Event model is being used...
2
by: Jack | last post by:
Hi, I have the following javascript that is written in html. It works great. However, I need to transfer the concept to an asp application where the form itself is an asp page. I was wondering if...
4
by: MLH | last post by:
The following function declaration confuses me... Public Function IsEMailAddress(ByVal sEmail As String, Optional ByRef sReason As String) As Boolean I tried pasting it and its code into an...
6
by: David | last post by:
I am using ADO to run some SQL statements in Access. First, I run query to create a table using SELECT . . . INTO Table A. Then, I run a query to SELECT . . . FROM Table A to get some data and...
6
by: Glenn Wilson | last post by:
I have converted most of the code that I have but am having trouble, mainly with the marked lines. (>>) public static UInt16 checksum( UInt16 buffer, int size ) { Int32 cksum = 0; int counter;...
7
by: Martin Pritchard | last post by:
Hi, Sorry for my ignorance, but I'm a bit new to C++. I've been handed over a C++ app written in VS2002 which I have to convert to VS2005. Apparently it's been written in a C style, but cannot...
0
by: Vincent RICHOMME | last post by:
Hi, I would like to know how can I parse the following htm file : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML xmlns:MSHelp="http://msdn.microsoft.com/mshelp" DIR="LTR"><HEAD>...
6
by: =?Utf-8?B?eWRibg==?= | last post by:
What's the best easy way to have a function/method: 1. Has a string paramter, the value of string is C#/VB.Net express. 2. The function evaluate the express and return the value.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.