直到最近,我们还是将x86服务作为服务运行,但将其更改为任何使用64位DLL的新功能。剩下的第三方DLL之一是32位。我在注册表中为它设置了一个DLL替代品,但这只是解决方案的一半。在64位服务中使用32位DLL的指针
我怀疑内存中的指针是不可访问的,因为它不再运行inProc。我需要知道的是如何使用System.Runtime.InteropServices.Marshall对象来访问返回的指针。
在此先感谢。
public Image GetThumbnail(string strFilename)
{
SeThumbnailExtractor objExtractor = new SeThumbnailExtractor();
int hImageSE;
Image objImage = null;
try
{
objExtractor.GetThumbnail(strFilename, out hImageSE);
IntPtr iPImage = new IntPtr(hImageSE);
//fails below
objImage = Image.FromHbitmap(iPImage);
_ReturnedImage = objImage;
_SourceFile = strFilename;
Marshal.FreeHGlobal(iPImage);
}
catch (Exception ex)
{
_ErrorMsg = "ERROR: " + ex.Message.ToString();
}
if (objExtractor != null)
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(objExtractor);
objExtractor = null;
}
return objImage;
}
谢谢你的清晰简洁的解释。我已经到了必须将程序的功能分成两个服务的程度。 64位的主要功能,然后是一个小的32位的剩余功能。我们被困在那里直到供应商唤醒到64位计算。 – BigBadOwl