|
you can reference to the book 'C# COM+ programming':->
|
|
|
|
|
Hello.
I need to retrive a all Interfaces (methods) and propertyes from a certain COM object i dont know realy where to start...
I'm there aren't many sources exept for some Object Browsers but no sources
|
|
|
|
|
Hi benjamin23,
OLE/COM Object Viewer gives all inofrmation about the COM object. Go to "Type
Library" and double click the COM object you want, it would show you the
information about the interfaces/structures that COM object has...
Hope this would help you...
All the best !
Cheers,
Vishal
|
|
|
|
|
|
The link has been verry userful, still leavme some cuestions:
supose i have an instance of "Word.Application"
I dont know if ".Visible" exists as a property or even a method, the same could happen to ".WebPagePreview" it's a method but my program doesnt know that i need to retrive the collection of methods and propertyes right before i create the object, this whay i can parse for example a .txt wich contains the methods to call or the variables to set.
|
|
|
|
|
Hmmm.. I think you are looking for invoking/calling a method or property dynamically. With this assumption, I think the following interface will help solve your problem -
IDispatch
IDispatch has a method called as GetIDsOfName to which you pass the name of method and it will return you an ID. Using this ID you call another method of IDispatch, namely, Invoke. For more details please check MSDN documentation for IDispatch and its methods.
I hope this helps.
Let me know if you are looking for anything other than what I assumed.
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Is somebody developing OPC compliance components? Can you recommend me any good tutorial or demo to know more about this subject? Is still OPC the standard used to develop software components for industrial communications or there are other trend that might I take care?
Thanks in advance,
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
-- modified at 10:31 Monday 10th October, 2005
|
|
|
|
|
insert a object to the activex container,we must open the insert dialog box usually. now i want to insert a object when the activex container Initializing,who can tell me how to do it?thanks.
|
|
|
|
|
How I can get and modify AmbientProperty in WebbowserControl?
P.S. I'm writing plugin for IE.
|
|
|
|
|
Hi Folks
I finished burning my brain with system-level configuration of my com, and now I get the first "normal" errors.
I have a Variant that contains an array of a structure (4 int), and 2 other int, that are rows and columns (of the image I must import)
In this piece of code
HRESULT Image2Variant (IVA_Image Source, VARIANT *Dest)
{
SAFEARRAYBOUND sabRGB[6]
sabRGB[0].lLBound = 0;
sabRGB[0].cElements = Source.columns * Source.rows;
sabRGB[1].lLBound = 0;
sabRGB[1].cElements = Source.columns * Source.rows;
sabRGB[2].lLBound = 0;
sabRGB[2].cElements = Source.columns * Source.rows;
sabRGB[3].lLBound = 0;
sabRGB[3].cElements = Source.columns * Source.rows;
sabRGB[4].lLBound = 0;
sabRGB[4].cElements = 1 // the only columns value
sabRGB[5].lLBound = 0;
sabRGB[5].cElements = 1 // the only rows value
VariantInit(Dest);
Dest->vt = VT_VARIANT | VT_ARRAY;
Dest->parray = SafeArrayCreate(Dest->vt, 1, saRGB);
....
Dest->parray is NULL, so I think that function fails, but I don't know why...
Suggestions?
Thanx
Morenz
|
|
|
|
|
A suggestion for you on your SafeArray init.
I believe that you need to init the vt (first param) with a data type, that is, VT_R4 or something such as that. I am not certain if you are putting in Array addresses in the safearray itself. It looks like you want data values such as floats or integers. I have used several safearrays and my inits always work with a VT_R4 for float instead of your Dest->vt.
The documentation states:
>>
vt
The base type of the array (the VARTYPE of each element of the array). The VARTYPE is restricted to a subset of the variant types. Neither the VT_ARRAY nor the VT_BYREF flag can be set. VT_EMPTY and VT_NULL are not valid base types for the array. All other types are legal.
>>
The other suggestion is that this array is for two dimensions ((Source.columns * Source.rows) by 6), is it not? Therefore the second parameter of the SafeArrayCreate should be 2.
|
|
|
|
|
First of all, thanx a lot for your reply.
I did it work, it was none of the precedent thoughts or ideas we had. It was simply that the cElements record of SAFEARAYBOUND structure had a too big value. I tried with 1000, and it's too big again. It likes 10 .
Now, if that's the problem, I'm back again at the starting point. I need to pass an array that could be max 1024 rows x 1024 cols, x 4 bytes (almost 4 megabytes). How can I do? Putting it into a file, sending the file and reading it back again serially is not a good trick, because if it's true that time is not a prerequisite, it's true, too, that I cannot make it last a minute to analyze a 1024 x 1024 raster image!
Should I serialize it into strings and send 'em in some chunks?
How can I do?
When will these annoying problems stop, so I can start making a decent debug?
Thanks again
Morenz
|
|
|
|
|
Hi,
I have a bunch of COM servers and I'd like to access them from Java clients. I need to have access to the methods and receive fired events.
Does somebody know any Java-COM bridge library, or anything that would help me do this?
thanks
|
|
|
|
|
The eclipse project has COM support built in, so you could look at using these eclipse libraries.
Then there is the Java-to-XPCOM Bridge project (XPCOM are essentially COM interfaces independent of the win32 headers)
http://www.mozilla.org/projects/blackwood/connect/
And IBM has bridge2java which worked fine for me
http://www.alphaworks.ibm.com/tech/bridge2java
Best regards
Carsten
|
|
|
|
|
A custom provide me with COM object (COM.dll and COM.tlb are included, no idl file) that was written VC#.net. The object contains outgoing interfaces (events) and other in going interfaces. I would like to use this COM object using ATL or MFC of Visual C++ 6.0. Any help would be appreciated!
|
|
|
|
|
I have created a marshaling proxy/stub DLL to handle the custom data interfacing of a COM object. The COM is a .exe and I am having trouble getting the marshaller to work during deploy.
If I install the C++ application and COM server on a target machine and register the components this way... (COM server is SPDCom)
c:\TARGETFOLDER\SPDCom.exe /Regserver
regsvr32 c:\TARGETFOLDER\SPDComPS.dll
The COM object is started and running in memory properly by the application, but I do not get any data from the Proxy/Stub. (Just the first data item in the passed arrays.)
I was only able to get the project to work well after using VC++ 6.0 to build and register the SPDComPS project on the target machine.
Before I built and registered the PS project, I did verify that the PS was registered in the registry with all of it's GUIDs. Finally, with this background, my question is:
What is the difference between registering using regsvr32 from the 'RUN' prompt and from within VC++? (That seems to be the only difference!)
David Leikis
ATK Thiokol Propulsion
|
|
|
|
|
David_Leikis wrote:
What is the difference between registering using regsvr32 from the 'RUN' prompt and from within VC++?
There is no difference, it still is the RegSvr32 that is used even if called from the DevStudio IDE.
However, if you don't alter the "Tools->Register control" command in DevStudio, RegSvr32 is run from your target directory and always puts quotation marks on each side of the path to your server.
Since it works when you build the application on the target machine you might have been missing some files that were installed with DevStudio.
Hope this helps
--
Roger
|
|
|
|
|
After a few phone calls to Microsoft support, I got the answer to the problem of the Proxy/Stub not working and seeming to need to be registered with DevStudio.
It seems that the Regsvr32 utility needs to have the COM object already installed BEFORE you install the PS!!! The bottom line is that the PS.DLL MUST be registered last! If you don't, there will never be any notification of error or warning, the COM object will fall back to standard marshalling and your custom marshalling PS.DLL will simply not be invoked.
I just had my client register the PS.DLL again (last) and it worked immediately.
-- modified at 9:00 Tuesday 11th October, 2005
|
|
|
|
|
Well, there's always a lesson to be learned.
I didn't think if this either, but afterwards it's quite logical since when the server is registered (DllRegisterServer gets called from e.g. RegSvr32) it simply writes registry values not knowing anything about the proxy/stub dll.
Nice of you to share the explanation. Thanks.
--
Roger
|
|
|
|
|
I am executing the following code in VC.
-----------
HRESULT hr = CoInitialize( NULL );
hr = CoCreateInstance( CLSID_RegExp, NULL,
CLSCTX_SERVER, IID_IRegExp, (void**)&m_pIRegExp);
CoUninitialize();
---------------
I find that in the first execution(i.e. after restarting my machine) the time taken to execute this code is more than the subsequent executions.
The main time taken in case of 1st run is by CoCreateInstance
I am measuring the time taken using IBM's Rational(so I can trust their output).
Can u help me figure out the problem?
Is it that for the 1st time I run the application, some dll's are loaded in the memory which doesnot happen in the subsequent runs? Is this some funda of COM?
Please help.
P.S. Performance improvement is my main focus
Chirag Saglani
|
|
|
|
|
The initial delay is because the operating system does much initialization under the hood (DLL loading, etc). This was the case under Windows 9x, but I have not observed this under Windows NT-based operating systems.
--
|
|
|
|
|
Thank you for the reply.
I am using Windows XP ans still facing this problem.
Can u also please tell me what exactly happens during CoCreateInstance (which DLL is loaded etc)that is taking more time in the first execution?
Thanx
|
|
|
|
|
Hi Chirag,
Check if the regular expression libraries are installed properly.
There might be some collision between your "RegExp" library CLSID's...
I am just guessing, you can have a look...
OR
Try to design some simple application in VB using "Regular Expression" library.
This might tell you where exactly the problem is...
I cant see other things that should take time...
all the best !
Cheers,
Vishal
-- modified at 8:09 Tuesday 11th October, 2005
|
|
|
|
|
Hi,
I am developing an application with several components in it. The main application will have a GUI and there are several components like BHO, MS Office Addins, Clipboard trackers etc. I have a problem here.
These components should communicate with the main application by some means. It has to pass some events or some values to the main application. I will be creating both the components and the main application and I would like to know, the best method to connect the components to the main application.
I have pretty good exposure to COM and Windows programming.
Also Is it possible to create a Singleton Automation server ?
Thanks and Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
>>I am developing an application with several components in it. The main
>>application will have a GUI and there are several components like BHO, MS
>>Office Addins, Clipboard trackers etc. I have a problem here.
What kind of appliction is this, I mean do you have some activex control inside this application which in turn has IE instance, Office instance and so...
>>These components should communicate with the main application by some
>>means.
You can get the HWND of your applications main window... there are several ways
to get HWND, like get HWND using "caption" or "class name" for window with the
help of FindWindow API...
Once you get the HWND you can very well use "SendMessage" or "PostMessage" for
further communication...
All these things would go inside your BHO, Office addin or so...
>>Also Is it possible to create a Singleton Automation server ?
sorry no idea about the Singleton automation server...
Hope this would help you!
Cheers,
Vishal
-- modified at 8:28 Tuesday 11th October, 2005
|
|
|
|