Webmethod call from a C++ ATL console Application
I am trying to call a .net webservice from a C++ ATL console Application. This is how my webmethod looks like:
[WebMethod]
public string[] GetFieryIP(string companyname)
{
IpAddress = new string[]{"1","2","3","4"};
return IpAddress;
}
In the c++ application, I have added a web reference.This is how i am accessing the webmethod:
BSTR str = SysAllocString(L"");
BSTR *ptr = new BSTR[4];
int ptr1;
HRESULT hr = ws.GetFieryIP(str, &ptr, &ptr1);
ws is the webs开发者_运维知识库ervice proxy.
Is this correct? If yes, How do i get the IpAddress from the *ptr. I am new to C++ and dont have much idea abt pointers and COM.Please help.
精彩评论