L
Luigi
// SecureZeroMem.cpp
#include <windows.h>
extern "C" __declspec(dllexport) PVOID __stdcall SecureZeroMem(IN
PVOID ptr, IN SIZE_T cnt)
{
return SecureZeroMemory(ptr, cnt);
}
I used this code to create an unmanaged DLL with a "WIN32 Project".
Now I have created an "Empty CLR project" in Visual C++ and all builds
fine.
// Caller.cs
[DllImport("SecureZeroMem.dll", CharSet = CharSet.Auto, SetLastError =
true)]
private static extern IntPtr SecureZeroMem(IntPtr ptr, uint cnt);
I used this P/Invoke to call WIN32 code from C#.
What is the way I can use the C++/CLI code since I can now add the C++
DLL as a reference to my C# project?
Windows API will be called correctly or it's better not to use C++/CLI
for this purpose?
Using C++/CLI I could add the C++ project to my solution and I could
add all to GAC in an easier way (without having to do a multifile
assembly from the command line).
Thanks,
Luigi.
#include <windows.h>
extern "C" __declspec(dllexport) PVOID __stdcall SecureZeroMem(IN
PVOID ptr, IN SIZE_T cnt)
{
return SecureZeroMemory(ptr, cnt);
}
I used this code to create an unmanaged DLL with a "WIN32 Project".
Now I have created an "Empty CLR project" in Visual C++ and all builds
fine.
// Caller.cs
[DllImport("SecureZeroMem.dll", CharSet = CharSet.Auto, SetLastError =
true)]
private static extern IntPtr SecureZeroMem(IntPtr ptr, uint cnt);
I used this P/Invoke to call WIN32 code from C#.
What is the way I can use the C++/CLI code since I can now add the C++
DLL as a reference to my C# project?
Windows API will be called correctly or it's better not to use C++/CLI
for this purpose?
Using C++/CLI I could add the C++ project to my solution and I could
add all to GAC in an easier way (without having to do a multifile
assembly from the command line).
Thanks,
Luigi.