|
I Got the idea.!!
As no any function(method) in interface which's implemented by COM object which's not virtual. All interface methods that implemented by COM component always pure virtaul, thus always go inside vtable. So we can easily traverse vtable and can get exact addresses of all of those. Now rest is calling those functions. It includes knowing about full signature and every thing it takes as parameter. This is the one which is still missing ..an idea.?
|
|
|
|
|
|
Done all!!
Only one thing is left.?
How to iterate (infact access) the vtable of COM coclass(that will implement the methods of its exposed interfaces).?
Only I need to access vtable where all addresses of exposed methods of its interfaces are stored.
|
|
|
|
|
Hi all,
I am getting the following error when i try to update the system registry using the following function in InitInstance():
UpdateRegistry(OAT_DOC_OBJECT_SERVER);
"Failed to update system registry.Please try using regedit"
How to resolve this issue. Could not give admin rights to the user.
Thanks,
|
|
|
|
|
Karthika85 wrote: Could not give admin rights to the user
Assuming you are saying you cannot give these registry update rights to the User, why not have an Administrator install it who would have the rights? This is normal practice as far as I know.
|
|
|
|
|
Hi I am working with Adobe InDesign CS3. I have a VB.NET project where I am providing Indesign file as InPut and generating PDF and EPS files as output. When I create object of InDesign.Application
Ex: Dim appObject = CreateObject("InDesign.Application")
It launches Adobe InDesign Application and then the Document. I tried to Hide the Document using
EX: appObject.Open(InputFile,false);
but How to hide the Application in the Beginning? I dont want the application to be launched, it should work in background and not visible to the User. Can any one please help. Rashmi.M.K
|
|
|
|
|
I have used UrlDownloadToFile for quite some time in firefox and it was working flawlessly. But in the past couple of months or so I am facing this issue in firefox.
I download zip files from web servers inside an ActiveX that runs in a browser. When I log in to a website and try to download the zip file through my ActiveX in firefox, it fails. This worked previously. I have the necessary cookies created on my machine but somehow firefox does not seem to use them anymore. This still works prefectly in IE which downloads the file without any issue.
If the web server does not require a login, the file downloads without any issue.
This function gets stuck during "Sending Request" phase as indicated by the status code in the Progress callback.
I suspect the issue is with some security update in windows XP which has updated urlmon.dll and wininet.dll. I think IE handles the new update but firefox has stopped working because of that. I may be wrong though. If anyone has faced a similar issue, please help me out.
Hasan Khan.
|
|
|
|
|
There are two interfaces IA and IB, but they reference each other in their method.
The problem is, if i declared IA before IB, IA would get a error because IB was unknown to it; if i declared IB before IA, IB would get the same error.
I know i can fix this problem by replacing the parameters from IAs and IBs to IUnkown. but i want to know if there is a resolution like C++'s classes pre-defining?
|
|
|
|
|
IDL has forward declaration of interface, just like C/C++ has forward declarations, viz:
import "oaidl.idl";
import "ocidl.idl";
[
uuid(D39DD965-FC96-4C0A-AA62-CA3F5F117685),
version(1.0),
helpstring("cccc 1.0 Type Library")
]
library ccccLib
{
interface ITest2;
[
object,
uuid(7CD26371-4A6B-4234-A024-6690A53CA450),
nonextensible,
helpstring("Itest Interface"),
pointer_default(unique)
]
interface Itest : IUnknown
{
HRESULT DoSomething([in] ITest2* c);
};
[
object,
uuid(72a5a7e2-0256-428f-8bb5-42d39096892d),
nonextensible,
helpstring("Itest Interface"),
pointer_default(unique)
]
interface ITest2 : IUnknown
{
HRESULT DoSomething([in]Itest* c);
};
importlib("stdole2.tlb");
[
uuid(F8AAE058-76E9-4F2C-995A-FB5B6565CED6),
helpstring("test Class")
]
coclass test
{
[default] interface Itest;
interface ITest2;
};
}; Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Thanks for your reply. I have tried this method but fail, because i always use the right idl files generated by atl project wizards, and i failed because i spelt 'Interface IB' other than 'interface IB'.(VS also highlights 'Interface' and 'interface'!).
Regards.
|
|
|
|
|
Hi,
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.
Thx,
--Gopi
|
|
|
|
|
COM-component must be inherited from IDispatch
|
|
|
|
|
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.
|
|
|
|
|
I have a class called CReportEditCtrl derived from CRichEditCtrl which allows me to programmatically insert an embedded object (OLE mini-server) into the document. This is based on code here:
A Rich Edit Control That Displays Bitmaps and Other OLE Objects[^]
Embedding is simple enough:
CComPtr<IRichEditOle> pIRichEditOle = GetIRichEditOle();
CLSID classId;
HRESULT hr = ::CLSIDFromProgID(L"EmbeddedLink.Document", &classId);
if (hr == S_OK)
{
// Get the OLE client site from the container
CComPtr<IOleClientSite> pIOleClientSite;
hr = pIRichEditOle->GetClientSite(&pIOleClientSite);
if (hr != S_OK)
{
return(false);
}
// Get storage from the container
CComPtr<IStorage> pIStorage;
hr = m_pIRichEditOleCallback->GetNewStorage(&pIStorage);
if (hr != S_OK)
{
return(false);
}
// Create an OLE object i.e. the embedded item
CComPtr<IOleObject> pIOleObject;
hr = ::OleCreate(
classId,
IID_IOleObject,
OLERENDER_DRAW,
NULL,
pIOleClientSite,
pIStorage,
(void**)&pIOleObject);
if (hr != S_OK)
{
return(false);
}
CDataObject *pDataObject = new CDataObject;
pDataObject->AddRef();
pDataObject->Populate(strText);
hr = pIOleObject->InitFromData(pDataObject, 0, 0);
pDataObject->Release();
if (hr != S_OK)
{
return(false);
}
REOBJECT reObject;
memset(&reObject, 0, sizeof(reObject));
reObject.cbStruct = sizeof(reObject);
reObject.cp = CharFromPos(point);
reObject.clsid = classId;
reObject.poleobj = pIOleObject;
reObject.polesite = pIOleClientSite;
reObject.pstg = pIStorage;
reObject.dvaspect = DVASPECT_CONTENT;
reObject.dwFlags = REO_INPLACEACTIVE|REO_DYNAMICSIZE;
hr = pIRichEditOle->InsertObject(&reObject);
m_arrayIOleObject.insert(m_arrayIOleObject.end(), pIOleObject.Detach());
}
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.
Help appreciated.
|
|
|
|
|
Using the example program:
A Rich Edit Control That Displays Bitmaps and Other OLE Objects
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?
[Added later]
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.modified on Saturday, February 27, 2010 7:55 AM
|
|
|
|
|
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.
|
|
|
|
|
Hi All.
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?
Excuse me for weakness of my language.
thanks a'lot.
|
|
|
|
|
use some global object or file mapping object (security issue set it to low) Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
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
Good Luck
|
|
|
|
|
How to manage global memory in com ??
|
|
|
|
|
Your question is not very clear, can you explain more of what you are trying to achieve? txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Code it yourself. Allocate in the first instance release it in the last instance.
your question implies that you need a lot of larning. Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi Guys,
Good Morning/Evening,
i want to know few basic stuff related com+
1)if a Machine is having COM registerd...how a remote machine can access them who knows only Component name and functions.
2)who is taking care of global memory allocation and deallocation.
3)what is the use tlb file.
Thanksvikas da
|
|
|
|
|
This[^] would be a good place to start. Also you could take a look at some of the articles on COM here on CodeProject. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hi all. Show me, please, how to handle this event, to the link opened in same window.
In msdn says that must be replaced by a pointer to IDispatch, but it does not work.
VARIANT * v = &pDispParams->rgvarg[1];
if (v->vt == (VT_BYREF | VT_VARIANT)) v = v->pvarVal;
IDispatch* *pdisp = 0;
if ((v->vt & VT_TYPEMASK) == VT_DISPATCH){
pdisp = (v->vt & VT_BYREF) ? v->ppdispVal : & (v->pdispVal);
if (pdisp[0] != NULL){
pdisp[0]->Release();
}
g_pSite->get_Application(pdisp);
}
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.
Sorry for my english. 
|
|
|
|