Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Hashing function CryptAcquireContext Lib "advapi32" not working in new computer.

I have a user function that creates a hash value from the contents of a
range. It uses the CryptAcqureContext and CryptCreateHash functions in the
advapi32 library. These have worked splendidly on a WinXP SP2, Office 2003
system. They have worked on several other systems without trouble.

I have a new computer using Windows Media Center. I loaded Office 2003,
then Office 2007 keeping the Office 2003 applications.

The CryptAcquireContext function returns a zero in the hProv argument
instead of some non-zero long integer. This tells me that the reference to
Lib advapi32 is mixed up, or there is some incompatibility between this
function and Windows Media Center (which I have trouble believing).

I have un-installed Office 2007,
Rebooted.
Repaired Office 2003 Prof.
Rebooted.
CryptAcquireContext hProv, ..... hProv = 0. wrong.
Un-installed Office 2003.
Reboot.
Install Office 2003 Prof. Complete.
Reboot.
CryptAcquireContext hProv,.... hProv = 0. Still not working.

checked advapi32.dll.
Version is the same as on the Winbook, WinXP SP2, Off 2003 where it works
well.
it is located in the same place: C:\Windows\System32\advapi32.dll.

Additionally, my Outlook will not remember my email passwords.

My feeling is the registry is a mess at this point. Anyone recommend a
good registry clean-up tool?

I'm about to implement KB290301 "Windows installer cleanup utility" to try
and go after some registration issues.

"Stephen Rasey" wrote in message
...

'a Hash Function from Stephen Bullen.
'From: Stephen Bullen )
'Subject: Hash (MD5) in Excel
'Newsgroups: microsoft.public.Excel.programming Date: 2004-02-05
12:50:20 PST
'Modified (bug fix) by Stephen Rasey June 2004

Option Explicit

Declare Function CryptAcquireContext Lib "advapi32" Alias
"CryptAcquireContextA" (ByRef hProv As Long, ByVal sContainer As String, _
ByVal sProvider As String, ByVal lProvType As Long, ByVal lFlags As
Long) As Long

Declare Function CryptCreateHash Lib "advapi32" (ByVal hProv As Long,
ByVal
lALG_ID As Long, _
ByVal hKey As Long, ByVal
lFlags As Long, ByRef hhash As Long) As Long

Declare Function CryptHashData Lib "advapi32" (ByVal hhash As Long, ByVal
lDataPtr As Long, ByVal lLen As Long, ByVal lFlags As Long) As Long

Declare Function CryptGetHashParam Lib "advapi32" (ByVal hhash As Long,
ByVal lParam As Long, ByVal sBuffer As String, _
ByRef lLen As Long,
ByVal
lFlags As Long) As Long

Declare Function CryptDestroyHash Lib "advapi32" (ByVal hhash As Long) As
Long

Declare Function CryptReleaseContext Lib "advapi32" (ByVal hProv As Long,
ByVal lFlags As Long) As Long

Const MS_DEF_PROV = "Microsoft Base Cryptographic Provider v1.0"
Const PROV_RSA_FULL As Long = 1
Const CRYPT_NEWKEYSET As Long = 8
Const CALG_MD5 As Long = 32771
Const HP_HASHVAL As Long = 2



' wwGetMD5Hash - GetMD5Hash (written by Stephen Bullen) modified by
Stephen Rasey 040612
' Changes: Use StrPtr and coerse all cell values to strings
' Empty cells are not ignored, but the cell number in the
range
' is used to generate more data for the hash

Public Function wwGetMD5Hash(rngData As Range) As String

Dim hProv As Long
Dim hhash As Long
Dim lLen As Long
Dim ocell As Range
Dim baData() As Byte
Dim sBuffer As String
Dim vValue As String
Dim vU2 As Variant
Dim lresult As Long
Dim lcellCounter As Long
On Error GoTo E1
'Get/create a cryptography context
CryptAcquireContext hProv, vbNullString, MS_DEF_PROV, PROV_RSA_FULL, 0
If hProv = 0 Then
CryptAcquireContext hProv, vbNullString, MS_DEF_PROV,
PROV_RSA_FULL,
CRYPT_NEWKEYSET
End If

'If we got one...
If hProv < 0 Then

'Create an MD5 Hash
CryptCreateHash hProv, CALG_MD5, 0, 0, hhash

'If that was OK...
If hhash < 0 Then

