Leo01010101
asked on
HttpEx component - Get function reports error
I want to use ActiveExperts HttpEx component to catch answers from reverse geocoding service.
I have problem with Get function. I made the following code :
After execution it's appears error:
[C++ Error] ASOCKETLib_TLB.h(25091): E2188 Expression syntax
The content of this file is :
Error is in the line : OLECHECK(this->Get(, (BSTR*)&bstrResponse));
I contacted with ActiveExperts people but they say that there no error in theirs code and problem is with BCB6 programming.
I have problem with Get function. I made the following code :
m_objHttpEx = CoHttpEx::Create();
WideString url_txt = "http://nominatim.openstreetmap.org/reverse?format=xml&lat=54.354671&lon=18.587120&zoom=18&addressdetails=1";
WideString xxl = m_objHttpEx.Get(url_txt.c_bstr());
After execution it's appears error:
[C++ Error] ASOCKETLib_TLB.h(25091): E2188 Expression syntax
The content of this file is :
template <class T> BSTR __fastcall
TCOMIHttpExT<T>::Get(BSTR bstrUrl/*[in]*/)
{
BSTR bstrResponse = 0;
OLECHECK(this->Get(, (BSTR*)&bstrResponse));
return bstrResponse;
}
Error is in the line : OLECHECK(this->Get(, (BSTR*)&bstrResponse));
I contacted with ActiveExperts people but they say that there no error in theirs code and problem is with BCB6 programming.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much for support. It's working. The problem for me could appear when I want to migrate with my software to latest version of C++ Builder where TNMHTTP component will be not available.
Yes that is true...
But there are the commercial components from netmasters you can use...
Also I am thinking to create similar components based on Indy code with modifications for non blocking support...
Done that for a time replacement some years back...
Time to do the same and for those I think...
George.
P.S. Don't forget HTTP error handling... Also be sure that the PC is connected to the network. This can be implemented by reading the local IP. A not connected PC has ALWAYS 127.0.0.1.
But there are the commercial components from netmasters you can use...
Also I am thinking to create similar components based on Indy code with modifications for non blocking support...
Done that for a time replacement some years back...
Time to do the same and for those I think...
George.
P.S. Don't forget HTTP error handling... Also be sure that the PC is connected to the network. This can be implemented by reading the local IP. A not connected PC has ALWAYS 127.0.0.1.
ASKER
I didn't know netmasters components. I have to find it. Year ago I bought license for ActiveExperts ActiveSockets components. But I have problems as I show today with BCB6 implementation.
People from TeamB and especially Remy Lebau (Gambit47) for long time stated that netmasters components are full of bugs.
In my experience they are working almost fine.
Remy is a friend and author also on the magazine I am publishing articles and VERY good.
We have some differences though on socket configuration and using, I am fan of non blocking and he is a fan of thread blocking...
Anyway netmasters is a company and since BCB6 their components (a version of) was present on BCB tool palette. After 2006 version we have to buy them.
George.
In my experience they are working almost fine.
Remy is a friend and author also on the magazine I am publishing articles and VERY good.
We have some differences though on socket configuration and using, I am fan of non blocking and he is a fan of thread blocking...
Anyway netmasters is a company and since BCB6 their components (a version of) was present on BCB tool palette. After 2006 version we have to buy them.
George.
Sorry, the code fragment was inside a class that is why return ""; is there...
You got my pont though...
George.