atl

Is there a document on .rgs files syntax?

こ雲淡風輕ζ 提交于 2019-12-09 17:31:47
问题 Resource scripts loaded from .rgs files are used with ATL CComModule::UpdateRegistryFromResource() . It's quite common to see samples of such files on the net but I've never seen a complete description on what constructs are allowed in .rgs files. Is there such a document? 回答1: There's some MSDN documentation, but it appears to be pretty unfocused. The book ATL Internals talks at some length about custom replacements. Other than that, I haven't seen much... 来源: https://stackoverflow.com

Developing Internet Explorer, browser helper object extensions?

烈酒焚心 提交于 2019-12-09 06:08:01
问题 1) I am trying to make a simple BHO in C# like here already answered: https://stackoverflow.com/a/5740004/285594 2) But unfortunately they all tried less then IE11, where some made it work and some failed too 3) after following everything as mentioned in that answer, i also purchased official code sign but it simply does not working in IE11 Windows 7 64-bit. You can download my prepared version of Visual studio 2013: which includes all the source code and details for IE11: https://www.dropbox

Creating an ATL COM object that implements a specific interface

心不动则不痛 提交于 2019-12-09 01:31:45
问题 I need to implement a simple ATL COM object that implements a specific interface for which I have been given both a .tlb file and a .idl file. The interface is very simple and only consists of a single method. I have created many ATL objects in the past but never one that has to implement a specific interface. What do I need to achieve this? I'm assuming that I somehow need to reference the interface's IDL or TLB in my new objects IDL somewhere? Any pointers are welcome. 回答1: It's much more

_bstr_t to UTF-8 possible?

爷,独闯天下 提交于 2019-12-08 16:24:41
问题 I have a _bstr_t string which contains Japanese text. I want to convert this string to a UTF-8 string which is defined as a char * . Can I convert the _bstr_t string to char * (UTF-8) string without losing the Japanese characters? 回答1: Use WideCharToMultiByte() – pass CP_UTF8 as the first parameter. Beware that BSTR can be a null pointer and that corresponds to an empty string – treat this as a special case. 回答2: Here is some code that should do the conversion. void PrintUtf8(const TCHAR*

ATL COM events for javascript

安稳与你 提交于 2019-12-08 10:54:33
问题 I created an ATL COM server component (exe) some time ago. It exposed a few normal COM APIs (derived from IDispatch) and also fired a few COM events. The event mechanism was implemented using ATL IConnectionPointContainer. This COM server was initially used by a simple C# application, which directly added a reference to the COM server. Everything, the APIs and events, works fine in C# app. Then came the requirement for the COM server to able to used with javascript in a webpage (IE). I

add custom context menu to hosted web browser control

▼魔方 西西 提交于 2019-12-08 08:46:41
问题 I am hosting a web browser control, and want to provide my own context menu. Ideally, I want to present my own context menu, that contains the original browser's context menu (with all addins etc.) as a sub menu. If that's not possible / to tricky, I'd be ok with e.g. normally showing my context menu, and showing the original one when the user presses SHIFT. Do I need to implement IDocHostUIHandler? if yes, how do I specify a custom context menu, how can I force the original one? How do I get

Run a ATL COM DLL from a Browser (call a method)

不问归期 提交于 2019-12-08 08:37:05
问题 I have a COM Object created using ATL (without MFC Support) The Object has 1 method that opens a Dialog (that does all the rest) Currently I call it from another EXE: hr = CoCreateInstance( CLSID_MyControl, NULL, CLSCTX_INPROC_SERVER, IID_IMyControl, (void**) &pMyControl ); and then: hr = pMyControl->MyMethod (ATL::CComBSTR(InputString1), ATL::CComBSTR(InputString2), &IntReturned, &IntReturned); Is it possible to call it as is from a browser ? How can I Instantiate the object and invoke my

Tab key doesn't work in IWebbrowser2

送分小仙女□ 提交于 2019-12-08 03:50:25
问题 I am using an ActiveX control to implement an embedded browser in an ATL app (IWebbrowser2). The problem is, that I can't jump between text fields using the tab key. Pressing the tab key just does nothing. Pressing the Enter key submits the form as expected. The problem exists e.g. on the facebook login site. How can I make the tab key work properly? Must I activate something in the ATL control to make this work? Thank you! Fabian 回答1: This article describes a way how to use IWebBrowser2 in C

Does it require to marshal the com object supporting threading model “Both”

≯℡__Kan透↙ 提交于 2019-12-08 03:32:46
问题 We are given in-proc-server (.dll) with threading model "Both".i noticed the threading model in registry editor.as we know com object created with "Both" will take the threading model of the thread in which the object is created. i instantiated the object in a STA thread to make sure call to com object should go through only one thread. i was invoking the methods of this objects from child thread in a serialized way where object is actually created in main(STA) thread will it make any side

Handling an OnClick event of a checkbox

时光总嘲笑我的痴心妄想 提交于 2019-12-08 02:22:07
问题 I'm trying to handle click events of a checkbox control from a BHO. Here is my code: void STDMETHODCALLTYPE CMyBHO::OnDocumentComplete(IDispatch *pDisp, VARIANT *pvarURL) { // ... InitPage(pDocument); } void CMyBHO::InitPage(IHTMLDocument2 *pDocument) { CComQIPtr<IHTMLDocument3> document3 = pDocument; CComPtr<IHTMLElement> elementCheckbox; document3->getElementById(CComBSTR(L"checkbox_id_here"), &elementCheckbox); if(!elementCheckbox) return; if(!m_fCheckboxAdvised) { // Register to sink