如何在MFC应用程序中使用activeX控件(.ocx)? [英] How can I use an activeX control (.ocx) in my MFC application?

查看:640
本文介绍了如何在MFC应用程序中使用activeX控件(.ocx)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我开发了一个MFC应用程序来使用activeX控件。 ocx文件用于设备中的条形码阅读器。

当我在我的应用程序中添加ocx时,我的项目中添加了两个不同的类。

这是一些代码在我的.cpp文件中为1级:



...

1)条形码条码;

2 )barcode.Create(_T(STATIC),_ T(Hi),WS_CHILD | WS_VISIBLE,CRect(0,0,20,20),this,1234);

...



当我运行应用程序时,第2行出现错误。



这里是细节错误:



TestBCR.exe中0x7c812aeb的第一次机会异常:Microsoft C ++异常:内存位置0x0012f0f0处的COleException。



此错误与名为AtlTraceVA的函数有关。



Hi,
I developed a MFC application to use an activeX control. The ocx file is used for barcode reader in a device.
when I add the ocx in my application, two different classes are added to my project.
Here is some codes in my .cpp file for class 1:

...
1) Barcode barcode;
2) barcode.Create(_T("STATIC"), _T("Hi"), WS_CHILD | WS_VISIBLE, CRect(0, 0, 20, 20), this, 1234);
...

When I run the application, an error comes up at line 2.

here is the detail of error:

First-chance exception at 0x7c812aeb in TestBCR.exe: Microsoft C++ exception: COleException at memory location 0x0012f0f0.

This error related to a function named AtlTraceVA.

inline void __cdecl CTrace::TraceV(const char *pszFileName, int nLine,
        DWORD_PTR dwCategory, UINT nLevel, LPCSTR pszFmt, va_list args) const
    {
        AtlTraceVA(m_dwModule, pszFileName, nLine, dwCategory, nLevel, pszFmt, args);
    }





有人可以帮帮我吗?



谢谢提前

Ahrost



Can someone help me?

Thanks in advance
Ahrost

推荐答案

这篇关于如何在MFC应用程序中使用activeX控件(.ocx)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