atl

How to get text from CEdit control

五迷三道 提交于 2019-12-21 01:18:12
问题 I'm a new guy with ATL. So forgive me to ask this question. Problem description: One CEdit control is added into a ATL dialog class. It's attached in the dialog initialize function. //Define the edit control ATLControls::CEdit m_txtInput; //In the OnInitDialog function m_txtInput.Attach(GetDlgItem(IDC_INPUT_LINE)); m_txtInput.SetWindowText(_T("New directory")); //In the public memeber function of the dialog GetInput() //I have tried three kinds of method to get the text. But all of them are

How to Cleanly Destroy WebBrowser Control

*爱你&永不变心* 提交于 2019-12-20 10:55:49
问题 I am using ATL in VisualC++10 to host browser control. My code is similar to this example: http://msdn.microsoft.com/en-us/library/9d0714y1(v=vs.80).aspx Difference is I have main window and then child window hosts the browser control. After 2 minutes i have to close the browser completely kill the browser activeX but this child window should be alive and do something else. But somehow this browser control still stays there, i can either see scrollbars or something.. I have also tried by

What's the use of _ATL_PACKING constant when computing distance from the start of object?

旧巷老猫 提交于 2019-12-20 04:16:50
问题 ATL features a set of macros for so-called COM maps. COM map is a table that associates an interface GUID with an offset that is to be added to this pointer to get to the corresponding subobject - the whole stuff works as replacement to explicit static_cast for the upcast inside IUnknown::QueryInterface(). The map entries are built by using offsetofclass macro: #define _ATL_PACKING 8 #define offsetofclass(base, derived)\ ((DWORD_PTR)(static_cast<base*>((derived*)_ATL_PACKING))-_ATL_PACKING)

Handling CoCreateInstance return value

五迷三道 提交于 2019-12-19 23:26:28
问题 Here's a code sample creating a COM object: CComPtr<IBaseFilter> pFilter; auto hr = CoCreateInstance(CLSID_DMOWrapperFilter, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, reinterpret_cast<void**>(&pFilter)); I've seen somewhere that checking if CoCreateInstance() succeeded should look like this: if (SUCCEEDED(hr) && pFilter != nullptr) { // code goes here } What if I would check only hr ? Wouldn't it be enough? Should I also check that filter != nullptr ? //would this be enough? if (SUCCEEDED

What is required to enable marshaling for a COM interface?

旧时模样 提交于 2019-12-19 03:59:20
问题 I have a 32-bit ATL COM component without a type library. It has a class factory for one given class that implements several interfaces. When I use it as an in-proc server, everything works fine - the client side invokes CoCreateInstance(), the object is instantiated and QueryInterface() retrieves a pointer to a requested interface. But when I put the component into COM+ I no longer can instantiate the class - CoCreateInstance() now returns E_NOINTERFACE. I believe the problem is that COM+

Exposing COM events to VBScript (ATL)

若如初见. 提交于 2019-12-19 03:38:18
问题 I have built a COM server DLL in C++ with ATL by using the "ATL simple object" wizard. I followed Microsoft's ATLDLLCOMServer example. Everything works well except for one thing: I do not receive COM events in VBScript . I do receive the events in C#. I had events working in VBScript in an earlier MFC-based implementation as ActiveX control. My control is defined like this: class ATL_NO_VTABLE CSetACLCOMServer : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass

basic playback with programmatically created windows media player

老子叫甜甜 提交于 2019-12-18 04:26:10
问题 I was trying to "just quickly integrate" the Windows Media Player via COM to play single files from the local file system or http sources - but due to the sparse documentation and online resources to its usage when not embedding into some kind of an Ole container, i couldn't get that supposedly trivial use-case to work. Initialization etc. works fine, but actually playing some file always fails. Example code, starting with initialization (error handling stripped, basically translated from the

Calling BHO method from Javascript?

久未见 提交于 2019-12-18 02:47:44
问题 I am trying to call my BHO method from the javascript. The problem is same as stated in the the following posts: Call BHO from Javascript function http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/thread/91d4076e-4795-4d9e-9b07-5b9c9eca62fb/ Calling C++ function from JavaScript script running in a web browser control Third link is another SO post talking about it, but I did not understand the need and code. Also the shared working sample keeps crashing on windows 7 with ie

介绍 ATL CAtlRegExp,GRETA,Boost::regex 等正则表达式库

最后都变了- 提交于 2019-12-17 14:26:44
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 本文摘要翻译了几篇文章的内容,简单介绍 ATL CAtlRegExp,GRETA,Boost::regex 等正则表达式库,这些表达式库使我们可以方便地利用正则库的巨大威力,给我们的工作提供了便利。   正则表达式语法 字符元 意义 . 匹配单个字符 [ ] 指定一个字符类,匹配方括号内的任意字符。例:[abc] 匹配 "a", "b"或 "c"。 ^ 如果^出现在字符类的开始处,它否定了字符类,这个被否定的字符类匹配除却方括号内的字符的字符。如:[^abc]匹配除了"a", "b"和"c"之外的字符。如果^出现在正则表达式前边,它匹配输入的开头,例:^[abc]匹配以"a", "b"或"c"开头的输入。 - 在字符类中,指定一个字符的范围。例如:[0-9]匹配"0"到"9"的数字。 ? 指明?前的表达式是可选的,它可以匹配一次或不进行匹配。例如: [0-9][0-9]? 匹配"2"或"12"。 + 指明?前的表达式匹配一次或多次。例如:[0-9]+匹配"1", "13", "666"等。   * 指明*前的表达式匹配零次或多次。 ??, +?, *? ?, +和*的非贪婪匹配版本,它们尽可能匹配较少的字符;而?, +和*则是贪婪版本,尽可能匹配较多的字符。例如:输入"<abc><def>", 则<.*?>

How to add WTL and ATL to visual studio c++ express 2008

你离开我真会死。 提交于 2019-12-17 10:44:50
问题 I start using the visual studio c++ express 2008 at home but there is no ATL in it. How can I add ATL to visual studio c++ express 2008? 回答1: ATL 7.1 is now part of the Windows Driver Kit. 回答2: ATL was only included in older versions of the SDK. Recent versions of ATL share much code with MFC and are only available with the real versions of Visual Studio, i.e. not with VS Express. So: to use ATL and/or MFC, you need to buy the Professional version of Visual Studio. If you are content with old