I'm trying to create a Symlink Generator with c++/cli ( Windows based ) There is a Docu on Microsoft ( MS )
But i dont know excactly how it works.
I tryed to find a working excample, but i could not find one and i could not get a working solution on my own.
My Complete Code HERE!
private: System::Void btnCreateSymlinks_Click(System::Object^ sender, System::EventArgs^ e) {
String^ pathSource = GetSourcePath();
String^ pathDest = GetDestinationPath();
String^ folder = System::IO::Path::GetFileName(pathSource);
lblInfo->Text = pathSource + " -> " + pathDest + "" + folder;
}
How do i use the CreateSymbolicLink function with those pathSource and pathDest?
In order to use .NET strings on the garbage collected stack, you'll need pinning pointers (this is something that p/invoke does automatically for C# coders, but C++/CLI coders need to request).
Then just call the Unicode version of the API (since .NET strings are always Unicode).