Async calls to WebService in MFC
- From: leonard.guillaume@xxxxxxxxx
- Date: 21 Mar 2006 11:37:53 -0800
Hey guys,
I use a webservice over the net which is scripted in VB.Net. This web
service receives a username and a password and returns a string
structure with multiples infos. If the string is empty, I had the wrong
username and/or password. Pretty simple isn't?
Ok now the problem is a bit more complex. I'm using an MFC client to
connect to these web services, and since they're on the internet,
there's a delay between sending the data and receiving an answer. I
don't know really how I can tell me client to "wait for the string".
The wrapper MFC created for the webservice returns a HRESULT that tells
if the webservice was found, but not if I was authentificated.
Here's the prototype :
GetSession (BSTR username, BSTR password, BSTR** Results);
I'm just throwing a BSTR pointer to GetSession into it's 3rd parameter
and it should write the results there. But it doesn't. My BSTR is empty
and not initialized (no new has been made). Let's say this is how it
works :
BSTR* bstrResults;
GetSession("leonard.guillaume", "GoogleGroups!", &bstrResults);
if (!bstrResults)
AfxMessageBox("Couldn't get Results");
The MessageBox always pop and my bstrResults adress is still
0x00000000...well nothing.
So I'm thinking, I might need an async function, because once the call
has been made to GetSession, the client doesn't wait the answer and
goes straight to the if and shows the MessageBox.
I'm a newbie into Async and Internet stuff under non-managed stuff (not
..Net), so any help would be really appreciated...I've been searching
for hours on how to do that and it's depressing :(
Thank you,
Guillaume :)
.
- Prev by Date: Setting non-rectangular clipping region without leaving gaps
- Next by Date: Re: How to share a folder?
- Previous by thread: Setting non-rectangular clipping region without leaving gaps
- Next by thread: RE: OnPaint() Problem
- Index(es):
Relevant Pages
|