|
I have a COM collection object that maintains two STL containers. While it is unlikely, it is possible that an exception will be thrown while the containers are out of sync. In a normal application, I would simply abort under those conditions. What should an in process COM server do if such a fatal error occurs?
Nathan
|
|
|
|
|
Nathan,
Usually, Exceptions in COM server shouldn't bubble up. Since it's an inproc server, aborting would terminate your client application. I don't know any solution that I have implemented but does any of the following help you device a framework -
1. Supporting ISupportErrorInfo for rich error information and your methods could fail with some HRESULT. Client is expected to take necessary action.
2. Not a good one, but if these are internal error and assuming there is no method call in progress, you could implement an event handler and notify client of this exception.
Just back from work so can't think of any more solutions
Let me know if this helps.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Thanks! That's about what I thought. From what I've read, E_UNEXPECTED is intended for that sort of thing.
Nathan
|
|
|
|
|
Yes. by HRESULT I meant E_UNEXPECTED in this case, but you may want to specialize this error code if required.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hello all
I'm trying to use activeX to write a web interface for my application.
Does anyone know where to start to learn how to write activeX controls using C/C++ without ATL or MFC but accessing it from scratch.
Or can anyone recommend any good books?
thx
Bmbsage
|
|
|
|
|
Ask to Jeff Glatt [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I just want to make a software that needs some calculations and waveform plot in matlab 7...
I have written the required .m files and using the combuilder of matlab 7 to generate the com files to be used in VB .Net. but after compilation in VB .Net the generated stand alone exe file still needs the MATLAB RUNTIME LIBRARY. Is there any possible way to make it independent of The MATLAB And its Run time library....
if I compile the .m file to generate .exe file using matlab... then also the dependency remains...
plz tell me how this can be solved.....
Thank You.......
@rish
|
|
|
|
|
You cant because the way COM operates. The matlab Client (COM VB Object) will allways referenciate to a Matlab Server. Maybe you can connect to a Matlab Server in another Machine but you will always depend on the runtime libraries because the server needs them.
JO
|
|
|
|
|
Hey everyone!
I'm not sure if this is the right place, but I'm having some issues trying to debug a managed application invoking a COM server.
When I attach the native debugger, the modules window of visual studio tells me that there are no symbols loaded for my interop assembly (Interop.xxx.dll). It fails to load xxx.pdb, which I can understand. However, I have no idea how I have to generate the symbols. I've tried looking in the usage of tlbimp, but no such luck.
Any pointers on this?
|
|
|
|
|
|
Hey Sohail, thanks for the quick reply. However, I think this is not what I need, as the dll I'm using is one of my own, and not one provided by Windows. I have the debugging symbols of the original dll, but they won't work with the interop dll I've generated with tlbimp (it complains when I try to load it in the modules view). Do I have to use the original pdb or is there a way to generate one from the interop dll?
|
|
|
|
|
|
Hello Friends,
The issue is given below:
I want to connect skype with outlook following way.
There will be an Outlook Addin(Dialog) with a button named "PHONE".The dialog contains information of the specified user(sender of the selected message in inbox)including Phone number.
How can I setup a call when clicking the "PHONE" button. And i should able to talk with him.
so thing is i need not to enter the phone number through my phone button.
if anyone having some idea over this then plz send it to me i will appreciate it.
very urgent .....
please help me.....
regards,
Sivan Manimala
|
|
|
|
|
Skype application would provide some interface to do that - possibly like some COM interface that client applications can use. http://developer.skype.com/[^] might help.
Sivan Manimala wrote: very urgent .....
please help me.....
doesn't help in forums
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
As I am new to ATL/COM technology.I want to know more about this technology.So I want some basic ideas or projects along with details for a practise.by going through this I will get more idea about ATL/COM
shailesh
|
|
|
|
|
Create a simple Calculator component and try using it from C++, VBScript and C# clients
COM[^]
ATL[^]
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi
I have a web application that generates a HTML document. I need to export it to Word and Outlook and add an image logo in the top corner, but come across problems in both exports.
Creating a *.msg is fairly easy, as it accepts HTML as body of the message, but I don't know how to add the image. Can I simply add it as an attachment and reference to it in the HTML (I've seen it done this with the .NET class MailMessage)? Also, I know that when the application is run outside the development envirement (stand-alone on IIS), it will be denied access to the Outlook Library - is there a workaround for this, or is it simply not possible to use this library on server side?
As for Word document - I managed to fix the image where it's supposed to be, but I don't know how to insert the HTML, as every solution I found on Google ended up displaying the HTML tags, rather that interpreting them.
Or is there another way to do this? I tried to create an *.eml file and save it as *.doc, but some of HTML parameters (ie width) are messed up when I open the file in Word.
Thanks in advance
-- modified at 8:13 Thursday 22nd November, 2007
EDIT: I found something called HTMLDivision - can anyone tell me what it is?
|
|
|
|
|
Frustrated by the process of debugging a COM Automation client over ADO and MSHTML in native Visual C++, I've devised COMWatch - a debugger visualizer for COM objects under native VC++. With COMWatch in place, one can see the contents (i. e. properties and collections) of your typical IDispatch-based object right in the Watch window, like the VB folks are used to. You can see the full object's content or drill down to a specific member, no matter how deep down the object hierachy.
COMWatch works by injecting some code in the project that would dump the object contents in the way the debugger can display it in the proper tree-like format. Given the call-driven nature of Automation, there's no good way to make visualization logic completely debugger-based.
COMWatch is free; you can grab it at http://sevaa.home.sprynet.com/comwatch/ . Enjoy.
Visual Studio .NET 2005 only.
|
|
|
|
|
Hey guys,
I'm having a very strange problem with my windows service and a COM component. I have a wrapper class (which is a user control) that instantiates the OCX and adds some functionality (reverse geocoding) to it. If I instantiate the wrapper class during the OnStart event of the windows service, everything works fine. But, if I create a new instance of the wrapper class outside of this event (after the service has started), the services freezes at the line
((System.ComponentModel.ISupportInitialize)(this.axMapPro1)).EndInit();. The wrapper class works perfectly in my windows forms application.
I have no idea what could be causing this, as I'm not an expert on COM interoperability. Any of you geniouses out there have any bright ideas?
Mike
|
|
|
|
|
If its VB.NET code, try adding DoEvent before ((System.ComponentModel.ISupportInitialize)(this.axMapPro1)).EndInit()
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
It is C# code - what is DoEvent?
Sohail Kadiwala wrote: If its VB.NET code, try adding DoEvent before ((System.ComponentModel.ISupportInitialize)(this.axMapPro1)).EndInit()
|
|
|
|
|
I tried calling System.Windows.Forms.Application.DoEvents() before I call EndInit(), but am still experiencing the same problem. Any other ideas?
|
|
|
|
|
Try a loop.
Do<br />
Application.DoEvents()<br />
Loop Until < timedelay >
Try experimenting with TimeDelay and see if this fixes your problem.
Also attach a debugger and see where it hangs.
What OS are you using?
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I am facing a problem in calling CreateDisptach for any Class ID
Here's a brief summary of wat m trying to do
I create classes from a type library.... by using ClassWizard in VC++6.0 ,say of Excel, using the Excel.odl/Excel.exe file(2002 onwards)...
Now I get a class _Application....then I hve the following very simple code:
_Application app; // app is the Excel _Application object
if(!app.CreateDispatch("Excel.Application"))
{
AfxMessageBox("Error creating Dispatch");
}
Now...the program fails on this CreateDispatch always for any prog ID ..even if its not "Excel.Application".... Inside the 'CreateDispatch' function....the 'CoCreateInstance' function returns 'REGDB_E_CLASSNOTREG' as an error....
If I create the same automation object using VB then it works fine...also the same VC++ code works on any other mahcine...
I've called AfxOleInit() in InitInstance() ...its a dialog based mfc app
So I need help here... Wat is causing the code to fail on my machine ??
Thanks in advance
-- modified at 3:52 Tuesday 20th November, 2007
...A Programmer may or may not be the master of the programming language grammar...
|
|
|
|
|
AbbyIndian wrote: ...also the same VC++ code works on any other mahcine...
Is the code working(when placed in other application) or the application itself is working on other machine?
AbbyIndian wrote: 'CoCreateInstance' function returns 'REGDB_E_CLASSNOTREG' as an error
Check your registry for Excel.Application prog id and the corresponding CLSID.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|