October 30, 2013

How to Disable Screen Lock

Problem
- How to disable Pattern Screen Lock
- "Disabled by Administrator, encryption policy, or credential ...
- Can't disable screen lock
- Can't disable pattern screen lock

Case Study (Screen lock)
None (Grayed out) Disabled by administrator, encryption policy, or credential storage. 
Slide (Grayed out) Disabled by administrator, encryption policy, or credential storage.
Face Unlock (Grayed out) Disabled by administrator, encryption policy, or credential storage.
Pattern (Enabled)
PIN (Enabled)
Password (Enabled)

Solution
Go to SETTINGS > Security > Clear credentials (last item) and then go to Screen lock

October 20, 2013

Visual C++ DLL in C#

Questions:
- VC++ DLL in C#
- How to call C++ DLL in C#
- How to call a Visual C++ method in C# by DllImport
- DllImport in C# ... Visual C++ Dll
- How to use DllImport a C++ class

Error:
- Unable to find an entry point named ...

Solution:
Add these lines in VC Project
extern "C"
{
    __declspec(dllexport) int Sum(int a, int b) {return a + b;}
    __declspec(dllexport) int Mul(int a, int b) {return a * b;}
}

Add these lines in C-Sharp Project
public static class DllHelper
{
    [DllImport("XYZ.dll")]
    public static extern int Sum(int a, int b);
    [DllImport("XYZ.dll")]
    public static extern int Mul(int a, int b);
}