|
hi ,
IE is an activex control container ( As it is from MS ). Where as Mozilla is a open source initiative. Mozilla browser is not an Ax control container.
Besides Mozilla browser is x-platform browser. there is no equivalent of COM/OLE/ActiveX in linux.
Hope this helps
Praseed Pai
www.codeproject.com
|
|
|
|
|
hello !
i just want to know that a component built using STA cant be used in an MTA environment.
And if i want to do this , how this can be done?
the_sikander
|
|
|
|
|
I am looking for a tutorial on making a COM dll in VC++. I've searched Code Project articles and the web at large without success.
Can anyone point me toward a resource?
<signature>
It's good to live,
Josef Wainz
Software Developer
|
|
|
|
|
|
Thanks for the article pointer. I still find the Code Project menus less than intuitive. I did a search on articles with the criteria of 'COM dll tutorial' and no articles were found.
I spend so much time here, I need to spend some time learning how to better navigate the site.
<signature>
It's good to live,
Josef Wainz
Software Developer
|
|
|
|
|
Using the search system is very difficult IMO. I go directly to a category which I believe matches what I want to find, and do CTRL+F on that page, or I google for it. Most of the times I end up here at CP using google.
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
Hi,
I am automating Word 2000 and I want to disable the "Ctrl C" keyboard functionality. (Using VBA I am successful in disabling the "Ctrl+C" by doing this - "Application.FindKey(BuildKeyCode(wdKeyControl, wdKeyC)).Disable")
I am using the following C++ automation code which gives me the DISP_E_EXCEPTION error code on IDispatch::Invoke for "Disable" method ("AutoWrap" function below is a wrapper around IDispatch::Invoke). Here is my C++ code:
parm1.vt = VT_I4;
parm1.lVal = wdKeyControl;
parm2.vt = VT_I4;
parm2.lVal = wdKeyC;
VariantClear(&result);
AutoWrap(DISPATCH_METHOD, &result, pWdApp, L"BuildKeyCode",2,parm2,parm1);
parm1.vt = VT_I4;
parm1.lVal = result.lVal;
VariantClear(&result);
AutoWrap(DISPATCH_PROPERTYGET , &result, pWdApp, L"FindKey", 1,parm1);
pWdKey = result.pdispVal;
AutoWrap(DISPATCH_METHOD, NULL,pWdKey , L"Disable", 0);
Error :
"This method or property is not available because this document is in another application"
I will appreciate any help on this.
Thanks.
Vishal More
|
|
|
|
|
Hello,
I just want to show up an RTF report file previously created using automation into a non-modal dialog.
CRichText activeX control does not work for this purpose as shows tables, headers etc... diferent from what is into RTF file.
I've read about Active Document and the ability to use MS Word seamessly into my aplication.
I've downloaded a couple of examples and read a bit about (hard to implement technology, my aplication doesn´t support (i.e. didn't check active container support in wizard when created).
It looks that MS Word (or any other active document) takes control of the aplication (menus, look & feel, etc..)
I would like to avoid using active document technology as looks hard to implement from scrach. But if necessary, and before start learning it. I would like to know if active document will allow me to hide *ALL* menu, rules and hassle around the document itself and will let me put it into a dialog with a just print button.
I would really appreciate any comment, help.
Regards,
Carlos.
|
|
|
|
|
i m using PWS on win98. i have made a COM object and then i used it in my ASP page. But when i used my COM object in ASP after that i can't build same COM object again without restarting my machine.it gives linkin error "Can't open .dll to change". Any one can help me so that i dont have to restart my machine.
and second question is how can i return multiple values by reference from COM object to ASP page when i use it in ASP.
any one has any idea?????
|
|
|
|
|
I have a vague memory that this does not work on Win98 but on other platforms it does:
1) Configure your ASP App as "Isolated Process" in the IIS settings.
2) Stop the Web Server
3) "Unload" the application in the IIS Application Properties
4) Compile
5) Start Web Server
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
|
Excellent post Mike!
psacake.com .... Great domain name
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Guyz,
I remember working with C++ COM, I could use QueryInterface to find whether an interface is supported in a component. Is there a similar mechanism in VB too? If not what would be a best way to do.
\Thnx!
|
|
|
|
|
LOL,
This comes along with a question of mine that probably can answer your question
If i'm not crazy, it should be possible to query for interfaces using CType(), and my question is related to CType.
Say i have a COM object with multiple inherited interfaces like:
interface IFoo : IDispach
{
.. blah ...
}
interface IOtherFoo : IFoo
{
.. blah ...
}
Now, in some way i have a method somewhere that returns an IFoo object:
[id(4), propget] Foo([out, retval] IFoo ** rvIFoo);
now, in VB i do Set MyObj = someobject.Foo . Then later i do Set MyObj2 = CType(MyObj, IOtherFoo) . Will MyObj2 be the IOtherFoo interface of the same instance as MyObj ?
PS: From searches i've done, CType() seems to be only valid in VB.NET.
Is there an equivalent to CType() in VB 6.0 ?
|
|
|
|
|
hi
QueryInterface is available in VB.
Consider the CoClass below with two interfaces
coclass Calc<br />
{<br />
[default] interface Scientific;<br />
interface General;<br />
};
Now in Vb
Dim objScientific as new Calc.Scientific<br />
Dim objGeneral as Calc.General<br />
<br />
set objGeneral = objScientific
Here the line set objGeneral = objScientific will Queryinterface objScientific for objGeneral and objGeneral will get a valid pointer if it is available in the CoClass.
Rgds...mil10
|
|
|
|
|
Whoah .. thx a lot for the information
But if i may, let me be more specific.
1) From your sample, what if i do:
Dim objGeneral as new Calc.General<br />
Dim objScientific as Calc.Scientific<br />
<br />
Set objScientific = objGeneral
Would it still be working ?
2) What if i dont have a CoClass for my object, but only an interface:
interface IScientific : IGeneral<br />
{<br />
... blah ...<br />
}<br />
<br />
interface ICalc : IDispatch<br />
{<br />
[id(1),propget] STDMETHOD(General)([out,retval] IGeneral **rvGeneral);<br />
}<br />
<br />
coclass Calc<br />
{<br />
[default] interface ICalc;<br />
}
,
now in my Calc coclass, i instantiate an IScientific object and i return an IGeneral pointer, which, if i understand well, return a shorter vTable. Then i run the Vb code in section 1. Will Vb do a QueryInterface on objGeneral to get an objScientific interface pointer ?
I guess i should explain what i want to do more specificly.
I would like to have 2 layers of information on a specific object, but i dont want someone getting access to an objGeneral to be able to cast it and make an objScientific with it. (hoping i am clear here).
Maybe what i need to use containment or aggregation.
I want simple users to be able to view certain object properties, while allowing admins to view more properties and have access to Modify() and Create() types of functions.
|
|
|
|
|
hi man..
1. Would it still be working ?
yes of course it will work.
if a coclass say x
coclass x<br />
{<br />
[default] interface interface1;<br />
interface interface2;<br />
}
contains more than one interface then through VB we can directly say "new" only to the default interface. then thru that interface we can queryinterface the remaining interfaces in that coclass. Also in a coclass there shud be only one IDispatch implimented interface. if there is more than one interface having IDispatch as base , then u shud use COM_INTERFACE_ENTRY2(IDispatch,IURInterface) macro to specify the default interface and the other interface can't be invoked thru dispid - i mean thru idispath->invoke.
2) What if i dont have a CoClass for my object, but only an interface:
interface IScientific : IGeneral
{
... blah ...
}
You can not have a com interface without a coclass. It is the basic COM rule.
Then about ur requirement, if i understud u in the right way,
It is not possible to make such a role based security over com interfaces. Once a client got an inteface, he can access all the remaining interfaces in that coclass. Otherwise if ur ok to go for com+ then u can set role based security.
An adjustment that we can do (not a concrete solution for the prblm) is use the hidden tag in IDL. Then vb's like com object browsers can not display it. so the user will not come to know abt such an interface. but if he take the IDL of the dll, then everything will be visible.
hope this will help.
rgds..mil10
|
|
|
|
|
Regarding the option of not having a coclass, i have to disagree with you.
You are right that i need a coclass to start with. Any com server will require at least 1 coclass. But the way i understand it the purpose of coclass is to allow instantiation of an object.
in my examples up there, with vb i could do 'Set myobj = new interface1' or 'Set myobj = new interface2'. But it would not be possible to do 'Set mycalc = new IScientific'
But, this doesnt prevent from having a method in interface1 that returns a reference to an IGeneral or IScientific instance.
Am i making sense ?
DarkByte
|
|
|
|
|
hi
I am sticking with my previous post.
Ur understanding of a coclass is correct. It is to allow instantiation of an object. But u can acces an interface only after instantiating an object. So without a coclass there is no existance for an interfce. An interface is below the coclass in the hierarchy. It is just like a member function comes under its class. Without a class there is no existance/meaning in a member function right?
hope this will make things more clear..
await ur opinion.
rgds..mil10
|
|
|
|
|
Yup, i think we both understand the same thing regarding coclass uses.
What i'm still not 100% convinced (althought i could do some test and make myself a possibly false opinion) is regarding QueryInterface and/or its use in VB.
Now, with your example for IGeneral and IScientific, if i understand correctly, it doesnt matter how we acquired and interface pointer, if the instance behind the pointer exposes more than 1 interface, it becomes possible to reference that instance under any of its exposed interfaces. Meaning that if i get an IGeneral interface pointer to an IScientific instance, its always possible from code to access its IScientific interface by using QueryInterface(), or using the method shown earlier in VB.
BTW: It's a pleasure talking with someone that has knowledge. I hope i can be of service some day.
DarkByte
|
|
|
|
|
Ok man, So the remaining doubt is regarding the queryinterface in vb. Just give me ur email id i will send you a sample with an ATL com and a vb client which queryinterfaces for remaining Interfaces in the CoClass. It will clear all ur doubts.
Yes. It doesn't matter how we aquired the interface pointer, it is possible to Queryintface for the remaining Interfaces in the same coclass. That is the way com impliment an interface. Did you forget the fact that, all com interface should be derived from IUnknown and IUnknown contains the QuryInterface() method to get the remaining interfaces of the same object.
Thanks for the compliments, it was nice to talk with you.
rgds..mil10
|
|
|
|
|
I have multiple instances of an application running, each using a different .ini file with a different caption. Each is connected to a different database. I need to connect to a specific instance from VBScript.
Using GetObject(, "MyProg.Document") I can connect to a running version - but can I connect to the Train version when one is Prodn and the other Train?
Using VC++ 6.0 and MFC
Sara
|
|
|
|
|
Hi Sara,
I've been trying to find a way to overcome your kind of problem but cannot think of any solutions. Wish someone can help you.
DarkByte.
|
|
|
|
|
I've been thinking again about your problem and i might have some pointers that could lead you to a solution, i'm not assuming my solution is right but could help get the right solution.
Instead of using GetObject(, "MyProg.Document") which will take the first (or last) active instance. Create a new CoClass that can return either an "MyProg.ProdDocument" or "MyProg.TrainDocument" .. then from any of these, get the pointer to the Document.
When you start the application as Prod, have it RegisterActiveObject(<classid of="" proddocument=""> ... etc) and if you start it as Train, have it RegisterActiveObject(<classid of="" traindocument=""> ... etc)
Then, have both ProdDocument and TrainDocument interfaces containing a method getter for the Active document that would be returned if you used "MyProg.Document"
Well, not sure if this is Clear .. but i hope it helps.
[edit]That is assuming that you have access to source, or at least can get source modified for "MyProg"[/edit]
|
|
|
|
|
Hello Friends !
I am developing a COM component which reads a structured storage file,which consists of no of sub-storages,
I want is to open the structured storage and get a count of
sub-storages in it.also i want to get the name of the first sub-storage...
Any one would please suggest how do i achieve this !
Thanks In Advance
|
|
|
|