|
Has anyone used wininet successfully to write large amounts of data...in my case...a servlet I've used the following code...
CHttpConnection* pServer = NULL;
CHttpFile* pFile = NULL;
pServer = session.GetHttpConnection(szServerName, nPort);
CString strData = "data from a file to send to the server";
pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST, szServletUrl);
pFile->SendRequestEx(strData.GetLength());
pFile->WriteString(strData);
pFile->EndRequest();
// need to get response...
I crash & burn on EndRequest()!
Thanks,
ed
'Love is an obsessive delusion that is cured by marriage.' Dr. Karl Bowman
|
|
|
|
|
Hello, the codegurus around the world.;)
Maybe, directly using WinInet API is easier to write this kind of codes.
I think that you need whil loop (or do - while loop) to check the status
of pFile->SendRequestEx(strData.GetLength()), maybe.
This is mainly because WinInet uses Syncrous(?) - like the blocking socket -
and the result of pFile->SendRequestEx(...) will not come back soon.
But, if we use Asnyrous WinInet, we get the result soon.
You also need the error checking for the main function.
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
Masaaki Onishi wrote:
directly using WinInet API is easier to write this kind of codes
I found a few examples on msdn after posting this. It appears that you are correct. Also looping on write may help. After going through this and seeing the numerous other questions posted that weren't answered, I may have to abstract this out and post an article.
Thanks,
ed
'Love is an obsessive delusion that is cured by marriage.' Dr. Karl Bowman
|
|
|
|
|
Name a few books and good websites to learn 3D programming in visual C++
|
|
|
|
|
It depends on which API you want to use:
if you want to use OpenGL: http://nehe.gamedev.net
book: OpenGL game programming
if you're gonna use DirectX: http://nexe.gamedev.net
i dunno any book
or r ye gonna program 3d without an API? hey anythings possible....
Kuniva
|
|
|
|
|
Hello expert C++ programmers...
I am not an expert anymore.. (or have I ever been?)
Well I program java now, but I need to do a program in C++
I have the stupidest question. I want to know how to make an array, and I have forgotten how. Could anyone plz show me.
I want to declare an array of character arrays.
char myArray[xx][xx];
but... I want to do it dynamically
something like: char myArray** = new char[xx][xx];
but that didnt work, and i cannot figure out how to do it. who better to ask than experts!?
|
|
|
|
|
Tror du är från sverige va??
Du gör så här:
// deklarera en variabel dynamiskt så här:
char* myArray = new char[4]; // 4 eller så många du vill
// sedan töm minnet
delete [] myArray;
If you didn't was a SWEDISH guy:
Declare an array dyn like this:
char* myArray = new char[4]; // 4 or how many elements you want
and then free it like this:
delete[] myArray;
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Rickard Andersson wrote:
Declare an array dyn like this:
char* myArray = new char[4]; // 4 or how many elements you want
and then free it like this:
delete[] myArray;
Yes, I am swedish
That array is no problem to declare. The problem I have is to dynamically delcare and array of arrays. That means I want to declare an array of pointers to a array-pointer.
Declared NOT DYNAMIC, char myArray[10][20];
This will get me an array with 10 arrays each 20 long. The question is how to do it with the new operator.
>> char* myArray = new char[4]; // 4 or how many elements you want
you can declare this char myArray[4];
or char myArray[] = " ";
I am not interested in a singel array of whatever. A twodimensional array dynamically declared.
I hope I have clarified a bit
Happy Christmas, and thanks for your help
// Robert
|
|
|
|
|
char **a = new char*[20];<br><br />
for(i=0;i<=19;i++)<br />
a[i]= new char[10];
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
suckup
weeeeeeeeeeeeeeeeeeeeeeeeeeeeeee lol i'm just crazy, i didn't mean that, i just had to say that, it sounded funny in my head! sorry to've wasted your time i wouldn't know how to do it either!
Kuniva
|
|
|
|
|
Here's how:
int X = some_calculated_number();
int Y = some_other_calculated_number();
char** myArray = new char*[X];
for (int i = 0; i < X; i++)
myArray[i] = new char[Y];
Regards,
Alvaro
|
|
|
|
|
|
I need to get the time a certain file was last modified/accessed.
I'm guessing i can use CFileFind for this?
CFileFind::GetLastAccessTime(&CTime) ????
how do i use it? how do i set the filename???
+ i need to get the time in a CString
CFileFind.Format(blablabla) ???
Anyone know this?
Thanks
Kuniva
|
|
|
|
|
Use CFile::GetStatus().
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
woohoo it works!! thanks!
Kuniva
|
|
|
|
|
How can I determine from within of my programm wether the particular process is running or not in my system when I know only name of exe file?
|
|
|
|
|
Perhaps you could enumerate all processes using EnumProcesses() and inspect their filenames using GetModuleFileNameEx().
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
|
Hi,
My MFC dialog app, for initialisation, needs to load and process a large file, and operation which takes about 20 seconds.
I decided to make a new dialog class, CLoad. This dialog class implements worker threads to do the load, and displays a status bar for the user.
In CMyApp::InitInstance():
CLoad load_dlg;
CMainDlg dlg;
m_pMainWnd = &load_dlg;
load_dlg.DoModal();
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK) .......
Basically, i DoModal() on my loading dialog, i call EndDialog() from within that dialog to close it when the loading is finished. Then, the second (main) dialog should be shown. But the dlg.DoModal() returns immediately and the dialog is not shown. Is this because I'm closing the main dialog with EndDialog() ?
I really don't know why my dialog is not showing.
Any ideas?
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
If you want to show a dialog box before the main dialog box you CAN create a CLoad object in the OnInitDialog(...) but do it do the call before every other inits:
BOOL CMyDlg::OnInitDialog();
{
// Show a dialog before the main dialog appears
CLoad load_dlg;
int ret = load_dlg.DoModal();
if( ret == IDOK) // The user closed the dialog by hitting button with ID: IDOK
{
// do something or do nothihng with the return value
}
// Here comes all other stuff
LoadIcon(m_hIcon, TRUE);
...
return TRUE;
}
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Does anyone know the maximum number of files allowed in a single directory under win95 and under NT? I tried to find this in MSDN, MS Knowledge base etc, but I couldn't find it. Is there even a limit? I know there is a maximum number of files allowed in a root dir, but is there a maximum for any directory under the root? If there is no maximum number of files, is there a rough number of files I should allow the user to create under a directory (isues of stability etc.) My program reads a database and allows the users to create a backup of that database, but I want to watch them and make sure they don't exceed either a maximum number of allowed files, or a number of recommened files to keep the system stable.
|
|
|
|
|
I don't think there is a limit to the number of files in a directory. Each directory is really just a 'special' file. We had an application that saved some medical billing information in simple text files in a directory on a Windows NT server. After a few years there were so many files you would not want to try to list them (like with a DIR command) 'cause it would just run and run, but the application that used them still could select a file by name quickly. We finally decided this data would be better stored in an SQL table and made that change.
|
|
|
|
|
Hi All,
How to Add strings in a ListBox using API's in SDK?
Thanks in Advance
Sangeetha
|
|
|
|
|
There is a message you can send, something like LB_ADDSTRING.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Also LB_INSERTSTRING.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|