Can I get any sample of how to write a COM component which should be accessible from JScript.
Actually , I am able to write a normal COM (InProc) component and able to invoke from other c++ client. But while trying the same from JScript , unable to invoke it.
I am getting error like automation server cannot create object etc.
As mentioned by cariolihome only interface inherited from IDispatch can be access by scripting clients. Additionally, only the default interface marked in the IDL using the [default] attribute inside coclass can be accessed by scripting clients.
«_Superman_» I love work. It gives me something to do between weekends.
HRESULT hr = ::CLSIDFromProgID(L"EmbeddedLink.Document", &classId);
if (hr == S_OK)
// Get the OLE client site from the container
hr = pIRichEditOle->GetClientSite(&pIOleClientSite);
if (hr != S_OK)
// Get storage from the container
hr = m_pIRichEditOleCallback->GetNewStorage(&pIStorage);
if (hr != S_OK)
// Create an OLE object i.e. the embedded item
hr = ::OleCreate(
if (hr != S_OK)
CDataObject *pDataObject = new CDataObject;
hr = pIOleObject->InitFromData(pDataObject, 0, 0);
if (hr != S_OK)
When I stream out the RTF, it looks great, with embedded objects as expected. When I stream the RTF into a new object of the CReportEditCtrl class, the objects are displayed in the new control, but when I look at process explorer, the mini-server is not running. When I stream out the RTF, each embeddeded object has gone, and has been replaced by its metafile, allowing it to be drawn, but all knowledge of the object has gone. What it going on? It looks as if the CRichEditCtrl instance has not loaded the embedded obejcts when the RTF data was streamed in. I thought the CRichEditCtrl was supposed to handle loading RTF containing embedded objects?
Incidentally, I get the same result with only one CReportEditCtrl instance if I stream out the RTF, stream it back in, and then stream it out again. The embedded objects are lost.
I modified the code so that immediately after streaming data from the RTF file into the rich edit control, it streamed it out from the rich edit control into a second file. The output RTF file is not the same as the original. The embedded Windows Media File object is present in the output file. The other embedded objects are not present, and instead there is a metafile in place of each.
Anyone any idea why some objects streamed out into the RTF file are present only as metafiles?
Okay, I have solved the problem in this post, if not the main problem. The example code contains an RTF with 4 embedded objects including one GIF. Of the non GIF objects, only one corresponds to an OLE server that is registered on my PC. So it seems that if the rich edit control is fed objects for OLE servers which are not registered, it discard all but the metafile so they can be drawn, but nothing more.
Never mind. I found a far simpler solution was to represent a link as protected text, ensuring the user could not edit it, but could see the link as simple text. Unfortunately using OLE objects would have meant one application running per link, which is inefficient and, well not good.
I develope an addon based on MotleyFool; example. User must do login to that, for using its functionality. In IE 8 when adding new tab or opening new IE window, new login is need. This occures beacause new instance of this addon creates.
How I can share any instance between multiple tab or multiple IE win?
You can use Mutex to check the instance of your addon. After the first time authentication save the status to authenticated in an INI file or in Registry. Check the mutex in each tab for get the status(Any instance is there) of your addon. If your addon is running then check the Authentication status. if authenticated from one of the tabs then login directly without user inputs.
I hope it will help you to over come the existing problem
Values that come - commented out. What am I doing wrong? Why not this work? How can I solve this problem?
In handler DISPID_NEWWINDOW3 event comes value URL of the new windows, but don't comes other values needed for navigate2, therefore, this solution does not suit me.
Ok!I'll try it!But here anothere question bubbles up : is it a way to use my COM object in my Silverlight application(will it rise Security exceptions)?
p.s. Thx for quick answer on my previous question
I have made an ocx . It includes the Winsock and the Timer controls . But the problem is that when I try to use the ocx in the application on some other computer the application gives error about the using the correct version of the OCX. Now when I place the ".ctl" file along with the ocx , it works fine . Now It is really annoying as i have to install complete visual basic setup on the client PC so that ".ctl" file works with ocx as app does not run only on vb runtime. Please suggest the solution.
I remember when using VB6 it had a thing about increasing the version number at the slightest opportunity. Maybe this is the same problem? I seem to remember an option in the object to stick with a particular version, pointing the settings at a Version Compatible Component to make this happen comes to mind.
You can also use the option of RemoteServer present in the Project properties tab . Vb makes the vbr file which can be accesible by the remote machine . the option is useful if you have made the ocx or active x exe projects