Solved

CreateFileMapping parameter

Posted on 1999-01-05
1
353 Views
Last Modified: 2012-06-21
I follow the sample code from MSDN as shown below.

h = CreateFileMapping(-1,pNull,PAGE_READWRITE,0, 65535,"MyShare")

The problem I am having is that I can't find where the constant pNull and PAGE_READWRITE are defined. I tried to replace pNull with vbNull, Null, 0, and 0& and I get type mismatch error. How can I create a handle by using CreateFileMapping.  Please help
0
Comment
Question by:yray
1 Comment
 
LVL 4

Accepted Solution

by:
chabaud earned 50 total points
ID: 1454069
Change the declare statement as follow:

Private Declare Function CreateFileMapping Lib "kernel32" Alias "CreateFileMappingA" (ByVal hFile As Long, ByVal lpFileMappigAttributes As long, ByVal flProtect As Long, ByVal dwMaximumSizeHigh As Long, ByVal dwMaximumSizeLow As Long, ByVal lpName As String) As Long
private const PAGE_READONLY=2
private const PAGE_READWRITE=4
private const PAGE_WRITECOPY=8

and then:

h = CreateFileMapping(&hFFFFFFFF,0,PAGE_READWRITE,0, 65535,"MyShare")

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question