PC Review


Reply
Thread Tools Rate Thread

Caching Application Block

 
 
Matthew
Guest
Posts: n/a
 
      27th Jul 2004
Hi all,

I have the following:

Dim oCM As CacheManager = CacheManager.GetCacheManager
Dim sConfigKey As String =
"Kensington.Middleware.RulesEngine.EngineOverrides." &
presentationType
Dim strEngineOverrides As String
If oCM("EngineOverrides" & presentationType) Is Nothing Then
Dim oXML As New XmlDocument
Dim oConfigUtil As New ConfigUtility
Dim sConfigLocation As String =
oConfigUtil.GetResourceFromConfig(System.AppDomain.CurrentDomain.BaseDirectory,
sConfigKey, True)
oXML.Load(sConfigLocation)
strEngineOverrides = oXML.OuterXml
Dim iCacheExpiry() As ICacheItemExpiration = {New
FileDependency(sConfigLocation)}
oCM.Add(sConfigKey, strEngineOverrides) ', iCacheExpiry,
CacheItemPriority.Low, New CacheItemRemovedCallback(AddressOf
Me.OnCacheExpiry))
Else
strEngineOverrides = oCM("EngineOverrides" &
presentationType)
End If

Return strEngineOverrides


My project references the following projects in my solution:
Microsoft.ApplicationBlocks.Data
Microsoft.ApplicationBlocks.Cache
Microsoft.ApplicationBlocks.ExceptionManagement
Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces
Microsoft.ApplicationBlocks.MemoryMappedFile

On the add method, I get the following:

System.Exception: Encryption failed.Unable to find an entry point
named FormatMessage in DLL kernel32.dll

Which emanates from here in the WIN32DPAPI.vb in the cache assembly:

Dim isValue As Integer = FormatMessage(dwFlag,
ptrlpSource, _
errorCode, 0, lpMsgBuf, messageSize, prtArguments)

Any help would be much appreciated...

TIA

Matthew
 
Reply With Quote
 
 
 
 
Matthew
Guest
Posts: n/a
 
      28th Jul 2004
I have inspected kernel32.dll with dumpbin and it exports two flavours
of
formatmessage viz FormatMessageA, and FormatMessageW, but not
FormatMessage as defined in the error message. Have I perhaps got an
old version of kernel32.dll?

The method declaration looks like this:
Private Declare Function FormatMessage Lib "kernel32.dll" ( _
ByVal dwFlag As Integer, ByRef lpSource As IntPtr, _
ByVal dwMessageId As Integer, ByVal dwLanguageId As
Integer, _
ByRef lpBuffer As String, ByVal nSize As Integer, _
ByVal Arguments As IntPtr) As Integer

I guess I'll try renaming the method, but this is the Out-the-box
version of the application block....

Thanks
Matthew



(E-Mail Removed) (Matthew) wrote in message news:<(E-Mail Removed)>...
> Hi all,
>
> I have the following:
>
> Dim oCM As CacheManager = CacheManager.GetCacheManager
> Dim sConfigKey As String =
> "Kensington.Middleware.RulesEngine.EngineOverrides." &
> presentationType
> Dim strEngineOverrides As String
> If oCM("EngineOverrides" & presentationType) Is Nothing Then
> Dim oXML As New XmlDocument
> Dim oConfigUtil As New ConfigUtility
> Dim sConfigLocation As String =
> oConfigUtil.GetResourceFromConfig(System.AppDomain.CurrentDomain.BaseDirectory,
> sConfigKey, True)
> oXML.Load(sConfigLocation)
> strEngineOverrides = oXML.OuterXml
> Dim iCacheExpiry() As ICacheItemExpiration = {New
> FileDependency(sConfigLocation)}
> oCM.Add(sConfigKey, strEngineOverrides) ', iCacheExpiry,
> CacheItemPriority.Low, New CacheItemRemovedCallback(AddressOf
> Me.OnCacheExpiry))
> Else
> strEngineOverrides = oCM("EngineOverrides" &
> presentationType)
> End If
>
> Return strEngineOverrides
>
>
> My project references the following projects in my solution:
> Microsoft.ApplicationBlocks.Data
> Microsoft.ApplicationBlocks.Cache
> Microsoft.ApplicationBlocks.ExceptionManagement
> Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces
> Microsoft.ApplicationBlocks.MemoryMappedFile
>
> On the add method, I get the following:
>
> System.Exception: Encryption failed.Unable to find an entry point
> named FormatMessage in DLL kernel32.dll
>
> Which emanates from here in the WIN32DPAPI.vb in the cache assembly:
>
> Dim isValue As Integer = FormatMessage(dwFlag,
> ptrlpSource, _
> errorCode, 0, lpMsgBuf, messageSize, prtArguments)
>
> Any help would be much appreciated...
>
> TIA
>
> Matthew

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in console application using Caching Application Block ams8764 Microsoft Dot NET Framework 1 6th Jan 2006 11:00 AM
question about caching using the caching application block EL 2 =?Utf-8?B?YWhtX2VidXNpbmVzc190cg==?= Microsoft Dot NET Framework 0 19th Sep 2005 06:51 PM
Caching Application Block =?Utf-8?B?cmFpbnBvcA==?= Microsoft Dot NET Framework 0 30th Sep 2004 06:45 AM
caching application block - help! Hugo Batista Microsoft Dot NET Framework 2 29th Sep 2004 11:19 AM
how to use Caching Application Block for .NET Niranjan Marathe Microsoft C# .NET 0 15th Nov 2003 04:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:58 PM.