Async calls to WebService in MFC

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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 :)

.



Relevant Pages

  • Parameter got swapped
    ... I am new to webservice. ... accepts username and password, When I got the response, the username ... * you may not use this file except in compliance with the License. ... public String sayHelloWorld{ ...
    (comp.lang.java.softwaretools)
  • Async calls to WebService in MFC
    ... I use a webservice over the net which is scripted in VB.Net. ... If the string is empty, ... username and/or password. ... GetSession (BSTR username, BSTR password, BSTR** Results); ...
    (microsoft.public.win32.programmer.networks)
  • Re: Converting a LPSTR* to BSTR* and back again.
    ... int ListItem(int itemNumber, ref string buffer, int tabbed, int ... you may consider the following code to convert BSTR ANSI (I ... // Convert an ANSI string to a BSTR ...
    (microsoft.public.vc.mfc)
  • Re: Converting a LPSTR* to BSTR* and back again.
    ... int ListItem(int itemNumber, ref string buffer, int tabbed, int ... you may consider the following code to convert BSTR ANSI (I ... // Convert an ANSI string to a BSTR ...
    (microsoft.public.vc.mfc)
  • RE: how to create a Net assembly as replacement for existing COM compo
    ... COM typelib to my class, interface and assembly as well as DispIDs. ... BSTR p_sChassisType, ... Sub CalibrationTestsFinished(ByVal p_sCaller As String, ...
    (microsoft.public.dotnet.framework.interop)