Sarita

Sarita Sarita

Niner since 2007

  • Sarita Bafna: VC++ "Orcas" - Marshaling Library and MFC support for Common Controls

    Hi Abhi,
    The  CSplitButton class will be avaliable only starting VS 2008 and we will not be providing it for VS 2003.
    Thanks Sarita 
  • Sarita Bafna: VC++ "Orcas" - Marshaling Library and MFC support for Common Controls

    We are in the process of getting our samples out. When you create a Split Button, are you seeing an error like this “error RC2104 : undefined keyword or key name: BS_DEFSPLITBUTTON”. If yes this is a known error as the Windows SDK does not have the latest commctrl.rh in the March CTP. It is missing the definitions of all the new button styles. As a temporary workaround for now, you can manually add these styles in your targetver.h for each of the affected projects.

     

    // BUTTON STYLES

    #ifndef BS_SPLITBUTTON

    #define BS_SPLITBUTTON          0x0000000CL

    #endif

     

    #ifndef BS_DEFSPLITBUTTON

    #define BS_DEFSPLITBUTTON       0x0000000DL

    #endif

     

    #ifndef BS_COMMANDLINK  

    #define BS_COMMANDLINK          0x0000000EL

    #endif

     

    #ifndef BS_DEFCOMMANDLINK

    #define BS_DEFCOMMANDLINK       0x0000000FL

    #endif

     

    After including these, you should not have a problem creating Split Button or Command Button.

    Please let me know if there are other issues that are blocking you while using Split Button.

     

    Thanks Sarita

     

  • Sarita Bafna: VC++ "Orcas" - Marshaling Library and MFC support for Common Controls

    Kosher wrote:
    Only support for strings?  Uhm, that's like saying "Hey, we have this great marshaling library but it only supports strings". 


    The primary goal of the first version of this library was to design a marshaling framework that could be easily understood, commonly applied and easily extended by users. The second goal was to provide marshaling support for a small and important set of data types. Based on customer feedback we know that strings are the most commonly marshaled set of data types and hence it is important to at least have support for them in the first version. Also, as the library has an extensible model, it can be easily extended by customers with marshaling conversions not currently supported by the library. With future versions of VC we definitely intend to support more marshaling conversions.

    I wonder what you think of the design whereby many data types could be marshaled via a single API, marshal_as<to_type>(from), as opposed to calling a different API for every conversion pair. Is the use of template syntax intuitive and natural for C++ programmers? Your opinions greatly appreciated!

    Thanks Sarita

    PS: In your sample code in MarshalString (String ^ s ) function you could potentially be leaking memory. The IntPtr returned from StringToHGlobalAnsi must be explicitly released using FreeHGlobal or a memory leak results.