'Fill it with the contents of the range
(and it continues...)
the full function can be found he
http://www.excelsig.org/VBA/wwHash.htm

-Stephen Rasey




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,365
Default Hashing function CryptAcquireContext Lib "advapi32" not working in


You might look at CCleaner, www.ccleaner.com. FreeWare and highly praised
by those that have used it.

Another strong contender in the freeware category is RegSeeker from
Hoverdesk at: http://www.hoverdesk.net/freeware.htm

In the not so freeware category, there's Registry Mechanic, jv16PowerTools,
and TuneUp Utilities.

And we shouldn't forget Regedit and Regedt32 <g

By the way, I don't think the Windows Installer Cleanup utility totally
wipes out the related registry entries. I had to use it once, and upon
reinstalling the product (it may have even been Office, don't recall right
now), it still showed up as and activated. Not a bad thing, just kind of
clued me in that not everything in the registry got trashed by it.

"Stephen Rasey" wrote:

I have a user function that creates a hash value from the contents of a
range. It uses the CryptAcqureContext and CryptCreateHash functions in the
advapi32 library. These have worked splendidly on a WinXP SP2, Office 2003
system. They have worked on several other systems without trouble.

I have a new computer using Windows Media Center. I loaded Office 2003,
then Office 2007 keeping the Office 2003 applications.

The CryptAcquireContext function returns a zero in the hProv argument
instead of some non-zero long integer. This tells me that the reference to
Lib advapi32 is mixed up, or there is some incompatibility between this
function and Windows Media Center (which I have trouble believing).

I have un-installed Office 2007,
Rebooted.
Repaired Office 2003 Prof.
Rebooted.
CryptAcquireContext hProv, ..... hProv = 0. wrong.
Un-installed Office 2003.
Reboot.
Install Office 2003 Prof. Complete.
Reboot.
CryptAcquireContext hProv,.... hProv = 0. Still not working.

checked advapi32.dll.
Version is the same as on the Winbook, WinXP SP2, Off 2003 where it works
well.
it is located in the same place: C:\Windows\System32\advapi32.dll.

Additionally, my Outlook will not remember my email passwords.

My feeling is the registry is a mess at this point. Anyone recommend a
good registry clean-up tool?

I'm about to implement KB290301 "Windows installer cleanup utility" to try
and go after some registration issues.

"Stephen Rasey" wrote in message
...

'a Hash Function from Stephen Bullen.
'From: Stephen Bullen )
'Subject: Hash (MD5) in Excel
'Newsgroups: microsoft.public.Excel.programming Date: 2004-02-05
12:50:20 PST
'Modified (bug fix) by Stephen Rasey June 2004

Option Explicit

Declare Function CryptAcquireContext Lib "advapi32" Alias
"CryptAcquireContextA" (ByRef hProv As Long, ByVal sContainer As String, _
ByVal sProvider As String, ByVal lProvType As Long, ByVal lFlags As
Long) As Long

Declare Function CryptCreateHash Lib "advapi32" (ByVal hProv As Long,
ByVal
lALG_ID As Long, _
ByVal hKey As Long, ByVal
lFlags As Long, ByRef hhash As Long) As Long

Declare Function CryptHashData Lib "advapi32" (ByVal hhash As Long, ByVal
lDataPtr As Long, ByVal lLen As Long, ByVal lFlags As Long) As Long

Declare Function CryptGetHashParam Lib "advapi32" (ByVal hhash As Long,
ByVal lParam As Long, ByVal sBuffer As String, _
ByRef lLen As Long,
ByVal
lFlags As Long) As Long

Declare Function CryptDestroyHash Lib "advapi32" (ByVal hhash As Long) As
Long

Declare Function CryptReleaseContext Lib "advapi32" (ByVal hProv As Long,
ByVal lFlags As Long) As Long

Const MS_DEF_PROV = "Microsoft Base Cryptographic Provider v1.0"
Const PROV_RSA_FULL As Long = 1
Const CRYPT_NEWKEYSET As Long = 8
Const CALG_MD5 As Long = 32771
Const HP_HASHVAL As Long = 2



' wwGetMD5Hash - GetMD5Hash (written by Stephen Bullen) modified by
Stephen Rasey 040612
' Changes: Use StrPtr and coerse all cell values to strings
' Empty cells are not ignored, but the cell number in the
range
' is used to generate more data for the hash

Public Function wwGetMD5Hash(rngData As Range) As String

