user3273780
user3273780

Reputation: 11

How To Convert From System::String to const Byte*

Can anybody please let me know how to do the above said conversion As RegSetValueEx requires const BYTE *lpData for the path To get Present Directory I Use GetCurrentDirectory() ,where the Output is of the type String

Upvotes: 0

Views: 278

Answers (1)

Jochen Kalmbach
Jochen Kalmbach

Reputation: 3684

If you already use .NET (C++/CLI) then please also use the managed classes for accessing the registry!

Be aware:

  • System::String is a managed type!
  • RegSetValueEx and GetCurrentyDirectory is a native Win32 API!

Please use always C++/CLI:

If it was not intended to use C++/CLI, then please switch it off in your project settings (General: Common language runtime suppoer: No Common Language Runtime Support"

Upvotes: 1

Related Questions