Solved

CreateFileMapping parameter

Posted on 1999-01-05
1
365 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

724 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