|
|
I have a regular DLL created in C++ that can run VBScript procedures from a VBScript file. The DLL is able to pass variant strings and safearray as parameters to script procedures. However, for a vector of name-value pairs I want to pass it to the script procedure by wrapping the vector in a COM class and passing its IDispatch pointer as parameter to the script. Is it possible to have a COM class and create the COM object inside a regular DLL, and then get its IDispatch interface to a variant variable? If yes, how (sample codes if possible)?
|
|
|
|
|
If you want a set of name-value pairs, why not convert the vector to a VBScript Dictionary[^] object?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Looks like it will solve the problem since it has IDictionary interface that I can use in C++, and it will be easier to implement than creating COM object in the regular DLL. Thanks, Stuart!
|
|
|
|
|
Hi I got a requirment like ,
I have student interface IStudent(has properties like name, age, course), similarly ICourse (has properties like course name, student name).
how do i get list of students who attending a particular course ?
thanks
|
|
|
|
|
Enumerate the values of each, compare and count. There is not enough information in your question to provide a sensible answer.
MVP 2010 - are they mad?
|
|
|
|
|
This looks like a typical RDBMS "requirement".
|
|
|
|
|
yes this my qn looks like RDBMS query , but is it possible to do that in COM >?
|
|
|
|
|
hi
Microsoft.Office.Interop.Excel.ApplicationClass ExcelApp = new Microsoft.Office.Interop.Excel.ApplicationClass();
// in this line of code:
ExcelApp.Application.Workbooks.Add(Type.Missing);
error:
Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))
can any one help me ?
H.R
|
|
|
|
|
What exactly does it do? I have been browsing the Direct3D API code and I see most interfaces are declared using DECLARE_INTERFACE_ providing the derived interface name along with the IUnknown base as that is what DECLARE_INTERFACE_ is for; deriving from a base. What I've read elsewhere is that DECLARE_INTERFACE is for declaring interfaces when there is no base interface but my impression was that all interfaces derive from IUnknown somewhere up the tree so what does DECLARE_INTERFACE do?
|
|
|
|
|
When I look at where it's defined, I see these comments:
* DECLARE_INTERFACE(iface) is used to declare an interface that does
* not derive from a base interface.
* DECLARE_INTERFACE_(iface, baseiface) is used to declare an interface
* that does derive from a base interface.
Note the distinction between DECLARE_INTERFACE and DECLARE_INTERFACE_
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Yup. That's what I read as well. My point is, if IUnknown is a required common base interface to every COM interface then why does DECLARE_INTERFACE(iface) even exist? If IUnknown is a required base interfact then EVERY declaration should have a DECLARE_INTERFACE_(iface, IUnknown) somewhere up the hierachy. But some don't. They just have DECLARE_INTERFACE(iface) with no reference to IUknown whatsoever.
|
|
|
|
|
DirectX contains non-COM interfaces such as ID3D10EffectType that are declared with DECLARE_INTERFACE...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Thanks! I just did some reading off the back of your reply and I see that MIDL is not used soley for COM operations but for RPC in general. I was not aware of that. Thanks for pointing me in the right direction.
|
|
|
|
|
Hello guys,
I would like to have a wrapper for Rcom server in C#. I do not know what a wrapper is or how to create it.
This is what i did and i do not know if i am right or wrong.
I opened a project in C# which is integrated to R, using two dll files and this is what i did:
Open Project -> References -> Add References -> COM -> RCOM 1.0 type library (located at library/rcom/libs/rcom_srv.tlb)
This creates a dll file in my system named Interop.RCOMServerLib.dll. Is this what is meant by the wrapper file. I have no clue, its just a wild guess. and if this is the right thing i am talking about then how can i view the content of the dll file to know what all functions it is using.
I need some help here.
Thanks,
SJ.
|
|
|
|
|
What is it that you're trying to do?
It could be that you're have an unmanaged COM component that you want to use in C#.
This is done using COM interop or also called P/Invoke.
You could also access a C# component or assembly from unmanaged code.
This is using a COM Callable Wrapper (CCW).
This is also called reverse P/Invoke.
The following link will help you -
COM Interop[^]
Exposing .NET Framework Components to COM[^]
|
|
|
|
|
This is what i wanted. A com wrapper, which can be interchangeable between programs and can be used to check what all functions that com can execute. if this is a dll file or tlb file then how can i open it or view it to know all the functions it will execute.
|
|
|
|
|
You can use OleView.exe for this.
This comes as part of the Windows SDK.
|
|
|
|
|
Thanks for the reply. Oleview.exe was not helping much in getting the classes and the functions that are being used in the dll file. So after searching for a while, i got hold of this software which clearly shows all the functions that are present.
.Net Reflector[^]
|
|
|
|
|
i want to create a website on which i want to open a pdf file at page load event so suggest me the what should i do???
|
|
|
|
|
|
how many ways a client can access com componet ?
ex, I have created a com comp(inproc) which is registerd and ready to use, i want my clinet to access this, what all the steps to be taken from my end (like what all info i need to give to them )and client side ?
thanks
|
|
|
|
|
You need to give them something which defines your components interface - the IDL you used to define the component interface is probably the best thing...
Or you might find that the DLL containing your component is all that's needed - COM components can store metadata (in a type library in the DLL) if they're derived from IDispatch.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
I'm familiar with 3 ways to access an in-proc COM component -
You can use the COM APIs like CoCreateInstance to access the component.
You can use #import to instantiate the COM component using its type library and also create smart pointers for all its interfaces.
You can use ATL smart pointer classes like CComPtr to access the COM component.
|
|
|
|
|
hi,
But before using coCreateInstance u need to know what all the interfaces and components avaiable, so that u can have CLSID and IID of the the component. Also if i am writting client pgm for a component , what should i do to know abt components before i call CoCreateInstance ??
Is there any way client can find details about ur component apart from importing typelib ??
thanks
|
|
|
|