|
Hi figer,
In COM terminology DOC and PPT files are called as Active Documents
By my personal experence you must start reading about Active Document, Active Document Server, Active Document Containers etc.
Okay so you want to display the DOC, PPT etc files inside your appication...
For this purpose your application must be an Active Document Container...
For more information search the microsoft KB articles named "DSOFramer"
I have strong felling, this is what you wanted...
And about Office Automation. If the above concepts are clear then I dont think Office Automation is an issue....
Have fun buddy !
Happy programming
Cheers,
Vishal
|
|
|
|
|
I need some help in codding ActiveX container. Short description : Microsoft Visual Studio 2003 and other vsersion (6,7) , includes sample TstCon - a sample of ActiveX Container. When I place control and than delete it or open new document, this program hang up every time when i close it.
I modified ContainerItem method OnDelete()... after pItem->Delete() i put delete(pItem); its all works under win2k... but... in 98SE,XP after deleting control, when i try to insert new control an error occured "Failed to connect.Link may be broken".
So does any one knows how to solve this, and force it to work correctly.
Thanks.
|
|
|
|
|
Hi,
I am new to COM.I have one application(Say simulator) which is interacting with control software on the same machine.Now i want to it to work through remote machine.Can you please let me know how this functionality can be achieve.If you know similar url please let me know.
Thanks
|
|
|
|
|
Assuming you are not using smart pointers, the code will go as follows:
{
COSERVERINFO csi = {0};
MULTI_QI qi[1] = {0};
//Init pwszname to computer name of remote server where
ur COM server
//is to be deployed
csi.pwszName = L"xxxx"; //use proper comp name here
qi[0].pIID = &IID_IFoo; //Init to interface you wish to obtain
HRESULT hr=CoCreateInstanceEx(CLSID_Foo,NULL,CLSCTX_REMOTE_SERVER,&csi,1,qi);
if(SUCCEEDED(hr))
{
m_pFoo=(IFoo*)qi[0].pItf;
//you got the interface for remote machine.
//Do your work here
}
}
This method is to programatically set up the connection to remote server
Another easy method is to register your COM server on both the local and remote machine. Launch 'dcomcnfg' on the maching you plan to run client. Find your COM server from the objects in the list view, right click and click 'properties'. Check the box 'Run this component on' and key in the name of the remote machine you paln to install your COM server.
That should work fine. No significant changes are required to the basic functionality of the COM server and the migration to DCOM server should be breeze
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
Hi all,
I've got a problem- I'm attempting to write an unmanaged c++ COM client for
a c# COM server. I wrote an event sink to handle events dispatched from the server. The problem- Events are properly intercepted by the client when in "blocking mode" but does not seem to work when in "non-blocking mode", i.e: When I implement the logic in a seperate thread.
I'v read about it some and I think this is because the thread enters a new apartment which the client sink is not in or something of that sort. How do I
overcome this problem?
Thanks in advance and sorry for by *bad* english..
i.chen
|
|
|
|
|
attention
|
|
|
|
|
pWebBrowser2->get_Document(&pDisp);
IHTMLDocument2Ptr pHTMLDoc2(pDisp);
IHTMLElementCollectionPtr pHTMLColl;
pHTMLDoc2->get_all(&pHTMLColl);
pHTMLColl->tags(_variant_t(TEXT("a")), &pDisp);
pHTMLAColl=pDisp;
The problem here:
pHTMLColl->tags(_variant_t(TEXT("a")), &pDisp);
On C++ works well, but on MASM returned:
DISP_E_MEMBERNOTFOUND
|
|
|
|
|
Hello all.
I've authored an ActiveX-control that i'd like to put on my web page. (yes, it's worth downloading)
But XPsp2 requires that the control be signed. (Or did it require that before sp2?)
Verisign takes a fortune for a publishers certificate, so does anyone know an alternative? One obvious alternative is to let the users download an installer, but that's not at all as compelling as a real control..
The microsoft documentation on authenticode speaks about a certificate type for "individuals", but I can't seem to find a way to get such a certificate?
|
|
|
|
|
Have you implemented the IObjectSafety interface for your activex control ?
Cheers,
Vishal
|
|
|
|
|
|
Hi,
Right now I'm working on dynamically adding DLL's to my menu.
But I cannot typecast the function pointers (I'm not exporting any class from my DLL)dynamically in my caller application.
Please help me in this.
Thanks
Sijis'
|
|
|
|
|
Could you be more specific?
You can't just arbitrarily typecast a function entry point to be anything you want. The function is going to expect certain things on the stack in order to execute properly.
By "dynamically" I assume you mean at run-time. Or, are you getting compile errors using GetProcAddress?
An example of properly casting the return of GetProcAddress:
void (*pFunc)(int) = (void (*)(int))::GetProcAddress(hModule, "MyProcName");
This example defines the variable pFunc as a pointer to a function that returns void and takes one int argument then initializes the variable to the return value of GetProcAddress() function. This assumes that MyProcName is defined as void MyProcName(int) in the source for the DLL.
These issues have been addressed with COM; I would suggest using COM rather than DLL entry points, expecially if you're not dealing with 3rd party binaries.
PeterRitchie.com
|
|
|
|
|
Hi there,
We have an application that accesses OPC Servers on an ethernet network. OPC (Ole for process control) uses DCOM to transmit information. To get a connection through DCOM we need to change certain security settings with the DCOMCNFG tool. Because this is very error prone for customers, I need a way to do this programmatically during setup.
Does anybody have code snippets of how to change these settings or does anybody know which methods to call to do so? I prefer examples in C# or C++ but if you have any information it would help me anyway.
Best regards
Daniel
|
|
|
|
|
I haven't figured out some of the newer WindowsXP SP2 security settings, but most of the older ones are located in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole.
"Live long and prosper." - Spock
|
|
|
|
|
Just added an additional method to a COM server EXE. I've successfully used it on 3 projects however on one I get the 'The procedure number is out of range.' error when it calls the new method. I looked on MSDN which said the version number needs to change. So changed the file version and version() in the IDL file. Still getting the error.
The difference between the first two projects and the one that has the error is that the first 2 are executables. The last is a COM dll that uses the COM server.
Any ideas??
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
Have you added a method to an interface that is in use by existing applications (AKA published)?
PeterRitchie.com
|
|
|
|
|
I did..
I finally figured out what was going on. I went though and changed everything with it including GUIDs and anything else I could think of. I was still getting an error and remembered that I have a VB COM object that was using it too. So went to work on it and finally got things working happily again.
Thanks!!
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
-Frank Outlaw.
|
|
|
|
|
[Message Deleted due to spam]
|
|
|
|
|
Check the register. I'm not a COM guru but I think that the problem is related with it. I mean, the register configuration says to COM where it can find the implementation of your class.
You probably have a key under HKCR\CLSID with the CLSID of your class. There should be a subkey:
InprocServer32, where is the dll path.
If you want a EXE server you have to add a subkey (LocalServer32) with the EXE path. And you have to call CoCreateInstance with CLSCTX_LOCALSERVER.
|
|
|
|
|
That errors means you haven't implemented the interface in the EXE. The supplied interface definitions tell use nothing about what the DLL or the EXE is implementing, or what is in the typelib for each.
If you're "sharing" the idl between the two objects and you've added the interface to the DLL from within Visual Studio it will have only implemented that inferface in the DLL, not the EXE.
PeterRitchie.com
|
|
|
|
|
Hi,
I am looking to implement/access these interfaces from either C++ or VB, but I am having trouble finding much detailed information about them.
Does anybody have a good starting point on these interfaces, sample code for implementing and exporting them from a C++ COM DLL or accessing and using them from within VB.
any help much appreciated
cheers
Michael
mpine@pegasussoftware.com.au
|
|
|
|
|
Are you looking for more information about ISyncMgrRegister or more information about implementing interfaces in C++ and VB?
PeterRitchie.com
|
|
|
|
|
I've successfully implemented AxWebBrowser in a windows form and it works fine.
Except the little flaw when client code pops up a window.
The new window does not seem to have access to the same session or cookies.
But if I log in to the same site from IE the same time, the popup from my form works fine.
Any ideas how to solve this behaviour?
|
|
|
|
|
How are you popping up the window?
You can "popup" a window by telling your application to run IE (or whatever browser is the default) when opening the link; which will start the popup in a completely different context. If that's the case you need to popup the window in your application, not the default browser.
PeterRitchie.com
|
|
|
|
|
As far as I understood overloading with COM/AchtiveX-Components is not possible, i.e. you cannot have a component, that exposes overloaded methods like a C++ class. Something like
mycomponent::mymethod(long lVal)
mycomponent::mymethod(double dVal)
would not work. Am I right?
Now I'm wondering if the "Union" type in MIDL could be a solution to build an interface to pass for example exactly two well defined types (e.g. long and double) as a parameter to a method.
Of course I could use a variant as parameter and check inside the method if the passed parameters are of the types I wanted, but that would be some kind of late binding that would be checked at run time. If it was possible to pass some union, checks for right types would be done at compile time (early binding).
So, who can give me an example of how to handle union datatypes with automation COM components and what the interface should look like?
|
|
|
|