I'm having a problem with a very basic situation. Using this simple proto 
file:

package Implib;

message IMPLIB_out {
 optional string dll = 1;
 optional string cfg = 2;
};


This test works fine:

 outp.set_cfg("A");
 outp.set_dll("B");

 std::string cfg = outp.cfg();
 std::string dll = outp.dll();

 printf("cfg:%s\n", cfg.c_str() );
 printf("dll:%s\n", dll.c_str() );


Output is fine, as expected:

  cfg:A
  dll:B

When I pass my buffer into my DLL and use the same set functions from 
within my DLL, the results are:

  cfg: B
  dll: B

*BOTH strings will get set to whatever I set the final string...????? Even 
if I check immediately after settings I will see this.*

Things work fine when using int32's. Things also work fine if I use an 
intermediary message like:

message IMPLIB_out {
 message Test {
   optional string dll = 1;
   optional string cfg = 2;
 }
 required Test test = 3;
};

I pass my buffer to the dll using a function like:

static IMPLIBFUNCSDLL_API IMPLIB_ECODE import(Implib::IMPLIB_out& outp ); 

The same problem exists if I pass by pointer.

I can work around this problem, but I'd really appreciate if someone could 
shed some light here.

Thanks 

-Rob








-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to