Dim hProv As Long
Dim hhash As Long
Dim lLen As Long
Dim ocell As Range
Dim baData() As Byte
Dim sBuffer As String
Dim vValue As String
Dim vU2 As Variant
Dim lresult As Long
Dim lcellCounter As Long
On Error GoTo E1
'Get/create a cryptography context
CryptAcquireContext hProv, vbNullString, MS_DEF_PROV, PROV_RSA_FULL, 0
If hProv = 0 Then
CryptAcquireContext hProv, vbNullString, MS_DEF_PROV,
PROV_RSA_FULL,
CRYPT_NEWKEYSET
End If

'If we got one...
If hProv < 0 Then

'Create an MD5 Hash
CryptCreateHash hProv, CALG_MD5, 0, 0, hhash

'If that was OK...
If hhash < 0 Then

'Fill it with the contents of the range
(and it continues...)
the full function can be found he
http://www.excelsig.org/VBA/wwHash.htm

-Stephen Rasey





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Hashing function CryptAcquireContext Lib "advapi32" not working in

I have no faith in the Windows Installer Cleanup utility. After
uninstalling office 2003 (after uninstalling Office 2007 earlier in the
day), I ran Installer Cleanup. It showed at least two dozen installations,
but none of them were related to office.

Regedit was littered with .12 references to Office components. A lot of
the .11 references were still there, but several instances of .12 without
..11. Realizing that I'm facing a wipe of the C: drive and reinstallation
of Windows, I deleted everything I could find in the registry related to
Office. I'm now reinstalling Office 2003 and waiting on the MS Update
(awful slow tonight).

