老问题,.h文件编译成.dll
就是把Vfw.h搞成.dll文件以供C#调用,用里边的函数capSetCallbackOnFrame,怎么弄啊,有高手能说详细点吗,从头到尾的过程,菜鸟有点笨,而且只学过C#语言,请原谅。 --------------------编程问答-------------------- 那你先要请教VC的熟悉的人,做成dll,然后才平台调用。。。 --------------------编程问答-------------------- 不能以vfw.h转换成vfw.dll。因为里面只有函数定义而没有函数实现,MS在打包应用程序的时候,只会给出头文件和lib文件。你只能看到函数列表而不能看到函数的实现。这是基于安全考虑。不需要转换成vfw.dll。因为这些函数已经被写到system32\avicap.dll里面了。你
[DllImport("avicap32.dll")]
public static extern IntPtr capSetCallbackOnFrame(...);
即可 --------------------编程问答--------------------
--------------------编程问答-------------------- 无法在 DLL“avicap32.dll”中找到名为“capSetCallbackOnFrame”的入口点。 --------------------编程问答--------------------
capSetCallbackOnFrame
The capSetCallbackOnFrame macro sets a preview callback function in the application. AVICap calls this procedure when the capture window captures preview frames. You can use this macro or explicitly call the WM_CAP_SET_CALLBACK_FRAME message.
BOOL capSetCallbackOnFrame(
hwnd,
fpProc
);
Parameters
hwnd
Handle to a capture window.
fpProc
Pointer to the preview callback function. Specify NULL for this parameter to disable a previously installed callback function.
Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
Remarks
The capture window calls the callback function before displaying preview frames. This allows an application to modify the frame if desired. This callback function is not used during streaming video capture.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
[DllImport("vicap32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
public static extern bool capSetCallbackOnFrame(int hwnd, string s);
i am so sorry, the dll is "vicap32.dll".not "avicap32.dll" --------------------编程问答--------------------
[DllImport("vicap32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
public static extern bool capSetCallbackOnFrame(int hwnd, string s);
so sorry,the continer is "vicap32.dll".not "avicap32". --------------------编程问答-------------------- 没有vicap32.dll,找不到,你这段代码是在网上找的吧,他的这个vicap32.dll应该是他自己编译的
补充:.NET技术 , C#