OpenNETCF Offline Application Block

R

rcangus

Hi,
I was hoping that someone here could help me.

I am using the Offline block from the OpenNETCF Application Blocks. The
problem I am having is with the cache storage implementations.
Specifically, I want to use the MMFCacheStorage implementation that it
comes with, but I am running into all sorts of issues with it.

For starters, the API calls that are made are incorrect. There is no
OpenFileMapping API in the CF. (There is in the full version of
windows). I *think* that I may have overcome thiws one, but am still
having trouble.

I was wondering if anyone out there has had simmilar issues? Has anyone
even tried to use it?

Cheers

Richard Angus
Senior Software Engineer
BSc. BIT. MCSD.
 
A

Alex Feinman (MVP)

Hi,
I was hoping that someone here could help me.

I am using the Offline block from the OpenNETCF Application Blocks. The
problem I am having is with the cache storage implementations.
Specifically, I want to use the MMFCacheStorage implementation that it
comes with, but I am running into all sorts of issues with it.

For starters, the API calls that are made are incorrect. There is no
OpenFileMapping API in the CF. (There is in the full version of
windows). I *think* that I may have overcome thiws one, but am still
having trouble.

I was wondering if anyone out there has had simmilar issues? Has anyone
even tried to use it?

Cheers

Richard Angus
Senior Software Engineer
BSc. BIT. MCSD.

Application blocks are using P/Invoke definitions provided elsewhere in
the OpenNETCF library. That includes OpenFileMapping
 
R

rcangus

Alex,
The version of the application blocks that I downlaoded (from the
source) has the OpenFileMapping declaration as coming from coredll.dll.
When I try to run it, I get an exception that says that the function
could not be found in the specified library. Looking at the exports of
coredll.dll, there is *no* OpenFileMapping. Also, I have not found a
reference to OpenFileMapping in the CE 4.2 or CE 5.0 SDK reference
documentation.

Am I missing something?

Cheers
 
P

Paul G. Tobey [eMVP]

That's definitely an implementation error and I'm not sure how it slipped in
there. The right way to do that on CE is CreateFileForMapping() with
suitable parameters, followed by CreateFileMapping(). There is, as you
found, no OpenFileMapping() API in CE...

Paul T.
 
C

Chance Hopkins

Paul G. Tobey said:
That's definitely an implementation error and I'm not sure how it slipped
in there. The right way to do that on CE is CreateFileForMapping() with
suitable parameters, followed by CreateFileMapping(). There is, as you
found, no OpenFileMapping() API in CE...

Have anyone been able to do this with a name reference?

I'm looking over these api's and can't see how it can be done:

http://msdn.microsoft.com/library/d...html/ceconFileMappingFunctions.asp?frame=true
 
P

Paul G. Tobey [eMVP]

A "name reference"? I've certainly created shared memory-mapped files that
are used from multiple processes. Call CreateFileForMapping() to create the
backing store, then call CreateFileMapping() and specify the last parameter
as the name that you want to share with other processes. When they call
CreateFileMapping() with the same name, they are pointing to the same memory
as in the first process. If you don't want to have the shared memory backed
by a real file, just call CreateFileMapping() with suitable parameters
(INVALID_HANDLE_VALUE as the first), and, again, use the same name in each
process.

Paul T.
 

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

Top