I tried RegCure, but I cannot say I'm satisfied. I had to do 8 passes
before I got it down to three Empty Registry Keys. And it didn't fix my
problem. ErrorKiller, a product I downloaded in trial found 108 shared
program problems (where RegCure didn't fault them), but they are all
associated with a program I have not yet run and unrelated to Office.

I'll try your suggestions, at least for a test.

Stephen Rasey


"JLatham" <HelpFrom @ Jlathamsite.com.(removethis) wrote in message
...

You might look at CCleaner, www.ccleaner.com. FreeWare and highly praised
by those that have used it.

Another strong contender in the freeware category is RegSeeker from
Hoverdesk at: http://www.hoverdesk.net/freeware.htm

In the not so freeware category, there's Registry Mechanic,
jv16PowerTools,
and TuneUp Utilities.

And we shouldn't forget Regedit and Regedt32 <g

By the way, I don't think the Windows Installer Cleanup utility totally
wipes out the related registry entries. I had to use it once, and upon
reinstalling the product (it may have even been Office, don't recall right
now), it still showed up as and activated. Not a bad thing, just kind of
clued me in that not everything in the registry got trashed by it.

"Stephen Rasey" wrote:

I have a user function that creates a hash value from the contents of a
range. It uses the CryptAcqureContext and CryptCreateHash functions in
the
advapi32 library. These have worked splendidly on a WinXP SP2, Office
2003
system. They have worked on several other systems without trouble.

I have a new computer using Windows Media Center. I loaded Office 2003,
then Office 2007 keeping the Office 2003 applications.

The CryptAcquireContext function returns a zero in the hProv argument
instead of some non-zero long integer. This tells me that the reference
to
Lib advapi32 is mixed up, or there is some incompatibility between this
function and Windows Media Center (which I have trouble believing).

I have un-installed Office 2007,
Rebooted.
Repaired Office 2003 Prof.
Rebooted.
CryptAcquireContext hProv, ..... hProv = 0. wrong.
Un-installed Office 2003.
Reboot.
Install Office 2003 Prof. Complete.
Reboot.
CryptAcquireContext hProv,.... hProv = 0. Still not working.

checked advapi32.dll.
Version is the same as on the Winbook, WinXP SP2, Off 2003 where it works
well.
it is located in the same place: C:\Windows\System32\advapi32.dll.

Additionally, my Outlook will not remember my email passwords.

My feeling is the registry is a mess at this point. Anyone recommend a
good registry clean-up tool?

I'm about to implement KB290301 "Windows installer cleanup utility" to
try
and go after some registration issues.

"Stephen Rasey" wrote in message
...

'a Hash Function from Stephen Bullen.
'From: Stephen Bullen )
'Subject: Hash (MD5) in Excel
'Newsgroups: microsoft.public.Excel.programming Date: 2004-02-05
12:50:20 PST
'Modified (bug fix) by Stephen Rasey June 2004

Option Explicit

Declare Function CryptAcquireContext Lib "advapi32" Alias
"CryptAcquireContextA" (ByRef hProv As Long, ByVal sContainer As
String, _
ByVal sProvider As String, ByVal lProvType As Long, ByVal lFlags
As
Long) As Long

Declare Function CryptCreateHash Lib "advapi32" (ByVal hProv As Long,
ByVal
lALG_ID As Long, _
ByVal hKey As Long,
ByVal
lFlags As Long, ByRef hhash As Long) As Long

Declare Function CryptHashData Lib "advapi32" (ByVal hhash As Long,
ByVal
lDataPtr As Long, ByVal lLen As Long, ByVal lFlags As Long) As Long

Declare Function CryptGetHashParam Lib "advapi32" (ByVal hhash As Long,
ByVal lParam As Long, ByVal sBuffer As String, _
ByRef lLen As Long,
ByVal
lFlags As Long) As Long

Declare Function CryptDestroyHash Lib "advapi32" (ByVal hhash As Long)
As
Long

Declare Function CryptReleaseContext Lib "advapi32" (ByVal hProv As
Long,
ByVal lFlags As Long) As Long

Const MS_DEF_PROV = "Microsoft Base Cryptographic Provider v1.0"
Const PROV_RSA_FULL As Long = 1
Const CRYPT_NEWKEYSET As Long = 8
Const CALG_MD5 As Long = 32771
Const HP_HASHVAL As Long = 2



' wwGetMD5Hash - GetMD5Hash (written by Stephen Bullen) modified by
Stephen Rasey 040612
' Changes: Use StrPtr and coerse all cell values to strings
' Empty cells are not ignored, but the cell number in
the
range
' is used to generate more data for the hash

Public Function wwGetMD5Hash(rngData As Range) As String

Dim hProv As Long
Dim hhash As Long
Dim lLen As Long
Dim ocell As Range
Dim baData() As Byte
Dim sBuffer As String
Dim vValue As String
Dim vU2 As Variant
Dim lresult As Long
Dim lcellCounter As Long
On Error GoTo E1
'Get/create a cryptography context
CryptAcquireContext hProv, vbNullString, MS_DEF_PROV, PROV_RSA_FULL,
0
If hProv = 0 Then
CryptAcquireContext hProv, vbNullString, MS_DEF_PROV,
PROV_RSA_FULL,
CRYPT_NEWKEYSET
End If

'If we got one...
If hProv < 0 Then

'Create an MD5 Hash
CryptCreateHash hProv, CALG_MD5, 0, 0, hhash

'If that was OK...
If hhash < 0 Then

'Fill it with the contents of the range
(and it continues...)
the full function can be found he
http://www.excelsig.org/VBA/wwHash.htm

-Stephen Rasey







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Hashing function CryptAcquireContext Lib "advapi32" not working in

Reinstalled Office 2003. Waiting of Update, but the problem with
CryptAcqureContext from the advapi32 library remains. I'm still getting a
zero in hProv instead of a non-zero long integer.

Looks like a Windows Wipe on Christmas Eve.

Stephen Rasey


"Stephen Rasey" wrote in message
...
I have no faith in the Windows Installer Cleanup utility. After
uninstalling office 2003 (after uninstalling Office 2007 earlier in the
day), I ran Installer Cleanup. It showed at least two dozen
installations, but none of them were related to office.

Regedit was littered with .12 references to Office components. A lot of
the .11 references were still there, but several instances of .12 without
.11. Realizing that I'm facing a wipe of the C: drive and reinstallation
of Windows, I deleted everything I could find in the registry related to
Office. I'm now reinstalling Office 2003 and waiting on the MS Update
(awful slow tonight).

I tried RegCure, but I cannot say I'm satisfied. I had to do 8 passes
before I got it down to three Empty Registry Keys. And it didn't fix my
problem. ErrorKiller, a product I downloaded in trial found 108 shared
program problems (where RegCure didn't fault them), but they are all
associated with a program I have not yet run and unrelated to Office.

I'll try your suggestions, at least for a test.

Stephen Rasey


"JLatham" <HelpFrom @ Jlathamsite.com.(removethis) wrote in message
...

You might look at CCleaner, www.ccleaner.com. FreeWare and highly
praised
by those that have used it.

Another strong contender in the freeware category is RegSeeker from
Hoverdesk at: http://www.hoverdesk.net/freeware.htm

In the not so freeware category, there's Registry Mechanic,
jv16PowerTools,
and TuneUp Utilities.

And we shouldn't forget Regedit and Regedt32 <g

By the way, I don't think the Windows Installer Cleanup utility totally
wipes out the related registry entries. I had to use it once, and upon
reinstalling the product (it may have even been Office, don't recall
right
now), it still showed up as and activated. Not a bad thing, just kind of
clued me in that not everything in the registry got trashed by it.

"Stephen Rasey" wrote:

I have a user function that creates a hash value from the contents of a
range. It uses the CryptAcqureContext and CryptCreateHash functions in
the
advapi32 library. These have worked splendidly on a WinXP SP2, Office
2003
system. They have worked on several other systems without trouble.

I have a new computer using Windows Media Center. I loaded Office 2003,
then Office 2007 keeping the Office 2003 applications.

The CryptAcquireContext function returns a zero in the hProv argument
instead of some non-zero long integer. This tells me that the
reference to
Lib advapi32 is mixed up, or there is some incompatibility between this
function and Windows Media Center (which I have trouble believing).

I have un-installed Office 2007,
Rebooted.
Repaired Office 2003 Prof.
Rebooted.
CryptAcquireContext hProv, ..... hProv = 0. wrong.
Un-installed Office 2003.
Reboot.
Install Office 2003 Prof. Complete.
Reboot.
CryptAcquireContext hProv,.... hProv = 0. Still not working.

checked advapi32.dll.
Version is the same as on the Winbook, WinXP SP2, Off 2003 where it
works
well.
it is located in the same place: C:\Windows\System32\advapi32.dll.

Additionally, my Outlook will not remember my email passwords.

My feeling is the registry is a mess at this point. Anyone recommend a
good registry clean-up tool?

I'm about to implement KB290301 "Windows installer cleanup utility" to
try
and go after some registration issues.

"Stephen Rasey" wrote in message
...

'a Hash Function from Stephen Bullen.
'From: Stephen Bullen )
'Subject: Hash (MD5) in Excel
'Newsgroups: microsoft.public.Excel.programming Date: 2004-02-05
12:50:20 PST
'Modified (bug fix) by Stephen Rasey June 2004

Option Explicit

Declare Function CryptAcquireContext Lib "advapi32" Alias
"CryptAcquireContextA" (ByRef hProv As Long, ByVal sContainer As
String, _
ByVal sProvider As String, ByVal lProvType As Long, ByVal
lFlags As
Long) As Long

Declare Function CryptCreateHash Lib "advapi32" (ByVal hProv As Long,
ByVal
lALG_ID As Long, _
ByVal hKey As Long,
ByVal
lFlags As Long, ByRef hhash As Long) As Long

Declare Function CryptHashData Lib "advapi32" (ByVal hhash As Long,
ByVal
lDataPtr As Long, ByVal lLen As Long, ByVal lFlags As Long) As Long

Declare Function CryptGetHashParam Lib "advapi32" (ByVal hhash As
Long,
ByVal lParam As Long, ByVal sBuffer As String, _
ByRef lLen As Long,
ByVal
lFlags As Long) As Long

Declare Function CryptDestroyHash Lib "advapi32" (ByVal hhash As Long)
As
Long

Declare Function CryptReleaseContext Lib "advapi32" (ByVal hProv As
Long,
ByVal lFlags As Long) As Long

Const MS_DEF_PROV = "Microsoft Base Cryptographic Provider v1.0"
Const PROV_RSA_FULL As Long = 1
Const CRYPT_NEWKEYSET As Long = 8
Const CALG_MD5 As Long = 32771
Const HP_HASHVAL As Long = 2



' wwGetMD5Hash - GetMD5Hash (written by Stephen Bullen) modified by
Stephen Rasey 040612
' Changes: Use StrPtr and coerse all cell values to strings
' Empty cells are not ignored, but the cell number in
the
range
' is used to generate more data for the hash

Public Function wwGetMD5Hash(rngData As Range) As String

Dim hProv As Long
Dim hhash As Long
Dim lLen As Long
Dim ocell As Range
Dim baData() As Byte
Dim sBuffer As String
Dim vValue As String
Dim vU2 As Variant
Dim lresult As Long
Dim lcellCounter As Long
On Error GoTo E1
'Get/create a cryptography context
CryptAcquireContext hProv, vbNullString, MS_DEF_PROV,
PROV_RSA_FULL, 0
If hProv = 0 Then
CryptAcquireContext hProv, vbNullString, MS_DEF_PROV,
PROV_RSA_FULL,
CRYPT_NEWKEYSET
End If

'If we got one...
If hProv < 0 Then

'Create an MD5 Hash
CryptCreateHash hProv, CALG_MD5, 0, 0, hhash

'If that was OK...
If hhash < 0 Then

'Fill it with the contents of the range
(and it continues...)
the full function can be found he
http://www.excelsig.org/VBA/wwHash.htm

-Stephen Rasey









  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Hashing function CryptAcquireContext Lib "advapi32" not working in new computer.

The application runs fine on another computer running Media Center. So
there is no innate conflict between the CryptAcquireContext in lib
advapi32.dll and Media Center.

This Computer's windows installation appears hopelessly corrupted. I don't
know what happened. The only thing that I can blame is the installing of
Office 2003, then Office 2007 for a dual version Office Development Platform
caused all this grief. I don't know Office 2007 is the cause, but I don't
think I'll try it again anytime soon.

Stephen Rasey
Houston





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Hashing function CryptAcquireContext Lib "advapi32" not working in

Performed a install of Vista32 onto the HP dv6000 laptop (that used to have
Media Center) and followed it with a clean install of Office 2003. The
application performed perfectly.

Loaded the application onto a Vista32 tablet running Office 2007. The
application performed perfectly. So it isn't Office 2007 that's at fault.

It had to be something in the original HP load, perhaps with a trial version
of Office that we ignored and installed another one on top of it followed by
Office 2007. Maybe it was the dual install. In any case, I have a
working laptop again and can get back to productive work. Santa Claus came
early.

Stephen Rasey

"Stephen Rasey" wrote in message
...
Reinstalled Office 2003. Waiting of Update, but the problem with
CryptAcqureContext from the advapi32 library remains. I'm still getting
a zero in hProv instead of a non-zero long integer.

Looks like a Windows Wipe on Christmas Eve.

Stephen Rasey


"Stephen Rasey" wrote in message
...
I have no faith in the Windows Installer Cleanup utility. After
uninstalling office 2003 (after uninstalling Office 2007 earlier in the
day), I ran Installer Cleanup. It showed at least two dozen
installations, but none of them were related to office.

Regedit was littered with .12 references to Office components. A lot
of the .11 references were still there, but several instances of .12
without .11. Realizing that I'm facing a wipe of the C: drive and
reinstallation of Windows, I deleted everything I could find in the
registry related to Office. I'm now reinstalling Office 2003 and
waiting on the MS Update (awful slow tonight).

I tried RegCure, but I cannot say I'm satisfied. I had to do 8 passes
before I got it down to three Empty Registry Keys. And it didn't fix my
problem. ErrorKiller, a product I downloaded in trial found 108 shared
program problems (where RegCure didn't fault them), but they are all
associated with a program I have not yet run and unrelated to Office.

I'll try your suggestions, at least for a test.

Stephen Rasey


"JLatham" <HelpFrom @ Jlathamsite.com.(removethis) wrote in message
...

You might look at CCleaner, www.ccleaner.com. FreeWare and highly
praised
by those that have used it.

Another strong contender in the freeware category is RegSeeker from
Hoverdesk at: http://www.hoverdesk.net/freeware.htm

In the not so freeware category, there's Registry Mechanic,
jv16PowerTools,
and TuneUp Utilities.

And we shouldn't forget Regedit and Regedt32 <g

By the way, I don't think the Windows Installer Cleanup utility totally
wipes out the related registry entries. I had to use it once, and upon
reinstalling the product (it may have even been Office, don't recall
right
now), it still showed up as and activated. Not a bad thing, just kind
of
clued me in that not everything in the registry got trashed by it.

"Stephen Rasey" wrote:

I have a user function that creates a hash value from the contents of a
range. It uses the CryptAcqureContext and CryptCreateHash functions in
the
advapi32 library. These have worked splendidly on a WinXP SP2, Office
2003
system. They have worked on several other systems without trouble.

I have a new computer using Windows Media Center. I loaded Office
2003,
then Office 2007 keeping the Office 2003 applications.

The CryptAcquireContext function returns a zero in the hProv argument
instead of some non-zero long integer. This tells me that the
reference to
Lib advapi32 is mixed up, or there is some incompatibility between
this
function and Windows Media Center (which I have trouble believing).

I have un-installed Office 2007,
Rebooted.
Repaired Office 2003 Prof.
Rebooted.
CryptAcquireContext hProv, ..... hProv = 0. wrong.
Un-installed Office 2003.
Reboot.
Install Office 2003 Prof. Complete.
Reboot.
CryptAcquireContext hProv,.... hProv = 0. Still not working.

checked advapi32.dll.
Version is the same as on the Winbook, WinXP SP2, Off 2003 where it
works
well.
it is located in the same place: C:\Windows\System32\advapi32.dll.

Additionally, my Outlook will not remember my email passwords.

My feeling is the registry is a mess at this point. Anyone recommend
a
good registry clean-up tool?

I'm about to implement KB290301 "Windows installer cleanup utility" to
try
and go after some registration issues.

"Stephen Rasey" wrote in message
...

'a Hash Function from Stephen Bullen.
'From: Stephen Bullen )
'Subject: Hash (MD5) in Excel
'Newsgroups: microsoft.public.Excel.programming Date: 2004-02-05
12:50:20 PST
'Modified (bug fix) by Stephen Rasey June 2004

Option Explicit

Declare Function CryptAcquireContext Lib "advapi32" Alias
"CryptAcquireContextA" (ByRef hProv As Long, ByVal sContainer As
String, _
ByVal sProvider As String, ByVal lProvType As Long, ByVal
lFlags As
Long) As Long

Declare Function CryptCreateHash Lib "advapi32" (ByVal hProv As Long,
ByVal
lALG_ID As Long, _
ByVal hKey As Long,
ByVal
lFlags As Long, ByRef hhash As Long) As Long

Declare Function CryptHashData Lib "advapi32" (ByVal hhash As Long,
ByVal
lDataPtr As Long, ByVal lLen As Long, ByVal lFlags As Long) As Long

Declare Function CryptGetHashParam Lib "advapi32" (ByVal hhash As
Long,
ByVal lParam As Long, ByVal sBuffer As String, _
ByRef lLen As Long,
ByVal
lFlags As Long) As Long

Declare Function CryptDestroyHash Lib "advapi32" (ByVal hhash As
Long) As
Long

Declare Function CryptReleaseContext Lib "advapi32" (ByVal hProv As
Long,
ByVal lFlags As Long) As Long

Const MS_DEF_PROV = "Microsoft Base Cryptographic Provider v1.0"
Const PROV_RSA_FULL As Long = 1
Const CRYPT_NEWKEYSET As Long = 8
Const CALG_MD5 As Long = 32771
Const HP_HASHVAL As Long = 2



' wwGetMD5Hash - GetMD5Hash (written by Stephen Bullen) modified by
Stephen Rasey 040612
' Changes: Use StrPtr and coerse all cell values to strings
' Empty cells are not ignored, but the cell number in
the
range
' is used to generate more data for the hash

Public Function wwGetMD5Hash(rngData As Range) As String

Dim hProv As Long
Dim hhash As Long
Dim lLen As Long
Dim ocell As Range
Dim baData() As Byte
Dim sBuffer As String
Dim vValue As String
Dim vU2 As Variant
Dim lresult As Long
Dim lcellCounter As Long
On Error GoTo E1
'Get/create a cryptography context
CryptAcquireContext hProv, vbNullString, MS_DEF_PROV,
PROV_RSA_FULL, 0
If hProv = 0 Then
CryptAcquireContext hProv, vbNullString, MS_DEF_PROV,
PROV_RSA_FULL,
CRYPT_NEWKEYSET
End If

'If we got one...
If hProv < 0 Then

'Create an MD5 Hash
CryptCreateHash hProv, CALG_MD5, 0, 0, hhash

'If that was OK...
If hhash < 0 Then

'Fill it with the contents of the range
(and it continues...)
the full function can be found he
http://www.excelsig.org/VBA/wwHash.htm

-Stephen Rasey










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Working out age from "Day" "Month" "Year" timmyc Excel Worksheet Functions 4 February 5th 06 03:07 PM
Please add a "sheet" function like "row" and "column" functions Spreadsheet Monkey Excel Programming 2 November 8th 05 04:08 PM
a button to open up "My Computer" on an excel sheet DorisM Excel Programming 5 August 16th 05 08:32 PM


All times are GMT +1. The time now is 10:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"