|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: Passing variant arrays from asp to atl component doesn't work
From: Jianwei Sun (jsun
DDTI.NET)
Date: Wed Feb 18 2004 - 07:02:05 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
You need to query the interface which defines the method "testgateway ",
say if the interace name is "Itest",
You need to do ptrUnknown.QueryInteface(&IItest), and then call that method
on Itest.
Another way of doing that is you can just Declare CComPtr<ITest>,and then
call CoCreateinstance(Clsidfroprogid("clavin.ccalvin")
Like this
{
//.....
CComPtr<ITest> spTest;
spTest.CoCreateinstance(Clsidfroprogid("clavin.ccalvin");
//call any method defined on spTest, like testgateway()
//......
}
Study the book <ATL Internals> ,and it gives you a lot of information.
P.S.
I am not Kim, so I am not the expert, and I also learned a lot from Kim's
posts.
-----Original Message-----
From: Distributed COM-Based Code [mailto:DCOM
DISCUSS.MICROSOFT.COM] On
Behalf Of Katiyar, Subodh (Path)
Sent: Wednesday, February 18, 2004 7:18 AM
To: DCOM
DISCUSS.MICROSOFT.COM
Subject: Re: Passing variant arrays from asp to atl component doesn't work
hi Kim,
i am struck in another problem now.
this invoke method takes progid of another component along with function
name to call like this applicationname.classname:functionname
and then after doing some manipulation on vin param it passes vin ,vout,verr
to component it has to invoke.
can you please guide what should i use for invoking the component i am
trying this.
CComptr<IUnknown>ptrUnknown;
ptrUnknown->Createinstance(Clsidfroprogid("clavin.ccalvin");
now how do i get to invoke the method "testgateway onto this iunknown, i
tried creating a CComQIptr<IDispatch>ptrDispatch,but don't know how to
invoke ,new to it.
could you sujjest some article or a code snippet on invoking an com serevr.
much regards
-----Original Message-----
From: Kim Gräsman [mailto:kim.grasman
LABS2.COM]
Sent: Wednesday, February 18, 2004 1:27 Shaam
To: DCOM
DISCUSS.MICROSOFT.COM
Subject: Re: Passing variant arrays from asp to atl component doesn't work
Hi Subodh,
> vin(0,0)="a"
> vin(0,1)="b"
> vin(0,2)="c"
> .....
> and so on i fill till h
> when i try to call this asp page
> i get -> a e b f c g Vame from dbl dim now what could be misbehaving
> in here?
If you mean the order of the elements, that has to do with the layout of the
SAFEARRAY.
I made things easy on myself, and traversed the array data in order, from
first element to last.
I'll bet if you think about this for a while, you'll be able to get the data
in the order you want.
Alternatively, look into SafeArrayGetElement, which will let you pick out
items one by one, at the cost of some performance (but if your arrays are
fairly small, it won't be a problem).
Hope that helps,
Kim
----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.html
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
DISCLAIMER:
The information contained in this Message is confidential and intended only
for the use of the individual or entity identified. If the reader of this
message is not the intended recipient, any dissemination, distribution or
copying of the information contained in this message is strictly prohibited.
If you received this message in error, please notify the sender immediately.
----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.html
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.html
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]