I need to convert a C++ File.exe source into a File.dll . For this I change the Configuration Type of this source into a Dynamic Library (.dll) and Visual Studio build a File.dll instead of File.exe .
Now Im trying to use this File.dll into my C# project . This dll entrypoint is sth like :
int wmain(int argc, wchar_t* argv[])
{
// codes
}
after this I pass arguments to the File.exe in CMD like :
File.exe -l -a "This is first arg !"
But now the things become complicated .I know that using C++ dlls into the C# code is like :
[DllImport(@"File.dll" , EntryPoint = "wmain")]
private static extern int wmain(int a , string arg);
My Questions :
1.The below code is wrong cuz I don't how can I declare (wchar_t* argv[]) as a C# variable ?!
2.If I run the below code in C# it gives : 'Unable to find an entry point named 'wmain' in DLL 'File.dll'.'
So it seems that I should do sth first to make entrypoint clear for C# . What's that ?!
Update 1 : It seems that this link has the same scenario for my first question but the difference is I use an array and I can't find a class that is same as (wchar_t) in c# .