|
One solution is a custom sort. Basically what you do is link each item's data to the sort key if it is a DWORD (char, int, etc.) or a pointer to the key. Pass in the address of the predicate to SortItems().
Kuphryn
|
|
|
|
|
I keep getting an error 500 returned (I do analyze the return value in the actual code - this is simplified). It does not throw an exception - I am reaching the server and if I download the returned page - I get the server-generated error HTML.
Here is my code:
void SomeClass::SomeFunction()
{
CInternetSession session("TheAgent");
CHttpConnection* server = NULL;
CHttpFile* page;
CString headers;
CString& refheaders=headers;
DWORD dwRet;
DWORD& refdwRet = dwRet;
try
{
server = session.GetHttpConnection("somewhere.com", (INTERNET_PORT)80);
page = server->OpenRequest(CHttpConnection::HTTP_VERB_GET, "http://somewhere.com/index.htm");
headers = "Accept: text/*\r\nUser-Agent: TheAgent\r\n";
page->AddRequestHeaders(refheaders);
page->SendRequest();
page->QueryInfoStatusCode(refdwRet);
if (dwRet == HTTP_STATUS_OK)
MessageBox("SUCCESS");
else
MessageBox("ERROR");
delete page;
delete server;
}
catch (CInternetException* pEx)
{
MessageBox("CATCH");
}
session.Close();
}
My server is running fine. I can take the same URL in the OpenRequest() call and paste it into the browser and the page loads just fine.
|
|
|
|
|
Terry O`Nolley wrote:
page = server->OpenRequest(CHttpConnection::HTTP_VERB_GET, "http://somewhere.com/index.htm");
OpenRequest should take the resourse name not the whole path
page = server->OpenRequest(CHttpConnection::HTTP_VERB_GET, "index.htm")
|
|
|
|
|
THANK YOU!!!!!!!!!!!!! (5)
|
|
|
|
|
I would like to transfer files betwen a client and server that I have created using Socket programming.Please can some one send me the code.
|
|
|
|
|
shals169 wrote:
Please can some one send me the code
oh, you want the entiere code ? nop, sorry, we do not do homework here. but i can help you...
if you want to send an entiere file through sockets, you must use connected sockets.
then, before sending you fil, you can send a description for it. for example, its size, its name...
this way, the receiver will create a consequent named file and a buffer for the socket received datas.
then, you just have to read and write, until the end of file is reached.
you say you created a client and a server, so a consider you know how sockets works and how to use the sock API. But when you say so, it is troubling me because it is like you would like to use THIS client and THIS server. if they are not programmed for that, you won't be able to use them, otherwise you question is useless...
regards,
TOXCCT >>> GEII power
|
|
|
|
|
Check out CodeProject code section. There are examples of numerous non-blocking I/O models.
Kuphryn
|
|
|
|
|
I have a working C++ project which I wish to have encapsulated into a COM dll and not being a C++ developer myself I was wondering how much effort would be involved in something like that (in general)
Basically I just want to provide interfaces into the work being done so .Open(FileName) instead of clicking File-Open in the app
--Tony Archer
"I can build it good, fast and cheap. Pick any two."
|
|
|
|
|
First of all create an ATL/COM project in vc.
and in workspace viewer add an interface to it.
then add a method to the interface.
then write the code behind the method( you cane copy and paste the code from your C++ code!)
It needs a bit hard work;)
Kamyar Souri
Booria CAD/CAM Systems
www.booria.com
|
|
|
|
|
When i tried to modify one of the previous messages i posted (bottom of my own profile), shows -
"This message was not posted using your member account, therefore you cannot delete or modify it"..!!!!! then who..???
is it a B.U.G ????????
I want to change Myself..Can u help me?
|
|
|
|
|
help the man , i neeed his post ..;P pls pls pls
|
|
|
|
|
Does anyone know where I might find a class to parse/read a RSS stream ? Would a simple Xml reader class suffice ? (I know nothing about RSS standards)
I basically want to extract information from an RSS feed.
Thanks.
R.Bischoff .NET, Kommst du mit?
Great Freeware -> Abilon - Rss Reader | Zip Genius | SmartFTP
|
|
|
|
|
You can use any XML parser class, just take a look at the RSS specifications (0.91, 0.91, 2, ..) to make sure you parse the RSS feed correctly.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
|
dows any one know how to open and read the data from an excel file using VC++ / borland c builder?
|
|
|
|
|
i think it is the time to write an article on Excel automation, i wrote that 60%; 40 more.. wait buddy
I want to change Myself..Can u help me?
|
|
|
|
|
MSDN Oct 2001->[Topic}Video Drivers and the I2C Bus->
To support Video Drivers and the I2C Bus, see the current DirectX DDK.
I could not found that topic. Can any one say me exact topic of i2c in DirectX.
|
|
|
|
|
MFC Application gets hang while printing to Acrobat PDFWriter...
Jignesh H Suthar
|
|
|
|
|
Dears:
I want to read some data from file and store it in array. I face some problems, need help from you all^^
1.I use fscanf(...) to read. but i failed to detect the end of line.
2.6.2478916055375
When i read this number using
Long lBuf;
fscanf(pfile, "%ld", &lBuf);
It fails. The result is lBuf=6.
Is there another way to read it?
Thanks^^
|
|
|
|
|
fscanf(pfile, "%l\n", &lBuf); perhaps...
TOXCCT >>> GEII power
|
|
|
|
|
From the following code, why after the program terminates,
m_listSampleName[i] for i=0 to m_nSampleNumber share the same datas?
I have tried to debug, but I don't find out where is the error?
Please help. Thanks a lot before.
m_nSampleNumber = 0;
while(!in.eof())
{
in>>strBuf;
if(strcmp(strBuf,"END"))
{
m_listSampleName[m_nSampleNumber] = strBuf;
m_nSampleNumber++;
}
else
break;
}
|
|
|
|
|
FYI,
char* m_listSampleName[MAX_GENE_NUMBER];
Is the error on the member declaration?
|
|
|
|
|
"%ld" is asking for a long interger value; therefore, it returns an interger value (what you asked for).
double d;
fscanf(pfile,"%f",&d);
result should be d=6.2478916055375.
INTP
|
|
|
|
|
Dear all,
I am new for this site as well as for VC++. I recently got a job
I am working on data compression/decompression. Be very much clear Not file compression/decompression.I am to compress the data cluster by cluster of any harddisk. how can i compress a cluster into bytes or sector? I have no clue about it
All suggestion are welcomeed .
Thanks
snav
|
|
|
|