-
October 15th, 2010, 10:15 AM
#1
How send data to my server?
Dear sirs,
I am trying use one code for transfer some data from my C++ dll to my server(website) and return response from server to dll again.
For example i send one serial number to server and server return another confirmation number to my dll.
I am using below code and I can read data from my server by BOOL bRead = InternetReadFile(webResult, szwebBuffer, dwBytes, &dwBytesActual);
i want know how I can send data to my server?
Which function I can use?
my code is same below:
HINTERNET webHANDLE = InternetOpen(strTopic.c_str(), 0, "0", "0", 0);
HINTERNET webResult = InternetOpenUrlA(webHANDLE, strHttpReq.c_str(), "0", 0, -2080374528, 0);
if ( webResult )
{
char * szwebBuffer[1024];
memset(szwebBuffer,0,sizeof(szwebBuffer));
DWORD dwBytes = sizeof(szwebBuffer);
DWORD dwBytesActual = 0;
BOOL bRead = InternetReadFile(webResult, szwebBuffer, dwBytes, &dwBytesActual);
InternetCloseHandle(webResult);
gpVar->strAccNumber = (char*)szwebBuffer;
}
Thanks.
-
October 15th, 2010, 11:02 AM
#2
Re: How send data to my server?
It will depend on how the page is able to obtain those. For example, the data can be provided as GET parameters passed as a part of the URL.
Best regards,
Igor
-
October 15th, 2010, 11:07 AM
#3
Re: How send data to my server?
Dear Igor,
Thank you for your response.
I want send one number to my server.
So I can send that by this: HINTERNET InternetOpenUrl(
__in HINTERNET hInternet,
__in LPCTSTR lpszUrl,
__in LPCTSTR lpszHeaders,
__in DWORD dwHeadersLength,
__in DWORD dwFlags,
__in DWORD_PTR dwContext
);
and using this LPCTSTR lpszHeaders, for sending my number?
Thanks.
-
October 15th, 2010, 12:04 PM
#4
Re: How send data to my server?
What is the way the page allows to provide the data? If GET request is okay, lpszUrl will do for your purpose. I kinda repeat myself, don't you find that?
Best regards,
Igor
-
October 15th, 2010, 12:24 PM
#5
Re: How send data to my server?
Dear Igor,
Thanks, I solved that.
thanks Again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|