|
I have one module in Labview and other one in MFC ,how i could integrate MFC with Labview.
|
|
|
|
|
i have used [in,out] in my COM method but when i call my method from ASP it gives error "Type mismatch: methodname" . i have also used CInt() for my int variables , but now it shows nothin when i respons.write my variable.
e.g
In COM
power([in]int num,[in] int pNum,[in,out] int *res)
In ASP , i calling it
myObj.power num1,num2,CInt(num3) 'this gets nothin in num3
if i go like that
myObj.power num1,num2,num3 'gives error Type Mis-match:power
aby idea abt this????
|
|
|
|
|
Ok, just making sure here:
The reason you make it [in,out] is because you provide some information and expect possible different information back, right ?
If not, if all you want is to return a value, you should use [out] only, althought for int values it shouldnt make much of a difference. If you return only 1 value, i suggest you use [out, retval], in which case, you can assign to a variable like: var = myObj.power(num1, num2).
If you use CInt(num3), ASP actually creates a new, invisible, variable to store the conversion and your returned value isnt accessible, even if it is actually returned somewhere.
what you might also need is the equivalent of addressof(var), or &var in your script engine. so you might have to do something like myObj.power num1, num2, addressof(num3). I'm not sure exactly if this is a requirement but i expose it just in case.
by the way, which scripting language are you using ? VBScript or JavaScript ?
|
|
|
|
|
Yes , u r right, i want to provide some info to method and get processed info from method. i have used [out,retval] , it works fine but i want to get multiple variables out of method that's y using [in,out]. i m using VB Script. well is there any addressof(var) operator exists in VB script. if so do tell me or any equivalent function to do this.
|
|
|
|
|
Hmmmmm, VBScript...
Ok, do you declare your variables before using them ?
Dim num3 as Integer
myObj.power 2, 3, num3
this should theoreticly work. Reason should be, if you dont declare your variable, the variable is defined as type Variant which is not what myObj.power expects.
|
|
|
|
|
hi
If u want to return a value back to asp from an interface method, that variable shud b of type VARIANT type. There is no other go. So the IDL shuld be [in, out] VARIANT *pOut1, [in, out] VARIANT *pOut2, ..., ... for all the variables u need to return a value back to asp. This way u can have any number of in-out parameters for an interface method.
rgds.. mil10
|
|
|
|
|
i wrote an active control using ATL,and put it in webpage,it shows
well in IE6.0 but,it can not show itself in mozilla 1.6 ,that's why?
generally says i am not familar with mozilla
thanks for any help
|
|
|
|
|
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
|
|
|
|
|