|
I'm using WinInet to call a Perl script on a webserver but at the moment I do it synchronously. Sometimes this gives real problems as it can take a few seconds for the InternetOpenUrl command to execute. I really want to do this asynchronously but I'm having a lot of trouble understanding how to do this. I don't need to read anything back from the webserver so I'm hoping there's a simple solution to this.
Can anyone help?
Sean O'Connor
http://www.windowsgames.co.uk
|
|
|
|
|
I think I've got it to work using this code but I'd be very grateful if anybody who knows their WinInet could take a look and let me know if I'm doing anything wrong (eg not freeing up things when I should be):
HINTERNET hInternetSession;
HINTERNET hURL;
typedef struct
{
HWND hWindow;
int nStatusList;
HINTERNET hResource;
char szMemo[512];
} REQUEST_CONTEXT;
REQUEST_CONTEXT request_context;
void __stdcall InternetCallbackFunction(HINTERNET hInternet,
DWORD dwContext,
DWORD dwInternetStatus,
LPVOID lpvStatusInformation,
DWORD dwStatusInformationLength)
{
REQUEST_CONTEXT *cpContext;
cpContext= (REQUEST_CONTEXT*)dwContext;
switch (dwInternetStatus)
{
case INTERNET_STATUS_HANDLE_CREATED:
hURL = hInternet;
break;
case INTERNET_STATUS_REQUEST_COMPLETE:
InternetCloseHandle(hURL);
InternetSetStatusCallback(hInternetSession, NULL);
InternetCloseHandle(hInternetSession);
break;
}
}
BOOL SendURL(char* szURL)
{
hInternetSession = InternetOpen("Microsoft Internet Explorer", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_ASYNC);
if (hInternetSession != NULL)
{
InternetSetStatusCallback(hInternetSession, (INTERNET_STATUS_CALLBACK)InternetCallbackFunction);
hURL = InternetOpenUrl(hInternetSession, szURL, NULL, 0, INTERNET_FLAG_RELOAD | INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_NO_CACHE_WRITE, (unsigned long)(&request_context));
return TRUE;
}
return FALSE;
}
-- modified at 7:01 Wednesday 22nd August, 2007
|
|
|
|
|
How can the "work offline" option in internet explorer be changed to "work online" using MFC.
Thanks in advance
|
|
|
|
|
InternetSetOption
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Has INTERNET_OPTION_OFFLINE_MODE been implemented?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Has INTERNET_OPTION_OFFLINE_MODE been implemented?
naah... i am just looking for api InternetSetOffline.. but seems i missed the decalaration!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
and you still in my signature
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
|
As per libtiff mailing list , partial scanlines can' be read ?
Is there any other solution for this? or it can be done?
|
|
|
|
|
Hi
I have a remote PC with a Watchdog application running on it. This is monitoring the health of other applications runing on the PC, and if it detects a problem, will reset the PC. All applications are written in Visual c++, OS is XP home.
Is it possible to send a message over the network to the Watchdog app to instruct it to reset the remote PC?
Will FindWindow() work over a network (using the IP afddress of the remote machine), or is there another way of getting the handle of the Watchdog application?
Thanks for any advice you can give!
Mike
|
|
|
|
|
Mike Winter wrote: I have a remote PC with a Watchdog application running on it. This is monitoring the health of other applications runing on the PC, and if it detects a problem, will reset the PC. All applications are written in Visual c++, OS is XP home.
Is it possible to send a message over the network to the Watchdog app to instruct it to reset the remote PC?
Will FindWindow() work over a network (using the IP afddress of the remote machine), or is there another way of getting the handle of the Watchdog application?
for IPC over network, there are very few method available one of them is SOCKET, Remote Procdeure Call and NamedPipes( i havn't used Named pipes over network).
but Socket is most easy way to communicate over network!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
I got the article to recieve UDP packet done in vc++ from codeproject which is available in this link
http://www.codeproject.com/useritems/sniffer.asp?print=true[^],
but what I need to do is to recieve only Voice UDP packets and needs to store it in a voice format using some codec.
The conversation made in particular Avaya IP phone connected in Private LAN need to be recorded and stored in wav format, can anyone help me out????
Rajeche
|
|
|
|
|
Hi All,
Is there any APIs to get geographical information (like USA, CAlifornia) by pinging to any URL from an MFC application.
1. Assume that there is always access to internet when the application is running.
Sunil
|
|
|
|
|
did you have a look at Google Maps APIs ?
|
|
|
|
|
Thanks. But that is for Java dependant right.
What if i need to use it in MFC?
Sunil
|
|
|
|
|
sunilpv1982 wrote: But that is for Java dependant right.
you're kidding, right ? you did even looked at it, didn't you ?
|
|
|
|
|
got what you meant. But those are for web site development ONLY, if i am right.
mine is an MFC application..
could you provide code snippet in case you have used Google apis in MFC?
Sunil
|
|
|
|
|
sunilpv1982 wrote: What if i need to use it in MFC?
they are just api!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Can any one please tell me, how can i decrypt the WIFI Passkey obtained from a WIFI Profile using the funtion 'WlanGetProfile'.
Msdn suggests a function CryptUnProtectData( ). But there is no documentation on how to use this function in this case.
Thanks in Advance
Arun Krishnan
|
|
|
|
|
Hi,
Does anyone know how can I change the user's bitmap in XP , programatically?
Is there any API for it?
I am creating a user using 'NetUserAdd' API and I want to add a bitmap for that user.
Please help me with this.
Thanks ,
Manasi
|
|
|
|
|
Which Bitmap are you referring to? The bitmap by the user account when you log in? The desktop bitmap according to which user is logged? Other Bitmap?
What have you tried out?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi,
Thanks for the reply.
Im talking about the user bitmap assigned by OS to the user. (That can be seen when we click on start button in Win XP. On start button click, start menu appears and at the top the username is displayed with the user bitmap next to it.)
These bitmaps are stored in the system at location : "C:\Documents and Settings\All Users\Application Data\Microsoft\User Account Pictures\Default
Pictures"
These can be changed in the system as : control panel >> user accounts >> pick an account to change (select an accnt) >> change my picture.
I want to change this picture programatically.
Im creating the user using API 'NetUserAdd'. I could find no method for adding a bitmap using Netxxx APIs.
It would be a great help if you could tell me some method for this.
Thanks,
Manasi
|
|
|
|
|
Im sorry about, but I can't help you with that Bitmap, I don't know how to access there. A way to do it, must exist, but which... sorry
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi,
How can we perform "multipart" file upload from c++ to a servlet?
Most of the articles I have seen so far, load the whole file in memory and then send the whole file in one go.
Is it possible to send the file by parts as is done in Java (Apache Commons File Upload)?
Thanks.
-- modified at 2:02 Wednesday 22nd August, 2007
|
|
|
|
|
If I were to embed a binary file into my resources, how could I execute that file without having to write it to disk first? I know it's possible but have no idea how to do it.
|
|
|
|