View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob Bovey Rob Bovey is offline
external usenet poster
 
Posts: 811
Default XLL - VS .Net2003 - init problem - const char strings - /Gf option??

Hi Kevin,

Unfortunately, no. That example was just a really glaring mistake in the
SDK. Writing to string literals in this manner worked in some configurations
in earlier versions of VC++, maybe because they happened to get stored in
writable memory. But whatever allowed this to work, it seems to have been
fixed in VC.NET. Since it's undefined behavior according to the standard,
there isn't any way to make it work again.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"Kevin Love" wrote in message
...

Thanks for solution above. It definitely seems
to do the trick with writing to string literals.
At least I got over the initial hurdle. Now I have
a bunch of code that looks like this that is crashing.
Any ideas, other than just slugging thru it all
and changing it to enable string literal writing?


static char* xll_name_buf = " my excel string.";
xInfo.xltype = xltypeStr;
xInfo.val.str = xll_name_buf;
xInfo.val.str[0] = lstrlen(&xll_name_buf[1]);



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!