[RESOLVED] could you say how to send string parameters to a ATL com method
Hi All,
i want to create a ATL com Object, and add this object as a reference to my VB application.
my ATL com should contain 3 parametes. two are input parameters of type string, and an out put parameter of type long.
when i try to pass strings as parameters, the .lib file is being crated and i am able to add it as a reference to my VB application also. but when i try to run the VB application, an error is coming like "Memory out of space".
i am thinking that the strings what i am passing from vb application are not compatible with the parameters in ATL Com.
in ATL com the method is as follows.
Code:
STDMETHODIMP CSampleFun::Method1(char *S1, char *S2, long *n)
{
// TODO: Add your implementation code here
*n=40;
return S_OK;
}
please let me know how to pass string parameters.
Thanks in advance...
Re: could you say how to send string parameters to a ATL com method
You need to pass it as a Pointer object meaning character array obviously...
Re: could you say how to send string parameters to a ATL com method
Hi cheenu_vasan,
i could not get you. could u please explain detailed?
Thanks in advance...
Re: could you say how to send string parameters to a ATL com method
Meaning try using the BSTR datatype which is a predefined string which should be used, since VB is object based instead of Object Oriented ...
Re: could you say how to send string parameters to a ATL com method
Hi cheenu_vasan,
i tried like this...
Code:
STDMETHODIMP CSampleFunction14::Method14(BSTR S1, BSTR S2, long *Num)
{
// TODO: Add your implementation code here
*Num=40;
return S_OK;
}
It is working good. Thanks.....