|
|
You need to read either (or both) Essential IDL and Essential COM, or at a minimum, look for examples on MSDN and other sites (like this one) which use SAFEARRAYs. Google for SAFEARRAY SAMPLE or SAFEARRAY SOURCE which should help you get started.
Alternatively, my rates for training (if you're UK based) are quite competitive
Steve S
Developer for hire
|
|
|
|
|
hi
I would like to remote control Word. As I can insert a new tabellenzeile thank you
|
|
|
|
|
|
hi
unfortunately I find there also nothing in addition
thanks
|
|
|
|
|
(Isn't this a FAQ?)
To do this, you need to understand what parts you want to control, and know about the object model for Word. The easiest way is to record a VBA macro that does what you want, and examine it to see how it works. Often you will be able to 'optimise' the equivalent C++ code, although converting is sometimes tricky. To get you started there used to be a VBA -> C++ "conversion" tool on the MS web site (look for BTOC, I think)
Steve S
Developer for hire
|
|
|
|
|
hi steve thank you for your answer
what is this "C++ "conversion" tool on the MS web site (look for BTOC, I think)
i know it on VB, but i will it in VC++
i have no idea
|
|
|
|
|
Go to MSDN and enter 216388 in the search page. Should give 3 hits, top one B2CSE.EXE is what you want.
Steve S
Developer for hire
|
|
|
|
|
|
I want to pass array of double in an Event using Atl/Com so that the complete array must be visible in VB through that event.Awaiting for response as soon as possible.
Akhsay Dave
|
|
|
|
|
Hi !
Is it possible to take an existing MFC application and to manually add code such, that the application becomes a COM exe server ?
I found something about such a "supported addition" --> "How to Add ATL Support to an MFC EXE" http://support.microsoft.com/default.aspx?scid=kb;EN-US;175190 but it doesn't seem to work. I think that that example does't deal with COM EXE but just with plain COM.
Can anybody shed a light on this subject ?
Thanks
Roland Rubichi
|
|
|
|
|
Hi !
Is it possible to take an existing MFC application and to manually add code such, that the application becomes a COM exe server ?
I found something about such a "supported addition" --> "How to Add ATL Support to an MFC EXE" http://support.microsoft.com/default.aspx?scid=kb;EN-US;175190, but it doesn't seem to work. I think that that example does't deal with COM EXE but just with plain COM.
Can anybody shed a light on this subject ?
Thanks
Roland Rubichi
|
|
|
|
|
hi,
I am trying to convert (in my ASP.NET app) html document into .doc. My solution is to use automation and simply load html doc into word 2003, and then use document.SaveAs() to save it like word document. My problem is that after .doc is created, it is in wrong encoding ( or did word really produce sequence of random characters? ) I am not sure if problem is really with encoding, or if there is something else.
Let the code speak:
<br />
Object missing = System.Reflection.Missing.Value;<br />
Object confirmConversions =false;<br />
Object isReadOnly = false;<br />
Object format = Word.WdOpenFormat.wdOpenFormatAuto;<br />
Object encoding = missing;<br />
Object visible = true;<br />
Object noPrompt = true;<br />
Object origFormat =missing;<br />
Object saveChanges = false;<br />
Object revert = false;<br />
Object addToRecent = true;<br />
Word.Document doc= null;<br />
try<br />
{<br />
doc = oWord.Documents.Open(ref fileName, ref confirmConversions, ref isReadOnly, <br />
ref addToRecent,ref missing, ref missing, ref revert, ref missing,ref missing,<br />
ref format,<br />
ref missing,<br />
ref encoding,<br />
ref missing, ref missing, ref missing, ref missing);<br />
doc.Activate();<br />
<br />
Object newFileName=HTMLContractURL+".doc";<br />
Object newFileFormat = Word.WdSaveFormat.wdFormatDocument;<br />
Object readOnlyRecomended = false;<br />
<br />
Object lockComments = false;<br />
Object saveFormsdata = false;<br />
Object saveAsAOCLetter = false;<br />
Object embedTT = false;<br />
Object saveNativePF = true;<br />
doc.SaveEncoding = Microsoft.Office.Core.MsoEncoding.msoEncodingUTF8;<br />
oWord.ActiveDocument.SaveAs(ref newFileName, ref newFileFormat,<br />
ref lockComments, ref missing, ref addToRecent, ref missing,<br />
ref readOnlyRecomended, ref embedTT, ref saveNativePF, ref saveFormsdata,<br />
ref saveAsAOCLetter, ref encoding, ref missing, ref missing,<br />
ref missing, ref missing);<br />
maybe oWord.SaveEncoding is bad, bt I added it WHILE debugging, so it wasn't working even without that line.
Since I need it done soon, I really appreciate any help.
Thanx a lot,
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
Hi,
I have file as shown in the link:
http://mickey.ccs.uky.edu/doubt/a.doc
I need to parse the file and get the various text information present in it. Also, I need to differentiate whether it came
from process or data(see file.)
Any help to achieve this would be highly appreciated.
Are there any ways to access the content of an OLE object ?
Looking forward for replies.
Thanks
Ignatius
|
|
|
|
|
Hello. I write small plugin for IE - URL filter. I write it as Browser Helper Object in C++ using ATL. When DISPID_BEFORENAVIGATE2 method is fired - I get the url where surfer will go. I get it from pDispParams array and I have no problems with that. But when surfer click a link that must be opened in new window (via target="_blank") - DISPID_BEFORENAVIGATE2 is not fired, but DISPID_NEWWINDOW2 is fired. This event does not tell url for new window location. How can I get the Url of new location in case with new window? Thanks, and sorry for bad english if so.
|
|
|
|
|
I have an ATL/MFC COM DLL which a customer is trying to use from Delphi 6 Enterprise SP2. He was having trouble setting properties, and eventually discovered that all of the Set_* procedures in the auto-generated TLB file are empty. The only ones that aren't empty are for BSTR properties.
We have no problems using the DLL from C++, VB or ASP.
Has anybody experienced something like this? Am i missing a MIDL keyword? Is it a build/linker setting? Do I need to specify something in my .DEF file? Or is Delphi to blame?
---
Here's how things are defined in my project:
// from my .idl file
[propput, helpstring ("blah"), id(6)] HRESULT RepeatCount([in] long newVal);
// from the corresponding .h file
STDMETHOD(put_RepeatCount)(/*[in]*/ long newVal);
// from the corresponding .cpp file
STDMETHODIMP CMyClass::put_RepeatCount(long newVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
m_lRepeatCount = newVal;
return S_OK;
}
// from Delphi's auto-generated MyDLL_TLB.BAS
procedure TMyClass.Set_RepeatCount(pVal: Integer);
begin
Exit;
end;
---
Thanks,
Gary
|
|
|
|
|
Hi guys.
I have an out-of-process COM server, which has numerous clients connecting and disconnecting to/from it. Server must know about every client instance connected to the it. The problem is, that when a client is abnormally terminated server has NO way to determine that the client is not there anymore, and this situation is very unhealthy. Does anyone know how to solve this problem?
|
|
|
|
|
sergeyv2002 wrote:
Does anyone know how to solve this problem?
There's many ways to this out-of-band. For instance with "pings" using TCP, pipes, shared memory, etc. I am not sure if there are any other methods in pure COM. Maybe there are in COM+, but that doesn't help you much I imagine.
Out-of-band is the only way to go that I can think of.
--
Weiter, weiter, ins verderben.
Wir müssen leben bis wir sterben.
I blog too now[^]
|
|
|
|
|
Hmm.. wait. There's another way that might work. Each time a client connects, require them to pass an IPingable* reference to themselves. Then call IPingable::Ping() regularly to see if the client is still alive. I believe you'd get an RPC_E_XXX error message back when the connection has been severed.
However, this would require circular references, so you'd need to setup up some termination protocol so that both server and client will release eachother.
--
Weiter, weiter, ins verderben.
Wir müssen leben bis wir sterben.
I blog too now[^]
|
|
|
|
|
Hello Jorgen,
I think the IPingable interface is a good idea. I too have a need for such an infrastructure for my EXE COM server to check the "live" status of its clients.
Thanks for sharing the idea.
Best Regards,
Bio.
|
|
|
|
|
Thanks Jörgen. I will try your approach.
Thanks again.
|
|
|
|
|
Please let me know if it works out. I might have to solve a similar problem in the near future.
--
Weiter, weiter, ins verderben.
Wir müssen leben bis wir sterben.
I blog too now[^]
|
|
|
|
|
Hello sergeyv2002, Jorgen,
Have you considered using the DCOM architecture ? I read somewhere that DCOM uses the ping mechanism as described by Jorgen.
The other idea is to use .NET Remoting which uses something known as leasing. Leasing basically caters to remote object lifetime management.
Just some ideas to share.
Regards,
Bio.
|
|
|
|
|
Lim Bio Liong wrote:
Have you considered using the DCOM architecture ?
Yes, but it's a bit overkill for a desktop app which is not distributed in nature. At least not distributed over the network. I just want other apps to automate certain tasks.
Lim Bio Liong wrote:
The other idea is to use .NET Remoting which uses something known as leasing
.NET is not an option for me.
--
Weiter, weiter, ins verderben.
Wir müssen leben bis wir sterben.
I blog too now[^]
|
|
|
|
|
Hi,
for some resons i try to implement some functions to load COM dlls without accessing the registry.
I don't know what dlls to load because the user of the application may add/remove dlls (they are used as plugins).
The only thing i know is the (relative) path of the directory that contains the dlls.
My idea is, to search this path, load the dlls into memory (LoadLibrary()) and initialize them using the functions
GetProcAdress() and DllGetClassObject(). ( -> these steps should be the manual implemantation of CoGetClassObject()- function ?! )
The only problem (so far... ) is, how to estimate the CLSID i need for the initialization?
(In my old registry based implementation i estimated them from the registry using EnumClassesOfCategories())
Currently i assume, a viable but not nice solution is to implement a "GetMyCLSID()" - function in the dlls.
Does anyone knows a better solution for this, does there exists a function to estimate the CLSID from a dll (BEFORE it is accessible as COM object)?
Has anyone some experience with this or a similiar solution or another solution for this problem?
Thanks in advance
alcedo
|
|
|
|
|