atl

Unable to start program ATL Project C++

别说谁变了你拦得住时间么 提交于 2019-12-11 07:44:40
问题 I am trying to create a BHO with the ATL Project in Visual Studio 2010. I have been following this article: http://msdn.microsoft.com/en-us/library/bb250489(v=vs.85).aspx The project builds successfully however I get an error popup with an ambiguous "Unable to start program 'C:\ .... MyProject.dll'" My BHO just has the bare bones code, I've only added what was mentioned in the article until it says to build for the first time so most of it is auto generated. Anyone run into this? Thanks! 回答1:

Fastest OLEDB read from ORACLE

戏子无情 提交于 2019-12-11 07:24:56
问题 What would be the fastest way of retrieving data from the Oracle DB via OLEDB? It should be portable (have to work on Postgres and MS SQL), only one column is transfered (ID from some large table). Current performance is 100k rows/sec. Am I expecting too much if I want it to go faster? Clarification: datatable has 23M records Query is: SELECT ID FROM OBJECTS Bottleneck is transfer from oracle to the client software, which is c++/OLEDB 回答1: What the heck, I'll take a chance. Edit: As far as

CImage::Load() from memory without using CreateStreamOnHGlobal

六月ゝ 毕业季﹏ 提交于 2019-12-11 06:36:16
问题 I am displaying a live view video from camera. Every frame I download into a byte array (pImageData) which I have to allocate. Now, to display, I am using a CImage (MFC). However, all samples I find are based on using GlobalAlloc, yet another memcpy and CreateStreamOnHGlobal. I'd like to avoid doing another allocation/deallocation and memory copy. Each frame is over 2mb and I am pushing 30 fps! Is it possible to create an IStream on non-HGLOBAL based memory? OR Is it somehow possible to

ATL COM - How To Reuse Code for Interface Method

社会主义新天地 提交于 2019-12-11 04:39:53
问题 I have several interfaces, e.g. IA, IB, IC, and so on, that share common properties, e.g. Site. I would like to know how to reuse code for these interfaces (please save me the answer on COM aggregation). Current implementation is as follows: class CA // ATL specific... { STDMETHODIMP get_Site(...) {...} STDMETHODIMP put_Site(...) {...} } class BA // ATL specific... { STDMETHODIMP get_Site(...) {...} STDMETHODIMP put_Site(...) {...} } class CC // ATL specific... { STDMETHODIMP get_Site(...) {.

Permission denied on frame

允我心安 提交于 2019-12-11 04:07:17
问题 I have a window based on the CAxWindow. In this window I create WebBrowser control. When the DISPID_DOCUMENTCOMPLETE happens I do: void __stdcall document_complete( LPDISPATCH pBrowser, VARIANT* ) { CComQIPtr< IWebBrowser2 > wb( pBrowser ); CComPtr< IDispatch > doc; if( SUCCEEDED( wb->get_Document( &doc ) ) ) { _docs.push_back( doc ); } ... } When the page is loaded I call for each document in _docs the script (IActiveScript and IActiveScriptSite): function main( doc ) { try { return doc.URL;

Threading in BHO/ATL/COM. Winapi or something else?

最后都变了- 提交于 2019-12-11 03:19:57
问题 I writing IE add-on and I'm using ATL for it. I need to create background worker thread so UI thread will be unblocked as soon as possible. My question is, should I use the lowest possible way of creating thread which is Winapi, CreateThread etc. Or is there other proffered way of creating worker thread in BHO/ATL/COM projects? I have to learn this stuff first so I thought I would ask first ;) 回答1: There is no need to use low-level APIs unless you need the level of control they offer. With

How to register a 64-bit COM dll on 64-bit Windows 7?

那年仲夏 提交于 2019-12-11 01:38:02
问题 I'm trying to register an x64 COM server dll for use in x64 office on x64 windows 7. I have followed the instructions here but I cannot register the dll. When I attempt to I get the following error: The command I use is regsvr32 my_x64_com_server.dll Why is this happening and is there a workaround? Thanks in advance. 回答1: How is the command being run? From a process or from a command line? Make sure the command is being run from a 64-bit process (or a 64-bit cmd.exe console window). Otherwise

Do vectors of CComPtr still need CAdapt?

孤者浪人 提交于 2019-12-11 00:55:10
问题 STL has std::addressof which gets the true address of an object even if it overloads operator & . ATL::CAdapt was required to workaround this problem when storing CComPtrs in std::vectors . Anyway, I'm wondering, with C++11, should std::vector be able to cope with containing CComPtr 's directly without CAdapt being necessary? More specifically, I'm using VS 2013. Would that support vector without CAdapt ? 回答1: Quoted from MSDN: This was most commonly necessary for C++ Standard Library

CAppModule vs CAtlExeModuleT , getting the application message loop

你。 提交于 2019-12-11 00:53:29
问题 I am trying to get the message loop from a ATL::CAppModule in my project, there seems to be none, so: I've tried defining CAppModule, with extern CAppModule _Module; in "stdafx.h" and CAppModule _Module; in my .cpp file , it compiles, linkes and at the perform registration step I get an assertion in atlbase.h here ATLASSERT(_pAtlModule == NULL); which means that the CAppModule has already been declared. But I can't seem to find another CAppModule instantiation, instead I see a CAtlExeModuleT

ATL COM: Access Event Methods From Other Thread

懵懂的女人 提交于 2019-12-10 19:20:02
问题 I'm implementing a COM interface to an existing VS2010 C++ MFC-application. Most parts of the COM interface interaction works great, but I am confused of how to trigger COM events from another thread that the one where the COM interface is running / defined. The application is multi-threaded with one main thread running the COM interface and handling GUI changes ( thread 1 ) and one thread to receive incoming messages from a C-library ( thread 2 ). For certain messages received in thread 2 I