I am trying to use pHash from .NET
First thing I tried was to register (regsvr32) phash.dll
and asked here
Second of all, i was trying to import using DllImport as shown below.
[DllImport(@".CompHash.dll")]
public static extern int ph_dct_imagehash(
[MarshalAs(UnmanagedType.LPStr)] string file,
UInt64 hash);
But when i try to access the method above during run-time, following error message shows up.
Unable to find an entry point named 'ph_dct_imagehash' in DLL '.CompHash.dll'.
What does "entry point" means and why am I getting the error?
Thank you.
FYI - Here is the full source code
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows;
namespace DetectSimilarImages
{
public partial class MainWindow : Window
{
[DllImport(@".CompHash.dll")]
public static extern int ph_dct_imagehash(
[MarshalAs(UnmanagedType.LPStr)] string file,
UInt64 hash);
public MainWindow()
{
InitializeComponent();
Loaded += MainWindow_Loaded;
}
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
try
{
UInt64 hash1 = 0, hash2 = 0;
string firstImage = @"C:Usersdance2diePictures2011-01-23177.JPG";
string secondImage = @"C:Usersdance2diePictures2011-01-23176.JPG";
ph_dct_imagehash(firstImage, hash1);
ph_dct_imagehash(secondImage, hash2);
Debug.WriteLine(hash1);
Debug.WriteLine(hash2);
}
catch (Exception ex)
{
}
}
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…