CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2009
    Posts
    13

    ActiveX - bitmask field imported as enum

    Hi

    I'm trying to use an ActiveX component in my MFC app. The problem is one field is being imported incorrectly.

    Following line works in C# (bitmask)

    client.Connection = ConnectionConstants.client | ConnectionConstants.service;`

    In C++ the field is imported as an enum. It won't let me use the bitwise expression. How can I get around it?

    Is there an easier way than compiling the IDL? I get some error about single not being a recognized type.

    Thanks

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: ActiveX - bitmask field imported as enum

    In C++ the field is imported as an enum.
    A enum is a number and a bitmask is a number... don't really understand your problem.

  3. #3
    Join Date
    Aug 2009
    Posts
    13

    Re: ActiveX - bitmask field imported as enum

    The cast worked. I didn't actually try it. I'm sure I read somewhere it was possible to convert from enum to int but not from int to enum.

    Thanks for the response.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured