look....
#include "stdafx.h"
#include <afxdllx.h>
#include "AV800Encoder.h"
#include "AV800SettingDlg.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endifstatic AFX_EXTENSION_MODULE AV800CoderDLL = { NULL, NULL };HMODULE hModule;extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Remove this if you use lpReserved
UNREFERENCED_PARAMETER(lpReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
hModule = hInstance;
#ifdef _DEBUG
TRACE0("AV800CODER.DLL Initializing!\n");
#else
TRACE0("AV800CODER.DLL Initializing!\n");
#endif
// Extension DLL one-time initialization
if (!AfxInitExtensionModule(AV800CoderDLL, hInstance))
return 0; // Insert this DLL into the resource chain
// NOTE: If this Extension DLL is being implicitly linked to by
// an MFC Regular DLL (such as an ActiveX Control)
// instead of an MFC application, then you will want to
// remove this line from DllMain and put it in a separate
// function exported from this Extension DLL. The Regular DLL
// that uses this Extension DLL should then explicitly call that
// function to initialize this Extension DLL. Otherwise,
// the CDynLinkLibrary object will not be attached to the
// Regular DLL's resource chain, and serious problems will
// result. new CDynLinkLibrary(AV800CoderDLL);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
TRACE0("AV800CODER.DLL Terminating!\n");
// Terminate the library before destructors are called
AfxTermExtensionModule(AV800CoderDLL);
}
return 1; // ok
}编译成功以后,LoadLibrary却return null.
值得郁闷的是,编译出来只有56k,与同类设备驱动模块却有120k左右。
在线等待....why?
#include "stdafx.h"
#include <afxdllx.h>
#include "AV800Encoder.h"
#include "AV800SettingDlg.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endifstatic AFX_EXTENSION_MODULE AV800CoderDLL = { NULL, NULL };HMODULE hModule;extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Remove this if you use lpReserved
UNREFERENCED_PARAMETER(lpReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
hModule = hInstance;
#ifdef _DEBUG
TRACE0("AV800CODER.DLL Initializing!\n");
#else
TRACE0("AV800CODER.DLL Initializing!\n");
#endif
// Extension DLL one-time initialization
if (!AfxInitExtensionModule(AV800CoderDLL, hInstance))
return 0; // Insert this DLL into the resource chain
// NOTE: If this Extension DLL is being implicitly linked to by
// an MFC Regular DLL (such as an ActiveX Control)
// instead of an MFC application, then you will want to
// remove this line from DllMain and put it in a separate
// function exported from this Extension DLL. The Regular DLL
// that uses this Extension DLL should then explicitly call that
// function to initialize this Extension DLL. Otherwise,
// the CDynLinkLibrary object will not be attached to the
// Regular DLL's resource chain, and serious problems will
// result. new CDynLinkLibrary(AV800CoderDLL);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
TRACE0("AV800CODER.DLL Terminating!\n");
// Terminate the library before destructors are called
AfxTermExtensionModule(AV800CoderDLL);
}
return 1; // ok
}编译成功以后,LoadLibrary却return null.
值得郁闷的是,编译出来只有56k,与同类设备驱动模块却有120k左右。
在线等待....why?
解决方案 »
- Slider 背景图片的问题,透明后最小化后背景挡住控件了?
- 在线等:slist模板库为什么提示打不开?
- [20]请教一个Cdialog绘图问题,有答案200分相送
- 特殊字符在中文系统显示正常英文系统乱码问题
- vc中如何导入.h和.lib?
- 对话框去掉Toolbar后,我加了一个最小化按钮,一点击最小化后,可是我在下面的图标,不能恢复显示,该怎么做?
- 谁能给在下提供在一块画布上写字,字数可多可少,根据字数进行布置,字数少则字体大,字数多则字体小,不能超出画布的范围,怎么做?
- 急!installshield安装问题!答者有分!!!
- 100啊,来就有:如何用vc创建一个txt文件,然后如何住这个txt文件中写入如下一行字符?
- 如何不显示属性对话框而设置组件/控件属性啊?
- Attach 函数是做什么的好象用的很多!
- 高级话题:VC&Word
有120多k,而我编出来就只有56k左右,还有一个要说清楚的地方:av800api.h中
给出来的初始化组件的func只有一个BOOL InitDevice(HWND hwnd),我在demo程序里也没有找到一句LoadLibrary("av800.dll"),那在我的写的av800coder.dll中,对于这个sdk中的av800.dll,我怎样处理它?是不是这里的原因而至我的av800coder.dll编出来只有在代码上大同的模块的一半?急,waiting for online........
LoadLibrary返回NULL可能是因为DllMain出现了错误,
new CDynLinkLibrary(AV800CoderDLL);这一句有问题吗?
LoadLibrary返回NULL可能是因为DllMain出现了错误,
new CDynLinkLibrary(AV800CoderDLL);这一句有问题吗?
怎样利用GetLastError返回的DWORD?
但av800coder.dll已经编译成功了。并且我把av800.dll与av800coder.dll
copy 到同一个dir下,LoadLibrary("av800.dll"),ok.LoadLibrary("av800
coder.dll"),Error!到底是哪里出了错呢?不管av800coder.dll的其他func
写得怎样,只要这个extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)正常,
HMODULE hModule = LoadLibrary("av800coder.dll")总不为空吧.
唉.....
今天晚上不吃饭也要把这个问题搞出来.在线等待...