|
|
Can any one suggest a good book on COM I do not want that it should cover C++ or object oriented concepts but directly into the com concepts with examples.
Please any one could suggest me a good book which they have probably read.
Nishant J jaiswal
|
|
|
|
|
Don Box' books are definitely the best in my opinion.
Essential COM
http://www.amazon.com/gp/product/0201634465/104-1873800-1887156?v=glance&n=283155&n=507846&s=books&v=glance
Effective COM
http://www.amazon.com/gp/product/0201379686/104-1873800-1887156?v=glance&n=283155&n=507846&s=books&v=glance
Carsten
|
|
|
|
|
Thank you Carsten for your help do you also know some ebook or material on the net which is on the same line
NJJ
|
|
|
|
|
I recommend you to have a look in the MSDN Library[^]
. There is a lot of information there.
And there are a lot of articles very helpful here in The Code Project. For example...
From Joao C. Morais -- All of them. The articles are a very good introduction to COM Architecture[^]
From Lim Bio Liong -- All of them are indispensables. Have a look in the Beginners section [^].
|
|
|
|
|
i want to use the numericupdown control in my application but it doesnt adopt the XP style look. it still has that old classic look even though the rest of the controls have the XP look. How do i so this. I'm sure it's possible becuase the numericupdown control is used in the date tim applet in the control panel having XP looks.
|
|
|
|
|
has anyone seen a project which allows a user to check for windows updates and then update windows.
|
|
|
|
|
I'm working on a web application, in ASP.NET C#, that uses both the Excel object on the server, as well as Crystal Reporting. In order to ensure that the account the web application is running under has access to the Excel object on the server, I set the <identity impersonate="true"> property in the Web.config file.
The problem is that this causes problems when running Crystal Reports. I was not involved with the reports, but as far as I understand the Crystal error is then 'Access is Denied' as it is when the <identity> tag is not in the Web.config file. For now, I have had to disabled the Excel functionality and removed the <identity> tag. I would like to know if there is anyway I could enable the impersonation for one specific page only, without compromising security too much, as clients aren't always happy with that. Or perhaps someone knows of another way around this?
I know that it is possible to set permissions through DCOM etc, but this will complicate implementation and is not desirable.
Thanks
Minette
|
|
|
|
|
HI All,
Here is the problem:
I have a simple COM server and it compiles and runs with
no errors:
X Code is OK
X Registry Checked OK
X Creates a DLL and TLB OK
Now on client's side:
#import <files> OK
I then created the smart pointers to my interfaces and no errors.
But it crashes when I try to access a funcion using the -> operator.
Then I tried it using raw COM and I get an HRESULT_CODE (505)
When debugging I can track the line below as
hr = CoCreateInstance(CLSID_CoCar, NULL, CLSCTX_INPROC_SERVER,
IID_ICreateCar, (void**)&pCCar);
I get this message: 0x800401f9 Error in the DLL
I have checked everything I could.. what am I missing.
I need some
|
|
|
|
|
Not much for the rest of us to go on here since the only information you provided is that everything is OK but you still get an error...
Try this:
1. Unreg your component(s)
2. Perform a 'clean' in each project involved
3. Remove all files that are created during the #import (.tli, .tlh)
4. Rebuild all
Post again if the above doesn't remove the error.
And provide some more info while you're at it...
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
Here is what I know so far...
The client fails to create my COM object and return an
unsuccessful HRESULT.
Back to my server: I cleaned iup, removed all registries, etc,
even created a new project alltogether.
I started my project with an "Empty Win32 DLL" base.
The only difference that I noticed from a copy running under VC6.0 is
that my _i.c and .h files carry the following header:
-----------------------------------------------------------------------------
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
/* link this file in with the server and any clients */
/* File created by MIDL compiler version 6.00.0347 */
/* at Thu Oct 20 10:00:32 2005
*/
/* Compiler settings for CarServerType.idl:
Os, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
#if !defined(_M_IA64) && !defined(_M_AMD64)
----------------------------------------------------------------
I can post the code if you wish
Thanks for your help
|
|
|
|
|
Cannot help you there since I'm not running VC7.
It might be interesting to try the server built with VC6 and run it with the client built with VC7 since as I understand it you don't know whether the error is caused by the server or the client.
BTW, is this problem linked with the problem you've described a few threads down[^]?
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
Somewhat linked.
I managed to get ahead with this:
I created a completely new server with different interface names
and new GUIDs under VC6.
I got it to work on my client's app as long as I make a call to
CoCreateInstance(). Also worked on my VC7 client.
The only thing (though I dont need to use) is that if I make a call
to the CF directly and the try to CreateInstance() it fails.
and it still doesnt work with wih _com_ptr_t<>.
Another curiosity:
Even though my server tlb and dll are registered and they work, when
I try to access the object using the OLE/COM View->All Objects it crashes
the utility program.
Other objects listed allow me to click on them and see the interfaces.
Not mine. but I am getting there little by little
Thanks again for your help
Odie
|
|
|
|
|
odiesback wrote: when
I try to access the object using the OLE/COM View->All Objects it crashes
the utility program.
This sounds like you have contaminated the registry with incorrect and/or obsolete information.
Does the viewer crash when you're expanding the leaf in the tree view, or does is crash when you select your server? Describe it some more.
Is it a new behaviour or has the viewer crashed whenever you've tried to browsing your COM servers?
However, it should be fairly certain that the error is connected to the server and not the client.
Try and search the registry for CLSID values, ProgIDs, TLIDs etc generated for your server(s).
First you may want to try to unregister your server and fire up the OLE/COM viewer again to verify that the "contaminating information" is still making the viewer crash. If not, then you know its in the information that gets registered with your current server.
Your first aim to shoot for would be not to crash the OLE/COM viewer while browsing/viewing your server and its type library.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
Hi Roger,
I started on a brand new lib and interfaces, coclasses, .idl etc.
I manage to trace the error to my DllGetClassObject() implementation
where I improved the code a little.
Then I created three clients: one using CoCreateObject(), the other using
CoGetClassObject()->CreateInstance() and lastly one using _com_ptr_t<>.
:-DALL WORKED GREAT
The only thing remaining:
On the OLE/COM Viewer now I can open my object under "All Object" (my constructor
MessageBox kicks in) but it shows me the "IUnknown" interface (It might be that
my reg file does not carry info for the other ifaces)
When I double click on my Type Lib icon I get this error:
LoadRegTypeLib({C3CA0811-45B1....},1,0,1033,...) failed.
Error loading type library/DLL
TYPE_E_CANTLOADLIBRARY($80029C4A)
Other than that all is fine (for now )
Thanks again
Odie
|
|
|
|
|
odiesback wrote: Other than that all is fine
That's nice to hear(read?!?)
Regarding your typelib...
Have you verified that the path to your typelib is correct?
Open the registry and have a look at the value of HKCR\CLSID\<yourserverclsid>\TypeLib and verify its existance. Open the typelib key under HKCR\TypeLib\YourTypeLib\1.0\0\win32 and verify that the path given in the default value is correct. If the path points out your server you have to verify that you have included the typelib information in the server.
In VC6 you do this by adding a 'TEXTINCLUDE 3' resource in the .rc file looking similar to 1 TYPELIB "server.tlb" . I suspect it would be same in VC7.
Any errors when you're building the typelib (MIDL compiler)?
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
Roger Stoltz wrote: Any errors when you're building the typelib (MIDL compiler)?
No, no erros there
Roger Stoltz wrote: HKCR\TypeLib\YourTypeLib\1.0\0\win32 and verify that the path given in the default value is correct
I had registered the .dll and changed to .tlb and WHOA!!!
My Type Lib icon opens great and displays my .idl and all
interfaces. (it made my day at 7:00am PST)
I will frame my code to the wall
Thanks for your time in helping me with this
Odie
|
|
|
|
|
How to get the right URL before navigating the web page in the CHtmlView?
Class CHTMLControl derived from CHtmlView, and over load the virtual function OnBeforeNavigate2.
I Navigate an URL as following:
CHTMLControl* pHTMLControl;
…
pHTMLControl->Navigate2(strURL);
In the opened web page, there is a link whose html code is below:
<A href='javascriptclickProcess("search");'>Free Search</A>
After clicking on this link in the html view, the following function is called
void CHTMLControl::OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTargetFrameName, CByteArray& baPostedData, LPCTSTR lpszHeaders, BOOL* pbCancel)
But in this function, the value of lpszURL is "javascriptclickProcess("search");"
How can I get the right URL of the next page before navigating it?
Thanks
|
|
|
|
|
Hi superhandwolf,
You can get the actual URL in the event "DocumentComplete", in your perticular
case it will search for the given text and then gives you the actual URL for
search result page...
If you try to get the URL in OnBeforeNavigate2(...) using the 1 param i.e.
IDisp. it would return you the current page's URL (i.e. page currently rendered
)
"DocumentComplete" OR "DownloadComplete" can give you the URL...
Cheers,
Vishal
-- modified at 6:19 Thursday 20th October, 2005
|
|
|
|
|
I am new to COM so which book is better to learn.
Thank you CodeProject
|
|
|
|
|
|
Perhaps more information on the nuts and bolts of how one actually *writes* this software may be helpful.. I have a step-by-step DCOM tutorial, where I build a simple server which says "Hello, world!" back to the client, may help put some of this in practical perspective...
The tutorials are written as a series of separate articles, called Steps, which cover the major breakpoints in the development of the system.
Step 1 of the tutorial for VC 6 is at
http://www.codeproject.com/com/HelloTutorial1.asp[^]
And Step 1 of the turtorial for Visual C++.NET 2003 is at
http://www.codeproject.com/useritems/HelloTutorial1NET.asp[^]
I tried to write the tutorials in Microsoft-ese, so you can follow along as if you were reading the Scribble tutorial. The VS.NET version is still a work in progress; that's why it's still in "Unedited User Constributions."
Not all the Steps have been written for the VS.NET version yet. But I am working on it!
Stay tuned!
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|
|
Hi,
How to Create DLL. Pls can u explain?
Thank you CodeProject
|
|
|
|
|
Hi,
Pls give me Answer this question.
What is TypeLibrary(tlb)? When it is used? why it is used?
Thank you CodeProject
|
|
|
|
|
Santosh Kumar79 wrote:
What is TypeLibrary(tlb)? When it is used? why it is used?
Please first try google before posting here... this willsave your lot of time
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|