How to make acedSetColorDialogTrueColor work in VB(A)

Discussion in 'AutoCAD' started by weslleywang, Jan 27, 2005.

  1. weslleywang

    weslleywang Guest

    Hi:
    I tried to make acedSetColorDialogTrueColor work in my VBA routine. but I failed. here is my experise:
    1)
    Public Declare Function acedSetColorDialogTrueColor Lib "acad.exe" (ByRef intColor As AcadAcCmColor, _
    ByVal fAllowMetaColor As Boolean, _
    ByVal intCurLayerColor As AcadAcCmColor, _
    ByVal DialogTabs As Integer) As Integer

    2)
    Public Type AcCmColor1
    Blue As Long
    Green As Long
    Red As Long
    End Type

    Public Declare Function acedSetColorDialogTrueColor Lib "acad.exe" (ByRef intColor As AcCmColor1, _
    ByVal fAllowMetaColor As Boolean, _
    ByVal intCurLayerColor As AcCmColor1, _
    ByVal DialogTabs As Integer) As Integer

    3)
    Public Declare Function acedSetColorDialogTrueColor Lib "acad.exe" (ByRef intColor As AcCmColor2, _
    ByVal fAllowMetaColor As Boolean, _
    ByVal intCurLayerColor As AcCmColor2, _
    ByVal DialogTabs As Integer) As Integer

    Class:
    AcCmColor2
    Option Explicit

    Public Blue As Long
    Public Green As Long
    Public Red As Long

    none of them work.
    What wrong with my code? if anyone know the reason, or point me the right direction, I will thank you a million and really appreciate.


    Have a great day.

    Wes
     
    weslleywang, Jan 27, 2005
    #1
  2. weslleywang

    Kevin Terry Guest

    'ACAD color dialog
    Public Declare Function acedSetColorDialog Lib "acad.exe" (color As Long, _
    ByVal bAllowMetaColor As Boolean, ByVal nCurLayerColor As Long) As
    Boolean

    ' . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    .. . . . . . . . . . .
    '
    'Color choice using autocad color selection dialog box
    '
    Public Function AcadColor(ByVal lngInitClr As Long, ByVal blnMetaColor As
    Boolean, _
    ByVal lngCurClr As Long) As Long

    AcadColor = -1

    On Error Resume Next

    If acedSetColorDialog(lngInitClr, blnMetaColor, lngCurClr) Then
    AcadColor = lngInitClr
    End If

    On Error GoTo 0

    End Function

    HTH,
    Kevin

    direction, I will thank you a million and really appreciate.
     
    Kevin Terry, Jan 28, 2005
    #2
  3. weslleywang

    weslleywang Guest

    Thank you, Kevin:
    but this is what I am looking for. there are no true color selection there. I have to keep working on it.


    have a greate day

    Wes
     
    weslleywang, Jan 28, 2005
    #3
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 (here). After that, you can post your question and our members will help you out.