Error when using AddAccessAllowedAceEx api

Posted on 2005-04-18
Medium Priority
Last Modified: 2008-01-09
I am trying to use the AddAccessAllowedAceEx api in VB 6 to set permissions on a folder so that new ACEs can be inherited by files. However, I keep getting the following error when I compile the program: Compile error: User-defined type not defined.

I am using the following declaration in a module:

Declare Function AddAccessAllowedAceEx Lib "advapi32.dll" (ByVal pAcl As Struct_MembersOf_PACL, ByVal dwAceRevision As Long, ByVal AceFlags As Long, ByVal AccessMask As Long, ByRef pSid As SID) As Long

Any help would be appreciated.
Question by:MattBoon
LVL 13

Assisted Solution

rettiseert earned 1600 total points
ID: 13807542
I think you are missing the declaration of Struct_MembersOf_PACL & SID.

I haven't worked with AddAccessAllowedAceEx but maybe you can get something good from this example:

Accepted Solution

RainUK earned 400 total points
ID: 13807545
One of the parameters of the API references a structure -> Struct_MembersOf_PACL

You need to define this!


Private Type Struct_MembersOf_PACL

    ?? as string
    ?? as long

End Type

Author Comment

ID: 13813560
Thanks to both of you for your help. I was having problems with the definition of Struct_MembersOf_PACL and the example from rettiseert helped sort this out.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…
Suggested Courses
Course of the Month9 days, 19 hours left to enroll

569 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