|
Me Not!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
i am reading some text from the selected file, then when i push a button i want to insert some data to database (ADO), but cant do. There is an error occured.
i tested : when i dont read data from a file, i can use data functions well.
I even close CStdioFile and delete its pointer.
Can anybody help?
|
|
|
|
|
ugur_basak wrote:
There is an error occured.
I give up. What's the error?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Oh come on David Use your ESP, or lacking that, take a wild guess. You may just hit upon the correct solution.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
the error:
Runtime Error!
Program:..... .exe
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.
---
the error is about this sentence.
pConnectRead->Open(commandString, connectionString, adOpenStatic, adLockReadOnly, adCmdText);
can this be helpfull to GUESS the solution.
|
|
|
|
|
ugur_basak wrote:
Runtime Error!
Program:..... .exe
Usually this type of error occur due to IMproper/unreferenced Memory allocation.
ugur_basak wrote:
pConnectRead->Open(commandString, connectionString, adOpenStatic, adLockReadOnly, adCmdText);
have you checked that is pConnectRead hold valid memory or any of it args!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
CFileDialog fileDlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_PATHMUSTEXIST, NULL, this);
if(fileDlg.DoModal()==IDOK)
{
sSelectedFile = fileDlg.GetPathName();
}
I guess the problem is about the above code, when i use this dialog window the error happens. But if i use the files path name by editing the editbox there is no error.
But still cannot use this dialog
|
|
|
|
|
At the end i find the solution. its about an ugly problem. When we use CFileDialog without OFN_NOCHANGEDIR, it doesnt release some of the handles, and system crashes...
dlg = new CFileDialog(FALSE, NULL, NULL, OFN_HIDEREADONLY | OFN_NOCHANGEDIR);
this solves everything...
|
|
|
|
|
I need some help in codding ActiveX container. Short description : Microsoft Visual Studio 2003 and other vsersion (6,7) , includes sample TstCon - a sample of ActiveX Container. When I place control and than delete it or open new document, this program hang up every time when i close it.
I modified ContainerItem method OnDelete()... after pItem->Delete() i put delete(pItem); its all works under win2k... but... in 98SE,XP after deleting control, when i try to insert new control an error occured "Failed to connect.Link may be broken".
So does any one knows how to solve this, and force it to work correctly.
Thanks.
|
|
|
|
|
I have a dialog based application which runs fine on NT and 2000. However, it doesnt work under XP. I have done some traces, the application gets invoked, but the main dialog window does not appear. Any ideas?
Man Learns from History that he never learns from History
|
|
|
|
|
May be its problem with controls (especialy when using CustomCtrl) in your dialog.
|
|
|
|
|
Create the dialog with the DS_NOFAILCREATE style. If that works, then you know there is a control-related issue. This is normally because an ActiveX control is being used that does not exist, or has not been registered, on the target machine.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
hiho@ll
i'm using this http://www.codeproject.com/library/lyoulhttpclient.asp http client to upload a file (like the example)
what i do:
i'm uploading a few text files, not very big, 1 or 2kB
the problem:
i can upload (to my self programmed php script) 2 files
the third file doesn't work
HttpSendRequestExA (on line 639 in the http client above) throws a exception after a few minutes! (i get error code 12002 ERROR_WINHTTP_TIMEOUT)
The Apache doesn't get a request! in the access.log i only see the first two requests
the flags for the connection are NTERNET_FLAG_HYPERLINK | INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_UI | INTERNET_FLAG_RESYNCHRONIZE | INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_RELOAD
1. anybody else had similar problems with HttpSendRequestEx (and what solved/caused the problem?)
2. anybody has an idea what's causing the problem
3. solutions/workarounds?
4. i don't know how to analyze the problem, so know what causes the problem
how can i analyze what HttpSendRequestExA does to know what causes the problem?
5. may it helps if anyone explains how to use HttpSendRequestExA (i mean, making a connection, working with the connection, closing the connection (just like a function list/ maybe the connection isn't closed and i don't know which function does this))
thx@ll
|
|
|
|
|
i tried the example from the msdn and i get an error 997 Overlapped I/O operation is in progress
the code:
BOOL UploadToURL::Test(TCHAR *upFile){
INTERNET_BUFFERS BufferIn = {0};
DWORD dwBytesRead;
DWORD dwBytesWritten;
BYTE pBuffer[1024]; // Read from file in 1K chunks
BOOL bRead, bRet;
HINTERNET hConnect=NULL,hInternet=NULL;
hInternet=InternetOpen("User Agent",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,INTERNET_FLAG_ASYNC);
hConnect=InternetConnect(hInternet,"127.0.0.1",INTERNET_DEFAULT_HTTP_PORT,NULL,NULL,INTERNET_SERVICE_HTTP,0,NULL);
BufferIn.dwStructSize = sizeof( INTERNET_BUFFERS );
HINTERNET hRequest = HttpOpenRequest (hConnect, "PUT",
"/upload.php", NULL, NULL, NULL, 0, 0);
if (!hRequest)
{
printf("Failed to open request handle: %lu\n", GetLastError ());
return FALSE;
}
HANDLE hFile = CreateFile (upFile, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
printf("\nFailed to open local file %s.", upFile);
return FALSE;
}
BufferIn.dwBufferTotal = GetFileSize (hFile, NULL);
printf ("File size is %d\n", BufferIn.dwBufferTotal );
if(!HttpSendRequestEx( hRequest, &BufferIn, NULL, HSR_INITIATE, 0))
{
DWORD d=GetLastError();
printf( "Error on HttpSendRequestEx %lu\n",d);
return FALSE;
}
DWORD sum = 0;
do
{
if (!(bRead = ReadFile (hFile, pBuffer, sizeof(pBuffer),
&dwBytesRead, NULL)))
{
printf ("\nReadFile failed on buffer %lu.",GetLastError());
break;
}
if (!(bRet=InternetWriteFile( hRequest, pBuffer, dwBytesRead,
&dwBytesWritten)))
{
printf ("\nInternetWriteFile failed %lu", GetLastError());
break;
}
sum += dwBytesWritten;
}
while (dwBytesRead == sizeof(pBuffer)) ;
CloseHandle (hFile);
printf ("Actual written bytes: %d\n", sum);
if(!HttpEndRequest(hRequest, NULL, 0, 0))
{
printf( "Error on HttpEndRequest %lu \n", GetLastError());
return FALSE;
}
return TRUE;
}
but this time i get the error in the first try!
|
|
|
|
|
|
|
Hi,
Or is there any way to get the IP address of a computer in a local network using the MAC address?
Cheers,
Thanks.
|
|
|
|
|
i'm not the network expert, but try to search for RARP (reverse address resolution protocol) maybe you find a rarp client or something
|
|
|
|
|
Hi every one,
Is there any way to send a string to a computer in a local network?
But the network hasn't any configurations.
And I have not the computer name or IP address to send.
Or is there any way to send a string to a computer using mac address?
(In VC++ or other labguages?)
Cheers,
Thanks.
|
|
|
|
|
My goal is to prevent any navigation on any browser different than IE.
Hence, I'm trying to deny the use of port 80 to any programs different than Iexplorer.exe
Any advice or help would be greatly appreciated as I have some hard time finding samples covering that kind of functionnality.
PS: yes it is dracstic but that's the way it is lol
PSS: ThatsAlok you're a guru man!! I'm a fan
|
|
|
|
|
I want to set color of string and move that string in cosole but i don't know.Who know to help me.
Thank you.
|
|
|
|
|
Hello
We Believe in Excellence
|
|
|
|
|
Go to "The Soapbox".
Don't try it, just do it!
|
|
|
|
|
how do i sense ctrl+C in a dialog based application?
|
|
|
|
|
|