|
I want help on following.
I want to store properties for .doc,.xls,.ppt,.txt files. I used IStorage and IStream interfaces to store properties in the said files. It works well with .xls and .txt (on NTFS file system) files but not with .doc and .ppt files. I can write to files, and I can retrive the stored properties again successfully. But if I modify .doc or .ppt files using their editors (MsWord and MsPowerPoint respectively), properties only I had written appeared vanished, i.e. while next read from program fails for these properties (Properties written from Interface provided by Windows retain very well).
I tried IPropertySetStorage+IPropertyStorage also, but result is same.
I tried to write SummaryInformation,DocumentSummaryInformation storages.
I tried to write my own storages also. Userdefined storage retains this but these properties can be seen and modified from Windows user interface of properties for these files so I don't want to use it.
I am using C/C++ and WIN32 APIs.
Can any one help me on this plz.
First deserve then desire. Let be deserved first.
|
|
|
|
|
how could we use DTs in my vb.net code it always give me the following error
"13 query interface for customDTS.customtask dll"
plz reply me ?
|
|
|
|
|
[Was asked in the VC++ board earlier today, but got no replies...]
OK... I am working with an IDispatch -based interface that needs to be completely automation capable (i.e. uses the Typelib Marshaller - no custom marshalling).
Now, AFAICT:
o I can pass structures over an IDispatch -based interface as the structures consist solely of automation-capable types
o I can pass arrays of automation-capable types over IDispatch -based interfaces using SAFEARRAY (possibly wrapped within a VARIANT )
(For now, ignore the fact that some clients, like VBScript , may be unable to handle these kinds of parameters.)
However, I cannot seem to find information telling me that both are possible at the same time. IOW, I want to pass an array of structures across an IDispatch -based interface. The only information I can find regarding passing arrays of structures indicates that I will have to serialize the data to a byte stream and then send the raw bytes over the wire wrapped in a SAFEARRAY of VT_I1 types.
While I am sure I can make that work, and can provide clients with information on how to decode the structures, this feels kinda 16-bit-ish to me, and not just a little quick-n-dirty.
So, does anyone know if it is possible to pass arrays of structures over IDispatch-based interfaces, or do I have to do the byte-stream route? If so, please point me to the relevant documentation.
Adva[Thanks]nce! (Cheesy, I know... )
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I think its not possible without custom marshalling. You have to send these as byte arrays i.e., SafeArray of UI1 (VT_ARRAY|VT_UI1). I ran into some problem a little while earlier and I couldnt find any other way to do this.
I will be happy to take my words back if someone can point to anyother possible solution.
"Watching non-programmers trying to run software companies is like watching someone who doesn't know how to surf trying to surf."
|
|
|
|
|
Hello Aamir,
I've written a sample COM application that I believe will demonstrate what James needs. If you are interested, pls email me directly :
bio_lim_2004@yahoo.com
I'll send it to you too.
Best Regards,
Bio.
|
|
|
|
|
Hello James,
I've written a sample COM application that I believe will demonstrate what you need. Pls email me directly :
bio_lim_2004@yahoo.com
I'll send it to you.
Best Regards,
Bio.
|
|
|
|
|
Before asking questions about CoRegisterClassObject, I want to give an idea of what I am trying to do. The purpose of my project is to capture all XMLHTTPRequest calls from Internet Explorer through an external application (the application I am developing) and record the data sent and responseText for debugging purpose. With some ideas from the MSDN forum, I built my class object which implements IClassFactory and IXMLHTTPRequest and I used CoRegisterClassObject to register and associate CLSID_XMLHTTP with my own object. (the CLSID of class XMLHTTP which implements IXMLHTTPRequest and any script in IE making XMLHTTPRequest should go through this class). However, the CreateInstance of IClassFactory I inherited never got call when the AJAX web application is obviously making XMLHTTPRequest.
I read an article saying that CoRegisterClassObject is only effective if it is in the same apartment of the thread making calls to the class object you are overriding. Here is the link:
http://66.102.7.104/search?q=cache:6BaNPZeQ3e4J:discuss.microsoft.com/SCRIPTS/WA-MSD.EXE%3FA2%3Dind9911a%26L%3Ddcom%26T%3D0%26P%3D13080+CoRegisterClassObject+override&hl=en&gl=us&ct=clnk&cd=3[^]
Is it the cause of not working? What apartment is Internet Explorer and is it feasible to execute CoRegisterClassObject in every apartment IE is in? Please advice.Thanks
Paulino
|
|
|
|
|
Hi,
I am tring to import Excel COM (Microsoft Excel 9.0 Object Liblary) to a .NET2.0 poroject's references and it dose not work. I receive errors about wrong assembly. I tried this under .Net1.1 and it worked. Dose it mean that this standart COM is not suported in .Net2.0? Did anybody have a problem like this?
Thanks in advance
Vizmunt
|
|
|
|
|
Hi,
I have some problem with this fn.
IMultiMediastream::GetDuration(..);
but this fn. worked well
IMultiMediastream::SetState(STREAMSTATE_RUN);
how to solve this problem
|
|
|
|
|
Error description?
"Watching non-programmers trying to run software companies is like watching someone who doesn't know how to surf trying to surf."
|
|
|
|
|
thankx for ur replay
now its working well
|
|
|
|
|
hi everyone, I have an old application VB6 and ASP.
the asp pages are on the webserver, the dll is registered on the webserver (win 2000), the dll is in the com+ also of the application server (win 2000). everything is working correctly.
When we change the webserver to a win 2003 server, I should register the com object on this new server, I made export from the application server, and I register this com on the new web server (win 2003).
I had this error: server.createobject failed.
it is like asp can't create any object.
what is the problem? security or configuration?
|
|
|
|
|
Can you specify the exact error which you are getting.
This most probably seems to be a security issue. There is a group called "Distributed COM Users" in the Groups. To use a COM Component from another machine through DCOM, user should be in this group. This group was not present with the original version of Windows 2003. It came only with SP1 of Win2k3.
Anyway, look at the exact error. It might be something else.
Tribute to Shog:
New CPhog is amazing especially with message posting, very well done Sir.
|
|
|
|
|
I'm writing Browser Helper Object (IExplorer plug-in) in C#, Microsoft VS 2005, Framwork 2.0.
1. I implement interface IObjectWithSite and add event handler for events SHDocVw.DWebBrowserEvents2_Event.DocumentComplete and SHDocVw.DWebBrowserEvents2_Event.OnQuit in function SetSite :
[System.Runtime.InteropServices.ComImport, System.Runtime.InteropServices.Guid( "FC4801A3-2BA9-11CF-A229-00AA003D7352" ), System.Runtime.InteropServices.InterfaceType( System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown )]
public interface IObjectWithSite
{
void SetSite( [System.Runtime.InteropServices.In, System.Runtime.InteropServices.MarshalAs( System.Runtime.InteropServices.UnmanagedType.IUnknown )] object pUnkSite );
void GetSite( [System.Runtime.InteropServices.In] ref System.Guid riid, [System.Runtime.InteropServices.Out] System.IntPtr ppvSite );
}
[System.Runtime.InteropServices.ComVisible( true ), System.Runtime.InteropServices.Guid( "C06B3B91-769A-42d5-8BCD-CF70F8589FBA" ), System.Runtime.InteropServices.ClassInterface( System.Runtime.InteropServices.ClassInterfaceType.None )]
public class DOMPeek : IObjectWithSite
{
void IObjectWithSite.SetSite( object pUnkSite )
{
if(m_IUnkSite != null)
{
System.Runtime.InteropServices.Marshal.ReleaseComObject( m_IUnkSite );
}
m_IUnkSite = pUnkSite;
try
{
SHDocVw.DWebBrowserEvents2_Event WebBrowserEvents = (SHDocVw.DWebBrowserEvents2_Event)m_IUnkSite;
WebBrowserEvents.DocumentComplete += new SHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler( OnDocumentComplete );
WebBrowserEvents.OnQuit += new SHDocVw.DWebBrowserEvents2_OnQuitEventHandler( OnQuit );
}
catch // cast or no such interface exception
{
}
return;
}
void IObjectWithSite.GetSite( ref System.Guid riid, System.IntPtr ppvSite )
{
}
2. Implement event handlers OnQuit and DocumentComplete
void OnQuit()
{
System.Windows.Forms.MessageBox.Show( "OnQuit" );
}
void OnDocumentComplete( object pDispatch, ref object VariantURL )
{
System.Windows.Forms.MessageBox.Show( "OnDocumentComplete : " + VariantURL );
}
3. I register the object DOMPeek as Browser Helper Object in windows register.
Then I run IExplorer and see the messageBox "OnDocumentComplete : about:blank". Then I close IE window and see the messageBox "OnQuite".
The problem consist in that I take this result only in MSWindosw2003sp1 (server) with MS VS2005 installed. In MSWindowsXPsp2 without any updates, without MS VS2005, but with all Framework installed I didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit". What's problem??? What updates need for correct working in MSWindowsXPsp2???
Then I try to install all updates for MSWindowsXPsp2 from Microsoft site and again didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit". Then I try to install MS VS2005 but didn't install all updates for MSWindowsXPsp2 and again didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit". Finally I install all updates for MSWindowsXPsp2 from microsoft site and then MS VS2005 then I see the messageBox "OnDocumentComplete : about:blank" and "OnQuit". But if I install MS VS2005 and then all updates for MSWindowsXPsp2 then not woking (didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit").
What's problem??? What specifically updates need for correct working in MSWindowsXPsp2???
|
|
|
|
|
Hello,
I have created a server and client Automation; I manage to send commands, receive int ,strings,... but I need to receive a HBITMAP. How can I do that, I have read about IPicture but it does not work for remote automation.
Can somebody give me any clue?
Thank you,
Agnes
|
|
|
|
|
athomass wrote: have created a server and client Automation; I manage to send commands, receive int ,strings,... but I need to receive a HBITMAP. How can I do that, I have read about IPicture but it does not work for remote automation.
Can somebody give me any clue?
You have to read the bytes of the BITMAP and send that bytes,After receiving total bytes prepare the bitmap from that bytes of the BITMAP
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hello,
What type should I use to send the bytes? VARIANT with pbstrVal? or a SAFEARRAY?
|
|
|
|
|
athomass wrote: What type should I use to send the bytes? VARIANT with pbstrVal? or a SAFEARRAY?
Use just read the bitmap into byte array and simply send it ,not necessary to convert it from bytes to VARIANT with pbstrVal or a SAFEARRAY
because in send API it is typecasted into const void*
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
hi
iam trying to access remote WMI data using the following arguments in ConnectServer
hres = pLoc->ConnectServer(
_bstr_t(L"\\\\test\\root\\cimv2"),
_bstr_t(L"kumar"), // User name
_bstr_t(L"Keta001"), // User password
_bstr_t(L"MS_409"), // Locale
NULL, // Security flags
_bstr_t(L"CRAFT"), // Authority
0, // Context object
&pSvc // IWbemServices proxy
);
where test is the name of testPC
kumar is the username of remote PC
Keta001 is the password
CRAFT is the domain name
but when iam running my application iam getting error
cannot be connected error code 80041008
can u please suggest how to solve this.
Thanks In Advance
abhi
|
|
|
|
|
In the good old days I believe people were using the arcane technology which came to be known as COM+ to embed other application's document in their own document.
Like a Word with document a Windows Media Player or Excel or Visio document inside, double click on it and *bang* you coud start edit it using Excel/WMP/Visio toolbar.
Apparently even OpenOffice could do that.
Now here is my question:
I'm a new generation programmer. Blissfully ignorant of such thing.
But I would like to know and embed Word, Excel or other kind of document in my application's own document!
How could I do that?
And is there an up-to-date technology (i.e.: .NET API) to do that?
|
|
|
|
|
Super Lloyd wrote: Blissfully ignorant of such thing.
This is blissful for other people as well BTW.
Super Lloyd wrote: But I would like to know and embed Word, Excel or other kind of document in my application's own document!
Look at OLE and related technologies for this. you can create an Ole Container with the help of wizard in Visual C and even in a wizard-generated app you can add any OLE Server inside it. Word, Excel, Visio etc are OLE Servers, that's why they get embedded so easily.
Super Lloyd wrote: And is there an up-to-date technology (i.e.: .NET API) to do that?
I dont know much about .NET Alternatives but .NET Provides a Web Browser control through which you can add ActiveX controls in your winforms. There might be other ways as well. I will have to look into it.
Tribute to Shog:
New CPhog is amazing especially with message posting, very well done Sir.
|
|
|
|
|
The wizard tip & the IE is a good one!
Thanks!
|
|
|
|
|
Is it possible to block switch to retry message box while using com servers.
Thanks in advance.
|
|
|
|
|
Hai all
I need to get the count of all the open child windows in the current running instance of photoshop using COM i.e. not adding a reference in the references i am able to open a new instance and close it but my problem is if i have a few new document windows for editing open in photoshop can i have the count.
Thanks in advance,
I have been trying since 2 days.
Raj Kumar
modified 8-Aug-12 1:36am.
|
|
|
|
|
I saw this on MSDN:
RCW enforces built-in marshaling rules. For example, when a .NET client passes a String type as part of an argument to a managed object, the wrapper converts the string to a BSTR type. Should the COM object return a BSTR to its managed caller, the caller receives a string. Both the client and the server send and receive data that is familiar to them.
But this doesn't work for a .NET client passing a string by value to a COM server.
ATLSERVERLib.Object1Class obj = new ATLSERVERLib.Object1Class();<br />
<br />
unsafe<br />
{<br />
short k1 = obj.GetANum;<br />
Console.WriteLine(k1);<br />
<br />
string name = new string('o', 7);<br />
obj.GetName = "Check";<br />
string[] strArray = new string[1];<br />
strArray[0] = "N Prasad";<br />
obj.set_OtherName(ref strArray[0]);<br />
Console.WriteLine(obj.GetName);<br />
Console.ReadLine();<br />
}
If I comment out obj.set_OtherName(ref strArray[0]); , the obj.GetName doesn't yield the correct string.
It seems that the obj.GetName = "Check"; has no effect although it sets the COM server's private variable BSTR myValue; .
Thus it also seems that the .NET string to COM BSTR marshalling works properly inside COM server only if the string (.NET object) is passed by reference, which means it becomes a BSTR* in COM server.
Does anybody have an idea why this happens?
|
|
|
|