|
Hi,
I am working on mfc and my application has chat module in which i wanat to send file through server.
I have been able to select the file to be send. I need to know what to do after I select the path of the sile to be send.
Please help me.
Thanks In Advance.
Dhiraj Kumar Ssaini
|
|
|
|
|
Open a TCP/IP connection through two users which are sender and reciever.
Sender should open the selected file in binary mode read it and write it through socket. And reciever should read incoming data from socket and write it to it's local file.
Server should be used only to connect these together. You should not send file through server, cause it costs too much and unneccesarry...
|
|
|
|
|
I got it but my requirement is such that i have to send it to the http. Is there any method through which i can achieve it like POST etc.
Thnaks
|
|
|
|
|
u can use the CHttpConnection class.
create a CInternetSession class object to create the CHttpConnection object and then use its members.
Prasann
|
|
|
|
|
Can u help me out with some code as i havent used it at all.
Thanks
|
|
|
|
|
http://www.experts-exchange.com/Programming/System/Windows__Programming/MFC/Q_20257576.html">http://www.experts-exchange.com/Programming/System/Windows__Programming/MFC/Q_20257576.html
|
|
|
|
|
All these links are paid ones and i dont have an account. Can you help me with some other links
Thanks
|
|
|
|
|
Hello everyone,
Here is my code. My code is a client application which uses WinHttp to access http://connect.microsoft.com/dashboard, I tested with IE only if valid .Net Passport account is provided, the authentication could pass, or else can not access the service.
But I tested my below code, no matter I provide valie or invalid .Net Passport account, each time 200 OK is returned. Anyone has ideas why it always returns 200 OK?
#include <windows.h>
#include <Winhttp.h>
#include <stdio.h>
#pragma comment(lib,"Winhttp.lib")
void WinHttpAuthSample()
{
DWORD dwStatusCode = 0;
DWORD dwLastStatus = 0;
DWORD dwSize = sizeof(DWORD);
BOOL bResults = FALSE;
BOOL bDone = FALSE;
DWORD dwProxyAuthScheme = 0;
HINTERNET hSession = NULL,
hConnect = NULL,
hRequest = NULL;
hSession = WinHttpOpen( L"WinHTTP Example/1.0",
WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
WINHTTP_NO_PROXY_NAME,
WINHTTP_NO_PROXY_BYPASS, 0 );
INTERNET_PORT nPort = INTERNET_DEFAULT_HTTPS_PORT;
if( hSession )
hConnect = WinHttpConnect( hSession,
L"connect.microsoft.com",
nPort, 0 );
if( hConnect )
hRequest = WinHttpOpenRequest( hConnect,
L"GET",
L"/dashboard",
NULL,
WINHTTP_NO_REFERER,
WINHTTP_DEFAULT_ACCEPT_TYPES,
WINHTTP_FLAG_SECURE);
if( hRequest == NULL )
bDone = TRUE;
while( !bDone )
{
if( dwProxyAuthScheme != 0 )
bResults = WinHttpSetCredentials( hRequest,
WINHTTP_AUTH_TARGET_PROXY,
dwProxyAuthScheme,
L"username@hotmail.com",
L"passport password",
NULL );
bResults = WinHttpSendRequest( hRequest,
WINHTTP_NO_ADDITIONAL_HEADERS,
0,
WINHTTP_NO_REQUEST_DATA,
0,
0,
0 );
if( bResults )
bResults = WinHttpReceiveResponse( hRequest, NULL );
if( !bResults && GetLastError( ) == ERROR_WINHTTP_RESEND_REQUEST)
continue;
if( bResults )
bResults = WinHttpQueryHeaders( hRequest,
WINHTTP_QUERY_STATUS_CODE |
WINHTTP_QUERY_FLAG_NUMBER,
NULL,
&dwStatusCode,
&dwSize,
NULL );
if( bResults )
{
switch( dwStatusCode )
{
case 200:
printf( "The resource was successfully retrieved.\n" );
bDone = TRUE;
break;
case 401:
printf(" The server requires authentication. Sending credentials...\n" );
bDone = TRUE;
break;
case 407:
printf( "The proxy requires authentication. Sending credentials...\n" );
bDone = TRUE;
break;
default:
printf("Error. Status code %d returned.\n", dwStatusCode);
bDone = TRUE;
}
}
dwLastStatus = dwStatusCode;
if( !bResults )
bDone = TRUE;
}
if( !bResults )
{
DWORD dwLastError = GetLastError( );
printf( "Error %d has occurred.\n", dwLastError );
}
if( hRequest ) WinHttpCloseHandle( hRequest );
if( hConnect ) WinHttpCloseHandle( hConnect );
if( hSession ) WinHttpCloseHandle( hSession );
}
int main(int argc, char* argv[])
{
WinHttpAuthSample();
return 0;
}
thanks in advance,
George
|
|
|
|
|
Hi
what is the procedure for Microsoft visual C++ certification?How to do that and which code come for vc++ certification ..i have no idea about that so please tell me ..
Thanks
Raju K
|
|
|
|
|
Microsoft does NOT offer any certification course for Visual C++. There may be others providing certification on the same, but certifications are crap anyway.
If you master the language properly, you won't ever need any certificate. But that's just my opinion.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
thanks to your replay rajesh
actually one of my friend finished he is also working in VC++ but i am not sure he is finished vc++ certification ..
i know he done the subject code 70-536
anyway thanks rajesh
|
|
|
|
|
BTW, how many more new IDs are you going to create at CodeProject? We have watchful eyes, you see. I can make it out easily from your grammar and writing style.
I remember these IDs of you - they may not be accurate, you get the picture:
raju k, nisha00005 (2 more along the lines with the name nisha), madan(something), etc., You were also a noted member of the Book Buying Band.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Certifications aren't for shouting people.
BTW:
(1) rarely skilled developers need a certification.
(2) rarely a certified developer is skilled.
[added]
I notice you've found yourself the right way to enhance you developer's reputation [^]. Well done, I give you two suggestions:
(1) give the correct answer.
(2) post your answer to the original question, not to another answer.
[/added]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: BTW:
(1) rarely skilled developers need a certification.
(2) rarely a certified developer is skilled.
Very true.
I just don't understand why you put the joke icon on your post....
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
You should specify the folder containing msg_bus2005.lib file in Visual Studio 's library search path.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
use
#pragmma comment(lib,"msg_bus2005.lib");
Regards
Raju K
|
|
|
|
|
Why did you removed the OP?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
After calling CRecordSet::AddNew, I am calling CRecortSet::update( ). But this is throwing an exception like Updating record set fails. Can I know what could be the reason.
|
|
|
|
|
A good reading [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
MyView wrote: But this is throwing an exception like Updating record set fails. Can I know what could be the reason.
There should be specific info in the exception object. CDBException has a return code
abd two error strings - what's in there (so we don't have to guess)?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi All,
I have a application developed in VS2005(MFC80).It uses a dll which is developed in VS2003(MFC71).This dll has a CList<> which crashes at the point when it is destroyed i.e when the destructor is called for the CList. This happens when i run my application on Vista OS.
One Solution for the above problem is that I port the dll to VS2005.I tried porting the dll . It works fine without any crashes, but this solution is not feasible for my team.
Can anyone suggest any other solution to the above problem.
Thanks
Shailesh
|
|
|
|
|
Shaileshhex wrote: One Solution for the above problem is that I port the dll to VS2005.I tried porting the dll . It works fine without any crashes, but this solution is not feasible for my team.
Shaileshhex wrote: Can anyone suggest any other solution to the above problem.
Port your team to 2008.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
I need some answers friend!
|
|
|
|