From: James S. <jam...@op...> - 2007-01-23 02:33:03
|
On Mon, 2007-01-22 at 18:19 -0800, Brian Dessent wrote: > James Steward wrote: > > > The next line of code in the C++ app uses snprintf to write to the > > Strbuffer. > > > > After execution of this line err has a value 1023. Curious that this is > > the size of the buffer passed to snprintf. > > > > The next line of C++ calls a function to put that string buffer into a > > GUI text box. After that function err is complete garbage. > > This sounds like the classic mismatch of calling conventions > (cdecl/stdcall). Make sure both compilers are under the same > expectations, otherwise you get random stack corruption and crashes. > Remember that sometimes changing the calling convention also changes the > function name decoration, so you may need to use a .def file to provide > function aliases for linking to succeed. Thanks Brian. I feel like a dill. I should have known better. Cheers, James. |