开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