event sink in MFC dll

Hi,
           I need some help regarding MFC dll. I have a COM component
which exposes some event interface. I want to write an MFC regular dll
in which i can use event sink to catch those COM events. This dll will
be used in VC++ console application (MFC support). I don't know how to
activate event sink in DFC dll. I wonder whether this is possible.
Your help is highly appreciated. If possible proide me an example.
Thx.

Regards,
Manohar
0
1/21/2008 4:05:29 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
352 Views

Similar Articles

[PageSpeed] 45

"Manu" <manoharbasireddy@gmail.com> wrote in message 
news:b2b0c74b-c614-4ec7-b432-4b7c9efb3f75@m34g2000hsf.googlegroups.com...
> Hi,
>           I need some help regarding MFC dll. I have a COM component
> which exposes some event interface. I want to write an MFC regular dll
> in which i can use event sink to catch those COM events. This dll will
> be used in VC++ console application (MFC support). I don't know how to
> activate event sink in DFC dll. I wonder whether this is possible.
> Your help is highly appreciated. If possible proide me an example.
> Thx.


I don't think that is easy in a console app.  COM events are delivered via 
the standard Windows message queue, and a console app does not usually use 
the message queue.  You could consider rewriting the app to be an MFC 
windowed app with an invisible window, and all your code would have to be 
message-driven (perhaps using WM_TIMER).

-- 
Scott McPhillips [VC++ MVP] 

0
Scott
1/21/2008 4:54:57 PM
Reply:

Similar Artilces:

Event ID 333
Hello everyone, I am currently receiving hundreds of event id 333 error messages in my system log in event viewer. Eventually this causes my exchange server not to respond and requires a reboot. I have tried the suggestions on eventid.net but these don't work. Does anyone know how to resolve this problem. Many thanks Simon ...

