Archived

This forum has been archived. Please start a new discussion on GitHub.

win32/ question on passing and returning strings

Dear list members,

I have some problems on either returning and passing strings from/ to remote functions.
I attached a VS7 project to this posting consisting of client and server for this Ice interface:
interface FirstClass
{
	string getValue();
	int getValueVariant(out string s);
	
	void setValue(string s);
};

Unfortunately, a call to getValue() and setValue() does not work in the case that the strings I return from/ pass to those functions has 16 characters or more (16 seems to be the initial length of a std::string, at least under win32).
The variant I made, getValueVariant() works for some reasons so I can avoid the getValue() problems.
For the last case, setValue(), I can't imagine a work-around.

Or am I doing something wrong? Help appreciated :)

regs,

Stephan

Comments

  • mes
    mes California
    Hi Stephan,

    You didn't describe your error, but I built your example and received an assertion failure in the client indicating a memory management error. Everything works fine when I change your projects to link with the debug versions of the Ice libraries, so I assume the assertion occurs when memory allocated by one heap is being freed by another.

    Take care,
    - Mark
  • Hi Marc,
    Originally posted by mes
    You didn't describe your error, but I built your example and received an assertion failure in the client indicating a memory management error.

    Yes, that was exactly the error you also found. Thanks for pointing to this dummy issue, when using Ice's debug libs, everything works fine *dooh*.

    Kind regards!

    Stephan