Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: [CONNECT - MDL C++] get active cellname

$
0
0

[quote user="Julia Frid"]When try to use char type as old code got error[/quote]

The MicroStationAPI for CONNECT uses Unicode almost everywhere.  There are few places where you will find a char[] string.

Use MSWChar [] (same as wchar_t []) for C-style strings, but prefer C++  std::wstring or Bentley::WString.

[quote user="Julia Frid"]WString cellname; 
ActiveParams::GetValue (cellname, ActiveStringParams::ACTIVEPARAM_CELLNAME);
if (Dbg) printf("\n cellname =%s", cellname); [/quote]

  • Bentley::WString is Unicode, so your debug print statement must also be Unicode
  • Bentley::WString is a class similar to std::basic_string, so you should use the C-string extractor
if (Dbg) wprintf(L"\n cellname =%s", cellname.c_str ());

Prefer to use the MicroStation Message Center.


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>