Click here to Skip to main content
15,913,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralProblem with wincrypt.h Pin
Nick Parker3-Apr-03 16:19
protectorNick Parker3-Apr-03 16:19 
GeneralRe: Problem with wincrypt.h Pin
Zdeslav Vojkovic4-Apr-03 0:33
Zdeslav Vojkovic4-Apr-03 0:33 
GeneralRe: Problem with wincrypt.h Pin
jhwurmbach4-Apr-03 1:30
jhwurmbach4-Apr-03 1:30 
GeneralRe: Problem with wincrypt.h Pin
Zdeslav Vojkovic6-Apr-03 21:07
Zdeslav Vojkovic6-Apr-03 21:07 
GeneralRe: Problem with wincrypt.h Pin
Nick Parker4-Apr-03 3:27
protectorNick Parker4-Apr-03 3:27 
Generalerror RC2135: file not found: MENU Pin
ElizabethC3-Apr-03 13:07
ElizabethC3-Apr-03 13:07 
QuestionCan not find the Dialog resource from .NET Pin
ElizabethC3-Apr-03 12:52
ElizabethC3-Apr-03 12:52 
GeneralCString and WriteFile Pin
andyg.1013-Apr-03 11:39
andyg.1013-Apr-03 11:39 
Hi I am trying to write data to the serial port using the windows api. I can write successfully by using a normal C style string with the MFC wrapper I wrote(with help from this site!) it goes something like this
void CSerComPort::WriteData(char* cData,DWORD dwBufferSize)
{
DWORD dwBytesWritten;
if(!WriteFile(m_ComPortHndl,cData,dwBufferSize,&dwBytesWritten,NULL))
; //throw exception for wrong write
else;// ASSERT(dwBytesWritten == sizeof(dwData));
}
works fine when i declare something like
char dwdata[]="test string";

But Ideally i would like to read data in from an edit box and this variable is of type CString, I have tried to use the member function GetBuffer which seems to be ok but when I pass GetLength as the second parameter it says I can't convert between int and unsigned long. Is there a standard way to do this, or would I be better rewriting the WriteData function? Please bear with me I am quite new to windows programming but I would like to know if there is a standard way to achieve this. Thanks

Andy
GeneralRe: CString and WriteFile Pin
John R. Shaw3-Apr-03 12:43
John R. Shaw3-Apr-03 12:43 
GeneralRe: CString and WriteFile Pin
Chintan3-Apr-03 18:46
Chintan3-Apr-03 18:46 
GeneralRe: CString and WriteFile Pin
Joan M3-Apr-03 22:14
professionalJoan M3-Apr-03 22:14 
GeneralRe: CString and WriteFile Pin
andyg.1015-Apr-03 22:15
andyg.1015-Apr-03 22:15 
Questionhow to get main explorer's url Pin
mweiss3-Apr-03 11:02
mweiss3-Apr-03 11:02 
AnswerRe: how to get main explorer's url Pin
mweiss3-Apr-03 11:39
mweiss3-Apr-03 11:39 
GeneralCatching Keys Pressed from anywhere... Pin
Nitron3-Apr-03 10:31
Nitron3-Apr-03 10:31 
GeneralRe: Catching Keys Pressed from anywhere... Pin
Alvaro Mendez3-Apr-03 10:56
Alvaro Mendez3-Apr-03 10:56 
GeneralRe: Catching Keys Pressed from anywhere... Pin
Nitron3-Apr-03 10:58
Nitron3-Apr-03 10:58 
GeneralRe: Catching Keys Pressed from anywhere... Pin
peterchen3-Apr-03 11:26
peterchen3-Apr-03 11:26 
GeneralRe: Catching Keys Pressed from anywhere... Pin
valikac3-Apr-03 13:28
valikac3-Apr-03 13:28 
GeneralRe: Catching Keys Pressed from anywhere... Pin
Nitron3-Apr-03 14:05
Nitron3-Apr-03 14:05 
GeneralPing Class Pin
Tom Wright3-Apr-03 10:00
Tom Wright3-Apr-03 10:00 
GeneralDebug information crashes my app :( Pin
Anonymous3-Apr-03 8:41
Anonymous3-Apr-03 8:41 
GeneralRe: Debug information crashes my app :( Pin
Maximilien3-Apr-03 8:48
Maximilien3-Apr-03 8:48 
GeneralRe: Debug information crashes my app :( Pin
AlexO3-Apr-03 8:52
AlexO3-Apr-03 8:52 
GeneralRe: Debug information crashes my app :( Pin
rbc3-Apr-03 10:18
rbc3-Apr-03 10:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.