MFC Automation :- Microsoft Word using Application Pointer
I have included the msword9.h however it returns after executing the line if(pIUnk->QueryInterface(IID_IX, (void **)&pUApp) != S_OK) Can any one please help me with this.. Source Code : void Print() { CoInitialize(NULL); IID IID_IX = {0x00020905, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}; IUnknown* pIUnk = NULL; _Application* pUApp = NULL; wchar_t szBuffer[] = L"Word.Application"; CLSID clsid; HRESULT hr = CLSIDFromProgID(szBuffer, &clsid); if(FAILED(hr)) { return; } hr = CoCreateInstance(clsid, NULL, CLSCTX_ALL , IID_IUnk...

Worksheet change event trapping in Excel
hi i have an excel sheet in which the cell A1 is getting data from a DD server. So this cell has a formula i.e. =edemo!tik!id0. I want t access this live changing data in my C# or VB program. Now i want to trap the sheet change event of this excel sheet in m C#orVB program. Im using sheet_change event handler. But sheet change event doesnt repsond if the cell is changed due to formula. i am succesfully able to trap this event if cell is change manually, but not if the cell has some DDE formula. how can i get live changing values of that cell in my program usin sheet_change handler? or is...

how do I create a calendar event that repeats every 28 days?
It appears that calendar will only allow reccurring appointments daily weekly monthly but no custom option. I want to place a reccurring event every 28 days is this posible? "jaxonian" <jaxonian@discussions.microsoft.com> wrote in message news:17A633D5-F90E-434D-A535-C32E52E3079A@microsoft.com... > It appears that calendar will only allow reccurring appointments daily > weekly > monthly but no custom option. I want to place a reccurring event every 28 > days is this posible? Recurrence= Daily and type 28 in the "every X day(s)" box.. ...

MFC Extension DLL #3
Hi, I have a dll, which i want to display a dialog. so i go: DlgClass dlg; dlg.DoModal(); However it always crashes on the DoModal() line. DlgClass hWnd = 0x0000000 And it crashes at HINSTANCE hInst = AfxGetResourceHandle(); with the DoModal() call. Any ideas? On Sep 24, 11:16 am, hamishd <Hamish.D...@gmail.com> wrote: > Hi, I have a dll, which i want to display a dialog. > > so i go: > DlgClass dlg; > dlg.DoModal(); > > However it always crashes on the DoModal() line. > DlgClass hWnd = 0x0000000 > And it crashes at HINSTANCE hInst = AfxGetResourceH...

public folder Logon error with event ID 1024
I'm getting following error whenever I tries to access PF tree through ESM on Exchange 2003 EE SP2. -- Event Type: Error Event Source: MSExchangeIS Public Store Event Category: Logons Event ID: 1024 Date: 8/2/2006 Time: 1:18:55 PM User: N/A Computer: FOE Description: FOE\IUSR_FOE was unable to log on as FOE\IUSR_FOE to the Public Folder Store "First Storage Group\Public Folder Store (FOE)". For more information, click http://www.microsoft.com/contentredirect.asp. -- Same error is logged when I'm on another exchange server and connect to PF tree on this server FOE. ...

Which MFC Collection should I have to use
I have a file with this format.I want to use either MFC collection classes after reading this file and store in Maps to have a key value pair. The problem with this file is Header 1 and Header 2 are different but keys are same for both headers.Which MFC class would I have to use so that by passing (header ,key,value) the value should be returned. I have gone CMapStringToString but it take unique key values. Any ideas do share with me.Thanks in advance.Your response is much appreciated ............................File Format..................... Header 1 Key1=Value1 Key2=Value2 Key3=Value3 Ke...

Preventing immediate exit of MFC app
This is a multi-part message in MIME format. ------=_NextPart_000_000E_01C6233F.2F35E1D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable We'd like to have an app that is currently an MFC app be able to take = some command line parameters (like /SILENT), do its processing without = displaying any dialogs, and returning a return code to the shell. With = MFC apps, though, when the program is run from the command line, it = launches and returns to the command line immediately. Is there some way to have the MFC app block until the work ...

Win32 DLL def file question
Hi How can we export Win32 dll functions for dynamically LoadLibrary and GetProceeAddress ? I see VS MFC DLL project has a def file but Win32 DLL does not have one, should we add a def file to VS Win32 DLL project , how can I do that ? Thank you . This will be helpful: http://msdn.microsoft.com/en-us/library/d91k01sh(VS.80).aspx -- Ajay "Kid" <Kid@discussions.microsoft.com> wrote in message news:DBBF8564-3F78-4808-B826-A0186AB29CCC@microsoft.com... > Hi > > How can we export Win32 dll functions for dynamically LoadLibrary and > GetProceeAddress ? > &...

Generate Controls Dynamically,FormView-Scroll,Default,MFC
Hai I am looking to generate Edit controls Dynamically in a FormView and when the no of edit controls increases the Size Of the Horizantal ScrollBar increeases and should be able to scroll and is there any other way of doing other that "SetScrollSizes" as i want the FormView to handle that scrolling and not forcibly Thanks and Regards suresh suresh at his best wrote: > Hai > I am looking to generate Edit controls Dynamically in a FormView and when > the no of edit ...

Cannot find analys32.dll
I am running one of the training programs for XML on the MS web. When down loading one of the training files I get the follow error: "Cannot find analys32.xll. Run setup to install ToolPak." The url of the training is http://office.microsoft.com/training/training.aspx?AssetID=RP011304671033&CTT=6&Origin=RP011304921033 ToolPak is installed and analys32.xll resides on my computer. I have uninstalled and reinstalled TookPak, ran Repair from setup on the CD and uninstalled and reinstalled Excel all to no avail. I need to complete the XML training ASAP so that I can...

Importing SunOne Calendar Events?
Anyone have luck importing SunOne Calendar items? Our method seems to import them but then they end up with features greyed out if you want to modify them. Thanks ...

error PRJ0019: A tool returned an error code from "Performing Post-Build Event..."
Hi, I am getting this error error PRJ0019: A tool returned an error code from "Performing Post- Build Event..." Not sure how to get rid of it. Can anyone please help? I am not sure what more info you will need to help me? Please let me know Thanks TS On Aug 12, 10:33=A0pm, Trups <Samant.Tru...@gmail.com> wrote: > Hi, > > =A0 I am getting this error > =A0error PRJ0019: A tool returned an error code from "Performing Post- > Build Event..." > Not sure how to get rid of it. =A0 Can anyone please help? =A0I am not > sure what more info you will...

Cloning a View in Dialog-based MFC Program, part 2
I've created a toolbar button fort he cloning operation and the function it calls invokes a constructor for a new view. Using the debugger I can see that this new view has all of the right data ... but it has no window! What's my next step? TIA Norm I dont know the context of your action but make sure that you make the view and its parent frame are both visible. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "Norm Dresner" <ndrez@att.net> wrote in message news:Ex45b.125557$3o3.8831281@bgtnsc05-news.ops.worldnet.att.net... > I've created a toolbar butt...

Adding MFC support to a VS2003 project
Hi, I have created a SolidWorks addin in VC++2003. This has ATL COM support. I also want to provide MFC support. Have tried to change the MFC settings in project properties, but this does not work. Any way to do this? On 18 May 2007 06:59:00 -0700, malcolm.carvalho@gmail.com wrote: >I have created a SolidWorks addin in VC++2003. This has ATL COM >support. I also want to provide MFC support. Have tried to change the >MFC settings in project properties, but this does not work. What does not work? What error(s) do you have? MrAsm I've found that it's usually easier to crea...

how to replace the "new" and "delete" operator funtion define in mfc.
I am trying to overload the global new and delelte operator function in order to use my own memory allocation mechanism.Every time i do it smoothly until i get to a MFC project. The problem is that there are already a set of new and delete operator function defined in afxmem.cpp of MFC. While i'm trying to replace them with my own,the new operator call the MFC's operator new function and call my operator delete function.This is a surelost. How can i replace them completely? Booker, Best regards. It is strongly recommended that you do not overload operator new/delete....

help with a DLL open file problem!!!
I use MFC to build an COM and it used stdio file to open and write to a file, howeever, it used to run OK on all machines, now we put it on one clinet's machine, the problem is: it can't return the file. I make the code as simple as CStdioFile file; if (file.Open(_T("C:\\DLL.log"), CFile::typeText|CFile::modeCreate|CFile::modeWrite|CFile::modeNoTruncate)) { file.SeekToEnd(); file.WriteString("Before registration!"); file.WriteString("\n"); file.Close(); } *nRes=1; return S_OK; This to test, but the function doesn't return anything. Anyone can he...

DHCPServer Event ID: 1017 & 1010 during backup
I have got two errors during backup. Chcaking C:\WINDOWS\system32\dhcp folder has got full perimssions. Any idea ? Event Type: Error Event Source: DhcpServer Event Category: None Event ID: 1017 Date: 24/05/2010 Time: 21:23:55 User: N/A Computer: TITAN Description: The DHCP service encountered the following error when backing up the registry configuration: Access is denied. Event Type: Error Event Source: DhcpServer Event Category: None Event ID: 1010 Date: 24/05/2010 Time: 21:23:56 User: N/A Computer: TITAN Description: The DHCP service encoun...

Calling Workflow From the onLoad event of the form
Hello I am working with Crm3.0 and want to know that Is there any way we can call workflow from the form's onload event. Thanks in Advance. Regards -- Jaber This link should help you out. It's invaluable: http://blogs.infinite-x.net/2007/06/15/launching-a-workflow-rule-from-javascript/ HTH "Jaber" wrote: > Hello > I am working with Crm3.0 and want to know that Is there any way we can call > workflow from the form's onload event. > Thanks in Advance. > Regards > -- > Jaber Thanks MD Just the blog is really invaluable. Thanks -- Jaber "M...

Use Scheuled Tasks to fire Event Code
I did a little searching and didn't find much on this one. Can I use Scheduled Tasks to run a snippet of code, which is a private sub, behind a sheet? If so? How is it done? Thanks, Ryan-- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. I've used Scheduled Tasks to open a workbook and run the code in the "ThisWOrkbook" module as Workbook_Open. You may have to self sign the code so that it opens without the "Enable Macros" prompt. -- HTH, Barb Reinhardt "ryguy7272" w...

Event ID 3010 : Exchange 5.5 server not routing inbound mail properly...
We have an Exchange 5.5 server and have around 8 different email domains all set up as valid inbound email domains using the IMC routing tab. Most users can connect up to our email server and send an email to someone in their same domain, or someone in one of the other 7 domains hosted on our server without any difficulty. Sometimes however users will get a bounced message back stating that the message wasn't sent to the user as the host was unreachable. When I check Event Viewer on the server I see an Event ID 3010 "An attempt to connect to host "domain.com" failed. Do I...

NAND Flash driver : flashmdd.dll and PDD don't load
Hello, I have a NAND Flash driver developed with MDD/PDD architecture. I have the following registry settings : [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\NAND_Flash] ; @CESYSGEN IF FILESYS_FSREGHIVE "Flags"=dword:1000 ; @CESYSGEN ENDIF FILESYS_FSREGHIVE ;"Dll"="nandfmd.dll" "Dll"="flashmdd.dll" "FlashPddDll"="nandfmd.dll" "Prefix"="DSK" "Profile"="FlashDisk" "IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}" "Fri...

Event sevice and information store hang
Hello NG! On my Exchange 2003 SP2 at a SBS 2003 machine the event service hangs during shutdown the machine with the following message: MSExchangeES ID: 7 (0x80004005) unexpected error in maintenance thread I�ve checked MS-Kb but cannot find anything. Can anybody help? Thank you! Holger Hello 4005 is the system error 5 (access denied). Have you configured some scripts on events (like Event sinks)? If you use no scripts, the service MsExchangeES can be set to "manual". Bye. -- Thierry DEMAN-BARCELÒ MVP Exchange,SQL/Server FAQ Exchange: http://ofniorcim.dyndns.org...

Outlook 2000 displays (Holidays and reoccurring events) across two days
Has anyone else had a problem with Outlook 2000 displaying holidays and reoccurring events across two days. i.e. Tax Day is displayed on April 14 - 15th. The same thing holds true for all holidays from April - October. The problem seems to correct itself in the other months. Any help would be appreciated I had same problem and solved by going to Windows' "Adjust Date/Time", Time Zone Tab, and choosing "automatically adjust clock for daylight saving changes." ...

WM_INPUTLANGCHANGEREQUEST and MFC
Hi, I am working on French Localization for a program. The code is written in MFC using SBC (Single Byte Code). To detect locale changes I have written handlers for trapping the following messages: WM_INPUTLANGCHANGE WM_INPUTLANGCHANGEREQUEST However the MFC code is not able to route this message to the handler functions. Is there anything specific that I have to do to handle these windows messages in MFC? I have have checked using SPY that my window does get the messages: WM_INPUTLANGCHANGE WM_INPUTLANGCHANGEREQUEST A workaroud to this problem is to subclas...