Hi, I want to open a http connection, call an asp page, and read the response from that asp page. However, I need to go through a proxy to do this. Could someone show me actual code that would achieve this?? I have searched heaps and only found vague information on how to do it.
1. POST data to an asp page
2. receive the response from the asp page
3. must go through the proxy
f = new fstream("back.html", ios::out);
while (s->ReadString(l) != FALSE)
... // some *f things
this is only a little example from my code ... not even perfect but its working.
u always have to check ur headers and the things that you send.
best way to check is a html browser and a packet sniffer. there are many outta there. with the sniffer u see the original header and data. and could also check your program that it send also the right one.
Hi again, i'm sorry ... i wrote my question very bad.
In fact Arabic countries like Saudia Arabic and ... have difference date with Persian countries like Iran. ok ?
But microsoft designed the Hijri date for both of those.
That is more better for Saudi Arabic, and in fact it is not for Iran, Hijri Ghamari is for Saudia Arabic and Hijri Shamsi is for Iran ...
I wanna convert Ghamari to Shamsi, ok ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
MFC v6 unicode DLLs will NOT load on the 9x platforms.
If you really want to do Unicode on 9x, you can use MSLU (a.k.a. Unicows). It is a GREAT little package that MS did that thunks all the Unicode calls down to ANSI calls on 9x. We use it in our product.
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
In my MFC MDI App, I need to keep the pointer to the CFile object from CArchive in CMyDocument::Serialize (my override). This pointer must point to a valid object after the exit from Serialize, hence the use of a member variable to hold the CFile * returned from CArchive::GetFile()->Duplicate().
My question is: when my CMyDocument object is destroyed, what do I do with the CFile * I hold in my class.
Logically, I would flush the file and close it. closing it poses no problem, but the flush throws an exception. What do I do with the pointer? Do I call
delete on it?
Well it seems the call is somewhat superfluous - it certainly is not needed for my app. However to be on the safe side I determine if the user has admin rights - if so I call the function, otherwise I simply skip the call.
If its really important you could demand admin privelledges for installation and call the function at the time. See KB Q254957[^] for more info.
Hope it helps.
// When a server application is launched stand-alone, it is a good idea
// to update the system registry in case it has been damaged.
// Verify logged in user has a given privelege level
// Returns TRUE upon matching user level
// FALSE upon failure or mismatching user level
//// Possible Authorities:
BOOL CUserInfo::isUserPrivilege(DWORD dwSubAuthority)
HANDLE hToken, hProcess;
hProcess = GetCurrentProcess();
OpenProcessToken(hProcess, TOKEN_QUERY, &hToken); // get the access token of the current process
GetTokenInformation(hToken, TokenGroups, NULL,0, &group_no); // passing 0 queries for the group_no
tgTokens = (TOKEN_GROUPS*)new BYTE[group_no]; // allocate space accordingly
GetTokenInformation(hToken, TokenGroups, tgTokens, group_no, &group_no); //get the real info
SID_IDENTIFIER_AUTHORITY authsid = SECURITY_NT_AUTHORITY; // we'll look for admin priveleges
if(AllocateAndInitializeSid(&authsid, 2, SECURITY_BUILTIN_DOMAIN_RID,
for (int i = 0; i < tgTokens->GroupCount; i++)
if (EqualSid(tgTokens->Groups[i].Sid, admin_psid)) // does this identify an admin?
delete  tgTokens;
return TRUE; // Match
return FALSE; // No match
return FALSE; // Failure opening process / token
I followed the link that you provided in your last post and that helped me out. Now it works and I'm not seeing any abnormalities when I run the application under an unprivileged user account. Thank you very much for taking your time and help me out with this. I really appreciate it.
Now I want to load the document in my app and iterate through all that ActiveX controls in order to set some properties, how can I do that ?
( I have tried with GetSelection adn GetInlineShape, but without success... ).