I am trying to use extensions in protcol buf(version 2.3.0) using
visual studio 2008 c++.
Here is my .proto file:


message DataMsg {
        optional int32 msgtype=99;
        extensions 100 to max;
        }
message FilterData {
        extend DataMsg {
                optional string filter_columns = 100;
                repeated string filter_setcolumn = 101;
                repeated string filter_operator = 102;
                repeated string filter_value = 103;
                repeated int32 filter_action = 104;
                }
        }


and here is how I use it: It crashes on SetExtension:


        DataMsg fltData;
        fltData.set_msgtype(100);

        string str("TEST");
        fltData.SetExtension(FilterData::filter_columns,str);//this crashes

this also crashes::
        fltData.SetExtension(FilterData::filter_columns,"TEST");


The error I get is: Index-out-of-bound (Field is empty).

Any help or suggestion with what I am doing wrong??

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to