|
COM event is implemented through call back interface,the client is responsible for the creation of the interface which is also called event sink.
when COM server fires a event,the server searchs event map array to find corresponding event entry, if the server find event response function implemented by client,then the event is processed.
So,as you see, there is no event queue.If your server
is a single thread application,the server will not continue until the client has finished the processing of the event.
If you want to be a great programmer,then never stoplearning
|
|
|
|
|
But: What happens if the COM Server is not running in the same thread? Maybe even not within the same process?
The server will continue to fire events but the client is not able to process fast enough? Who´s responsible to "store" the events fired from the server?
Or are these events lost when the server fires and the client is not ready to process it?
|
|
|
|
|
My leader wants us to developpe a COM architecture without using connection points to perform communication between different objects. He things that connection point are not absolutely necessary to fire each other about some event so we won't use them. After all, he says, some other mechanism do exist to perform the same functionnalities like "windows messages" or "named pipes"...
But I don't understand the utility to "not use" a dedicated service provided by COM. I thing that the tools provided by COM or DCOM (a part of the app will run on another machine) are useful to avoid developping myself such a communication mechanism.
Could anyone give me some arguments to choose ?
|
|
|
|
|
I am building a data structure as a .dll file using COM since I want to access it from VB. The data structure is made up of multiple nested structures each of which I have built using an ATL object. Now I want to aggregate those objects so that the interfaces of all the inner objects are available via a single outer object. I followed all the steps in the book COM and ATL 3.0 by Andrew Troelsen. But I am only able to access the interface that is declared as [default] in the .idl file.
PLEASE HELP. This has me in tears, literally!!!
Regards
Prashant
|
|
|
|
|
Hi ,
Use the OLE data types. And define structre in idl/odl like:-
typedef
[
uuid(AAFBADE2-63FE-465B-BCAF-28990FB6C20C),
version(1.0),
helpstring("User Data Type")
]
struct UDTVariable {
[helpstring("Special case variant")] VARIANT Special;
[helpstring("Name of the variable")] BSTR Name;
[helpstring("Value of the variable")] long Value;
} UDTVariable;
And add the structure name in
library TESTATLOBJLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
struct UDTVariable;
[
uuid(9033744D-D0EB-42AB-89BB-5F950790F9E4),
helpstring("UserData Class")
]
}
and it work properly.
For more infromation pls go below link
"http://www.codeproject.com/atl/udtdemo.asp"
Anuj
|
|
|
|
|
I had a problem while adding a popup menu to Word. The popup menu is being added to Word and is not removing after closing the Word (even if I made the Menu item to TEMPORARY). One new popup menu is being added every time I open the MS Word. The same case with menu item.
please help to solve this.
Here below my code:
CComVariant varType(10);
CComVariant vtEmpty(DISP_E_PARAMNOTFOUND, VT_ERROR);
CComVariant vtTemp(VARIANT_TRUE);
CComVariant vtBefore(nMenuIndex);
// Adding the new menubar
CComPtr<commandbarcontrol> spCtrl;
spCtrl = spCtrls->Add(varType, vtEmpty, vtEmpty, vtBefore, vtTemp);
ATLASSERT(spCtrl);
CComQIPtr< Office2000::CommandBarPopup > spPopup(spCtrl->GetControl());
ATLASSERT(spPopup);
// Setting the new menubar properties
spPopup->PutCaption(OLESTR("&Templates"));
spPopup->PutVisible(VARIANT_TRUE);
// now add a menubar to the menubar
CComPtr<office2000::commandbarcontrols> spCmdBarCtrls;
spCmdBarCtrls = spPopup->GetControls();
|
|
|
|
|
i have written a simple chat application with some utils but it just
works locally. Although i can access with my ip adress from local, my friend can not connect my server app from home. I think it is about security rules
of WinXP professional. And of course maybe is not. How can i make it available to myfriend?;P
C U SOON
C U SOON
|
|
|
|
|
Do your computer run behind a router?if so,you must configure the router to open the ports needed by your application
If you want to be a great programmer,then never stoplearning
|
|
|
|
|
yes that might be the problem.
but i don t know how to configure it.
Nat - Wan - Adsl -.....
Where is this configuration ????*
C U SOON
|
|
|
|
|
currently, i try to have a list control (for logging message purpose) where it will highlight the entire row with red if it carry out error information. else, it will just highlight the entire row with green.
The Michael Dunn' s article on custom draw give me a good information:
http://www.codeproject.com/listctrl/lvcustomdraw.asp
However, I need some mechanism so that in my custom draw message handler, I know whether this row carry out error information or not.
I try to do the following approach. I use the lParam to store whether that row is error information row.
In the method which i insert item, I have
LVITEM lvi;
lvi.lParam = ERROR_INFORMATION;
Then, in my custom draw message handler, I do the following
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<nmlvcustomdraw*>( pNMHDR );
// this is error message
//
if(pLVCD->nmcd.lItemlParam == ERROR_INFORMATION)
However, this approach just wont work. The lParam value I get in the custom draw message handler, isn't same as the lParam value I put in the insert item method.
Can anyone advice me how should my implementation be?
Thanks.
cheok
|
|
|
|
|
Hi,
I am registering a standalone (out-of-process) COM server (exe developed in VB 6) manually using the '/regserver' switch. Upon registration, I am able to see the Class ID and other registry information in OLE viewer. However, I am unable to create an instance of the server in OLE viewer (or via external code). I am getting the following error message (in OLE viewer):
IClassFactory::CreateInstance failed
No system message defined <severity>: SEVERITY_ERROR facility: <unknown facility=""> ($800A01AE)
As you can see the error message does not help much except providing an error code ($800A01AE). I have researched this error code to a significant extent and the best match for the error source is 'Class does not support automation or expected interface'. This comes from a single article on Microsoft support (Article ID : 244493), which is in the context of accessing COM objects from ASP (not the situation I am facing). Following are some investigation results that might help to isolate the source of the problem:
1> The COM registration/unregistration process seems to be working fine. I have done a detailed OLE viewer + registry search to come to this conclusion. Another means to support this statement is the fact that I have other similar COM servers, which are instantiating successfully and they have exactly similar information in the registry also showing up in OLE viewer.
2> The dependencies of the COM server in question are all correctly resolved.
A peculiar behavior is that I have a base system (Win2000 server), on which I have the COM server registered and instantiating successfully. The problem arises when I unregister the server and try to register it again. This is when things break. I am kind of a COM newbie so there may be angles that I do not appreciate. Any help in this regard is highly appreciated.
Regards,
Gautam.
|
|
|
|
|
Hi
I try to find some code for creating
a drop down menu for a IExplorer button e.g
the menu for The ShellView Visual Styles >> Thumbnails,
Tiles,Icons,List,Details .
I have a toolbar button via Registry and i have a COM Browser Helper Object
but i want to create the Dropdown menu to operate beter and set options for my
BHO.
Please help )
|
|
|
|
|
I am new to ActiveX. I just want to create s sample appln. I want to create an UI using activex control. Which contians a button called 'New Add' and a edit box called 'Name'.
How to create a dialog in MFCActivexControl wizard and this should be added in the MFC dialog.
In MFC dialog which contains a editbox namely 'Test', when the Add New button is pressed, the value in the 'name' edit box should be added to the 'Test' edit box of the mfc dialog.
Could any one tell me how to proceed this??
|
|
|
|
|
I have created a ActiveX component. I use IIS. It works well on my m/c, as the component is registerd on it, but doesn't work on other m/c's in the network. Who to register my ActiveX on other machins, when used with IE <object> tag.
And who to communicate with the server fron this ActiveX.
Plz help...
Thanx & Regards..
Vinod.
|
|
|
|
|
Hello,
I'm a junior developer trying to build a Windows client application using the Microsoft RTC API, and have encountered some problems when trying to pick up events generated by the RTC core. I have built the application upon a MFC "Hello world" application found in Visual Studio, and the Window and all events (messages) that I myself trigger work fine. The application crashes the first time I expect an event coming from the COM-object (which should be picked up by the Event method of the IRTCEventNotification-interface and "forwarded" to the Window using SendMessage with LPARAM, WPARAM, etc....)
The debugger is yielding the following output (when the application crashes):
Hello.exe!_com_ptr_t<_com_IIID<rtccorelib::irtcprofile2,&_guid_4b81f84e_bdc7_4184_9154_3cb2dd7917fb> >::_Release() Line 822 + 0xd C++
Hello.exe!_com_ptr_t<_com_IIID<rtccorelib::irtcprofile2,&_guid_4b81f84e_bdc7_4184_9154_3cb2dd7917fb> >::~_com_ptr_t<_com_IIID<rtccorelib::irtcprofile2,&_guid_4b81f84e_bdc7_4184_9154_3cb2dd7917fb> >() Line 306 C++
Hello.exe!CMainFrame::~CMainFrame() + 0x1a C++
Hello.exe!CMainFrame::`scalar deleting destructor'() + 0x14 C++
rtcdll.dll!6213ae21()
rtcdll.dll!621230da()
rtcdll.dll!621230b3()
rtcdll.dll!62126418()
rtcdll.dll!6212a0de()
user32.dll!77d38734()
user32.dll!77d38816()
user32.dll!77d3c63f()
user32.dll!77d3e905()
mfc71d.dll!_AfxActivationWndProc(HWND__ * hWnd=0x00050f86, unsigned int nMsg=1131, unsigned int wParam=10, long lParam=16294216) Line 449 + 0x1a C++
user32.dll!77d38734()
user32.dll!77d38816()
ntdll.dll!7c90eae3()
user32.dll!77d389cd()
user32.dll!77d385a4()
user32.dll!77d38a10()
user32.dll!77d4e2b9()
user32.dll!77d461c6()
user32.dll!77d5a92e()
ntdll.dll!7c96e0d4()
ntdll.dll!7c94a5d0()
ntdll.dll!7c926abe()
ntdll.dll!7c926a44()
ntdll.dll!7c926abe()
ntdll.dll!7c926abe()
ntdll.dll!7c9268ad()
ntdll.dll!7c91056d()
ntdll.dll!7c95db5c()
ntdll.dll!7c926abe()
ntdll.dll!7c9268ad()
ntdll.dll!7c91056d()
ntdll.dll!7c91b686()
ntdll.dll!7c91b298()
ntdll.dll!7c9106eb()
ntdll.dll!7c960bcc()
ntdll.dll!7c915b4f()
oleaut32.dll!77114885()
ntdll.dll!7c915b4f()
ntdll.dll!7c91056d()
msvcr71d.dll!_free_base(void * pBlock=0x0012fb2c) Line 103 C
user32.dll!77d5a294()
Hello.exe!_bstr_t::Data_t::`scalar deleting destructor'() + 0x25 C++
Hello.exe!_bstr_t::Data_t::Release() Line 681 + 0x1c C++
Hello.exe!_bstr_t::_Free() Line 571 C++
0015ce50()
user32.dll!77d86060()
ntdll.dll!7c915b4f()
user32.dll!77d70577()
user32.dll!77d7052f()
mfc71d.dll!CWnd::MessageBoxA(const char * lpszText=0x0042ab10, const char * lpszCaption=0x0042aa6c, unsigned int nType=0) Line 2711 + 0x1b C++
Hello.exe!CMainFrame::DoGetProfile(unsigned short * bstrUserAccount=0x0015e634, unsigned short * bstrUserPassword=0x0015e704, unsigned short * bstrURI=0x0015e5dc, unsigned short * bstrServer=0x0015e66c, unsigned short * bstrTransport=0x00000000) Line 138 + 0x14 C++
Hello.exe!CMainFrame::Initialize() Line 96 C++
Hello.exe!CTheApp::InitInstance() Line 119 C++
mfc71d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00141f4e, int nCmdShow=1) Line 39 + 0xb C++
Hello.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00141f4e, int nCmdShow=1) Line 25 C++
Hello.exe!WinMainCRTStartup() Line 390 + 0x39 C
kernel32.dll!7c816d4f()
ntdll.dll!7c915b4f()
kernel32.dll!7c8399f3()
Any help to understand what's going on will be greatly appreciated
|
|
|
|
|
I have just started ActiveX programming. Can anyone tell me how to Create ActiveX control on a Simple SDI application. Syntax for the Create() function.
Also names of good ActiveX Programming Books.
|
|
|
|
|
Hi Gajesh,
CoCreateInstance(...) is the API to create an activex control on window.
Syntax:
STDAPI CoCreateInstance(
REFCLSID rclsid,
LPUNKNOWN pUnkOuter,
DWORD dwClsContext,
REFIID riid,
LPVOID * ppv
);
For detailed description of parameters pls. refer to the MSDN.
k once you have successfully created the COM object, you would recive a
interface pointer. Now query this pointer for IOleObject, now using
IOleObject::DoVerb(...) you can see the control.
Well this is the way I used to create the activex control on window. Some
one might have other way TODO same thing.
To start learning COM, Activex following are some good books
Essentil COM
-Don Box
Inside COM
-Dale Rogerson
You can get a tons of information on online MSDN....
All the best !
Cheers,
Vishal
|
|
|
|
|
I have used a mschart component in my form,
but I have no idea how to use the my customised image to replace the background color of bars.
Thanks
|
|
|
|
|
Good Morning,
How can i enable IE to show my custom image format in it's window? IE supports by default some image types like BMP, JPG, GIF etc. How can i register my own file type in this default type list?
Thanks in advance.
|
|
|
|
|
Yes, you can open your custom files in IE. For that you need to do the file
association, its just the matter of some registry entries.
But if your images having custom format, then there must be some native application which can recognise your image format. Do you have somthing like this application?
All the best !
Cheers,
Vishal
|
|
|
|
|
Yes, I already have an application that decodes this custom format and a shell extension too. Can you help with the registry keys?
Kind regards.
Pantelis Georgiadis
|
|
|
|
|
You have to set the MIME filter for that.
Insert content type entries
HKEY_CLASSES_ROOT
-MIME
-Database
-Content Type
-application/vnd.app.ext
-CLSID - CLSID for your application
-Extension - Extension of your image files
Entries for extension
-.ext
-ProgID
Entries for ProgID
-ProgID
-DefaultIcon
-Shell
-Open
-Command - C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE %1
This much I can remember...
This all information is available on online MSDN, unfortunatly I lost the
link for that, you can get the link from online MSSN. It would take some time
to search, well I had one unsuccessful attempt. If you get that link pls.
fwd it to me.
You can take a reference from the MFC sample active document container/server. See how this application is making the registry entries.
Hope this helps you !
All the best !
Cheers,
Vishal
|
|
|
|
|
|
Hi,
I've an ActiveX control (.OCX) written in VC++ 6.0.
I am trying to use this control in C# Web Service - but everytime I invoke any of ActiveX method the service fails.
I wrote another small Windows-Application in C# to test if I can access ActiveX in C#...
Now the only problem is when I try to access ActiveX from C# Web Service.
Any help?
Thanks!
|
|
|
|
|
Hi,
I am new to COM. I just started learning the COM. Its interesting. I am learning from "Inside COM" book. I just want to be a COM programmer. So do i need to learn all COM stuffs. I read till ClassFactory and little abt Containment and Aggregation.
Do I need to learn all the other cocepts to be a good programmer like IDispath,Monikers(its not given in this book) and other threading concepts and even Aggregation in detail.
could anyone guide me on this regard?
Also I want to learn ATL too. I have done projects in ATL too. But want to be good prgmer in that too.
|
|
|
|