atl

How can I return both an error string and error code to VB6 from an ATL activex control?

这一生的挚爱 提交于 2019-12-03 15:31:00
I'm trying to return a detailed error to VB6 using CComCoClass::Error , but it seems I can only return an error code /or/ a message - but not both. return Error(_T("Not connected"), __uuidof(IMyInterface), HRESULT_FROM_WIN32(ERROR_CONNECTION_INVALID)); results in a generic "Method 'Request' of object 'IMyInterface' failed" error message in Err.Description on the VB6 side (but ERROR_CONNECTION_INVALID in Err.Number), while return Error(_T("Not connected")); results in the appropriate error message, but a generic error code in Err.Number. How can I get the best of both worlds? Steffen Opel You

How to communicate between two COM objects using Running Object Table (ROT)?

£可爱£侵袭症+ 提交于 2019-12-03 14:04:53
I have two COM objects written in C++ and ATL. There are in one library and I know their IIDs and CLIDs. I can't find an example of doing this simple communication between two simple COM objects. How to create IMoniker and how to add it to ROT? And then, how to retrieve pointer of this object,in other COM in different process/thread? Does anyone can provide a small example? EDIT : More info: I'm writing an add-on for IE. There are two COM object completely unrelated that IE load for different purpose. One is BHO (Browser Helper Obect), other is Asynchronous Pluggable Protocol (APP) I found I

How to create a splitter in ATL/WTL?

匿名 (未验证) 提交于 2019-12-03 10:09:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to place the elements of my (resizable) dialog in one of two panes. How do I create a splitter for the panes, using WTL? I found CSplitterImpl and CSplitterWindowImpl , but I can't figure out how to use them with my dialogs. 回答1: WTLExplorer sample from WTL should get you the idea, see \Samples\WTLExplorer. If you'd like more, there's a lot around, e.g. http://www.viksoe.dk/code/splitterbar.htm 文章来源: How to create a splitter in ATL/WTL?

Using MFC in Windows service?

 ̄綄美尐妖づ 提交于 2019-12-03 09:06:21
I'm starting to develop a Windows service. I want to use some classes from my own, that has little dependencies to some MFC classes like CString, CSocket, CArchive, CMemFile and CObject. MSDN says you need to be very careful about which pieces of MFC you use in the Windows service, but don't specifies it and don't describes the problems that can occur. My questions are: what pieces of MFC can be used? what problems can I expect, by using MFC? which parts of Windows service are critical for MFC use? is it advisable to use ATL instead of MFC for Windows service? I'm not sure what they mean in

Pre-registering an ATL window class

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using a combination of the ATL and WTL for a project and have derived my own class from CWindowImpl , which looks something like this: class CMyControl : public CWindowImpl<CMyControl> { public: DECLARE_WND_CLASS(_T("MyClassName")) ... BEGIN_MSG_MAP(CMyControl) ... END_MSG_MAP() }; This is all good, and if I use CMyControl::Create to create an instance of the control, then it works fine as under the hood, the CWindowImpl::Create function will register the Win32 class (in this case called MyClassName ). However, it is this behaviour -

Right single apostrophe vs. apostrophe?

落花浮王杯 提交于 2019-12-03 08:40:32
问题 Right single quotation mark (U+2019) vs. Apostrophe (U+0027) What is the difference between these two characters? I ran into this issue where I use CAtlString to load a string from a resource file, and on some Windows installations, the LoadString fails when trying to load a string that contains U+2019, but it works on some other Windows installations. The U+2019 character appears in strings in my resource file that I copied from Word, and U+0027 appears in stirngs that I hand coded. Why does

Developing Internet Explorer, browser helper object extensions?

你说的曾经没有我的故事 提交于 2019-12-03 07:33:43
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.com/s/60kg212vkjb7yud/ClassLibrary2.rar Q. Can anyone please advise/suggest/help how can i make one

How to get text from CEdit control

老子叫甜甜 提交于 2019-12-03 07:33:43
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 throw an //assert exception, IsWindow() failed. //1. GetDlgItemText(IDC_INPUT_LINE, input); //2.

What is the ($Foo)PS project in my $Foo ATL solution for?

你离开我真会死。 提交于 2019-12-03 05:40:25
问题 Creating an ATL project in MSVC seems to create not one but two projects; the latter named the same as the former but with PS appended to its name. What is the purpose of this second project and how can I tell whether I need it? 回答1: COM supports making interface method calls across two different threads, two different processes or two different machines. This is called marshaling . Two different threads is the most common case, a COM server is often not thread-safe. COM implements thread

How to write a shell extension in C++?

一曲冷凌霜 提交于 2019-12-03 05:08:25
This seemed like a common question but after doing some searching, I wasn't really able to find my answers. There is an article on this here: http://www.codeproject.com/KB/shell/shellextguide1.aspx But it's for a very old version of Visual Studio. I'm using VS 2008, so the instructions and interfaces don't seem to match what I'm seeing. I want to create a simple shell extension using C++ that creates a context menu for files with extension .GZ. When right clicking on these files, I should be able to click my context menu item and have a callback in code to do some sort of operation on that