|
Nope. The output is correct. That's all the magic of polymorphism.
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
|
|
|
|
|
Hi all,
I need to use SQL server via the internet in C++ app, 2 questions:
1) what info do I need? such as domain name, ip address, database name etc.
2) actural C++ code or C++ samples
thx
|
|
|
|
|
hi everyone,
i am savitri here.i am having one more problem that is how to set the cursor to the first block or first text bor in the form. like in VB we use set focus and get focus but how to do in VC++. please help me out.
thanku in advanced,
savitri
|
|
|
|
|
|
SetFocus function [^] if you're using Win32 API or SetFocus method [^] if you're using MCF .
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
|
|
|
|
|
CPallini wrote: if you're using MCF.
That must be one cool technology.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
hey, have you noticed ?
he's now coding with MFC, but 2 days ago, he was asking how to write a switch statement !
wooowwwww, this guy is learning damn fast, hey !
|
|
|
|
|
toxcct wrote: he's now coding with MFC, but 2 days ago, he was asking how to write a switch statement !
BTW, it's a girl and not a guy. (Assumed from the display name)
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
It's a framework.
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
|
|
|
|
|
ROTFL. You're such a bad guy.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
savitri wrote: am savitri here.i am having one more problem
déja vu
|
|
|
|
|
|
savitri wrote: i am having one more problem
I am holding my breath waiting for the next one....
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
We all are
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: We all are
at least we never have to hold it for long!
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Next time it's not gonna be easy man!
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
hello everyone,
i am facing the same problem... my text box variable are m_memid,m_memname, m_balance and m_date for thie i have to fix the cursor and text... how shall i do it please give some solutions please..as we do in VB like txtmemid.text and so on.. if i compile the program line by line then values are there in memory but they are not printing in the text boxes.. please help me out
THANKU IN ADVANCE,
savitri,
|
|
|
|
|
Hi
In my programme VC++6.0 ATL COM, i used Com port Writing(output) through Com Port is done .But Reading(input) through Com port was not working Proberly.
Com Port Reading Function
OVERLAPPED comReader = { 0 };
BOOL fWaitingOnRead = FALSE;
char * lpBuf = "";
DWORD dwRead = 0; // bytes actually read
BOOL Success;
FILE* FilePtr;
DCB dcb = {0};
DWORD dwCommEvent;
COMMTIMEOUTS CommTimeOuts;
HANDLE hCommPort;
printf(" Inside CommThreadProc \n" );
//Opening the COM port
hCommPort = CreateFile( "COM1",GENERIC_READ,0,0,
OPEN_EXISTING,FILE_FLAG_OVERLAPPED, 0 );
if( hCommPort == INVALID_HANDLE_VALUE )
{ printf( "Error while Opening COM Port \n" );
return ;
}
//Getting COMM settings
GetCommState( hCommPort, &dcb );
dcb.BaudRate = CBR_9600;
dcb.ByteSize = 8;
dcb.Parity = NOPARITY;
dcb.StopBits = ONESTOPBIT;
SetCommState( hCommPort, &dcb );
//Creating overlapped event handle
comReader.hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
SetCommMask( hCommPort, EV_RXCHAR );
BOOL repeat = true;
while( 1 )
{ WaitCommEvent( hCommPort, &dwCommEvent, &comReader );
if( WaitForSingleObject( comReader.hEvent, INFINITE ) == WAIT_OBJECT_0 )
{ do
{ Success = ReadFile( hCommPort,&lpBuf,512,&dwRead,&comReader );
if( !Success )
if (GetLastError() == ERROR_IO_PENDING)
printf( "Error in reading the file \n");
else
{ // writing the data into a file
FilePtr = fopen( "comport.txt", "a+" );
if( FilePtr != NULL )
fwrite( &lpBuf, dwRead, 512, FilePtr );
else
printf( "Error while opening file" );
fclose( FilePtr );
}
}while( dwRead > 0 );
}
}
CloseHandle( comReader.hEvent );
CloseHandle( hCommPort );
In message box i receive something but mesage was blank.
i try to write the received data in to "comport.txt" file but it is not working.
I want to write the receving data in txt file,receving data was an character eg:"ff fe ".
thanks
by
shakumar
shakumar
modified on Friday, March 7, 2008 1:07 AM
|
|
|
|
|
(1) enclose code snippets int <pre> tags.
(2) the following line
shakumar_22 wrote: fwrite( &lpBuf, dwRead, 512, FilePtr );
is wrong: you're writing 512 times the amount of data you've read. Change it to:
fwrite( &lpBuf, 1, dwRead, FilePtr );
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
|
|
|
|
|
Hi
i alter the code
fwrite( &,lpBuf, 1, dwRead, FilePtr );
even the data was not write in the Text file,only text file was creating with empty. In Debug mode it cross the Write file Line then also it was not written in file
thanks
shakumar
shakumar
|
|
|
|
|
usually according to the naming convention lpBuf is already a pointer to buffer , your usage of &lpBuf seems using the address of operator two times. What is the type of lpBuf?
|
|
|
|
|
Do you check (with the debugger) dwRead value?
As Rajkumar R suggested, probably you haven't to take lpBuff address. How is it declared?
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
|
|
|
|
|
message was altered pls gothrough the modified message
thanks
shakumar
shakumar
|
|
|
|
|
Please give more info (i.e. what error message you get, if you get one; what is the dwRead value and so on).
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
|
|
|
|