Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: char * - returning address of local variable or temporary Pin
tom144312-Nov-10 2:26
tom144312-Nov-10 2:26 
Questionedit control not responding in a dialog created within an activex control Pin
lakshman rao8-Nov-10 2:59
lakshman rao8-Nov-10 2:59 
QuestionRe: edit control not responding in a dialog created within an activex control Pin
David Crow8-Nov-10 3:36
David Crow8-Nov-10 3:36 
AnswerRe: edit control not responding in a dialog created within an activex control Pin
lakshman rao8-Nov-10 3:48
lakshman rao8-Nov-10 3:48 
QuestionRe: edit control not responding in a dialog created within an activex control Pin
David Crow8-Nov-10 3:51
David Crow8-Nov-10 3:51 
AnswerRe: edit control not responding in a dialog created within an activex control Pin
lakshman rao8-Nov-10 3:55
lakshman rao8-Nov-10 3:55 
GeneralRe: edit control not responding in a dialog created within an activex control Pin
lakshman rao18-Nov-10 23:47
lakshman rao18-Nov-10 23:47 
QuestionTranslate C-Code to Csharp Pin
djfresh8-Nov-10 2:16
djfresh8-Nov-10 2:16 
Can sb. translate following code to C# pls:

<br />
/***********************************************************************<br />
* Function Name: UuDecodeLength<br />
*<br />
* Description: Determines the length of the raw data given the<br />
* length of the UU-Encoded data<br />
*<br />
* Arguments:<br />
* nSrcLen Length of the UU-Encoded data<br />
*<br />
* Returns<br />
* Number of bytes of data<br />
**********************************************************************/<br />
<br />
INT32U UuDecodeLength(INT32U nSrcLen)<br />
{<br />
INT32U uDestLen;<br />
uDestLen = (nSrcLen * 3) / 4;<br />
return uDestLen;<br />
}<br />
/***********************************************************************<br />
* Function Name: UuEncodeLength<br />
*<br />
* Description: Determines the length of the UU-Encoded data given<br />
* the length of the raw data<br />
*<br />
* Arguments:<br />
* nSrcLen Length of the raw data<br />
*<br />
* Returns<br />
* Number of bytes of UU-Encoded data<br />
**********************************************************************/<br />
<br />
INT32U UuEncodeLength(INT32U nSrcLen)<br />
{<br />
INT32U uDestLen;<br />
uDestLen = (nSrcLen * 4) / 3;<br />
if ( ((nSrcLen * 4) % 3) != 0 )<br />
{ // we need a partial byte, add one...<br />
uDestLen++;<br />
}<br />
return uDestLen;<br />
}<br />
<br />
/***********************************************************************<br />
* Function Name: UuDecode<br />
*<br />
* Description: UU-Decodes the given ASCII data<br />
*<br />
*<br />
* Arguments:<br />
* pSrc Pointer to the source data (UU-Encoded data)<br />
* pDst Pointer to the destination data (binary data)<br />
* nSrcLen Length of the source buffer<br />
*<br />
* Returns<br />
* Number of bytes in the pDst array<br />
**********************************************************************/<br />
<br />
INT32U UuDecode(INT8U* pDst,const INT8U* pSrc,INT32U nSrcLen)<br />
{<br />
unsigned int nDstIndex;<br />
unsigned int nSrcIndex;<br />
nDstIndex = 0;<br />
nSrcIndex = 0;<br />
while(nSrcIndex < nSrcLen)<br />
{<br />
// Decode A // Bits Src Offset<br />
pDst[nDstIndex] = ((pSrc[nSrcIndex++] - 0x20) << 2 ) & 0xFC; // A7:2 0<br />
pDst[nDstIndex++] |= ((pSrc[nSrcIndex] - 0x20) >> 4 ) & 0x03; // A1:0 1<br />
if ( (nSrcIndex + 1) >= nSrcLen )<br />
{ // we need one more byte to decode B<br />
break;<br />
}<br />
// Decode B<br />
pDst[nDstIndex] = ((pSrc[nSrcIndex++] - 0x20) << 4 ) & 0xF0; // B7:4 1<br />
pDst[nDstIndex++] |= ((pSrc[nSrcIndex] - 0x20) >> 2 ) & 0x0F; // B3:0 2<br />
if ( (nSrcIndex + 1) >= nSrcLen )<br />
{ // we need one more byte to decode C<br />
break;<br />
}<br />
// Decode C<br />
pDst[nDstIndex] = ((pSrc[nSrcIndex++] - 0x20) << 6 ) & 0xC0; // C7:6 2<br />
pDst[nDstIndex++] |= ((pSrc[nSrcIndex] - 0x20) ) & 0x3F; // C5:0 3<br />
nSrcIndex++;<br />
}<br />
return nDstIndex;<br />
}<br />
<br />
/***********************************************************************<br />
* Function Name: UuEncode<br />
*<br />
* Description: UU-Encodes binary data<br />
*<br />
* Arguments:<br />
* pSrc Pointer to the source data (binary)<br />
* pDst Pointer to the destination data (UU-Encoded data)<br />
* nSrcLen Length of the source buffer<br />
*<br />
* Returns<br />
* Number of bytes in the pDst array<br />
**********************************************************************/<br />
<br />
INT32U UuEncode(INT8U* pDst,const INT8U* pSrc,INT32U nSrcLen)<br />
{<br />
unsigned int nDstIndex;<br />
unsigned int nSrcIndex;<br />
nDstIndex = 0;<br />
nSrcIndex = 0;<br />
while(nSrcIndex < nSrcLen)<br />
{<br />
// Encode A<br />
pDst[nDstIndex++] = ((pSrc[nSrcIndex] >> 2) & 0x3F) + 0x20;<br />
pDst[nDstIndex] = (pSrc[nSrcIndex++] << 4) & 0x3F;<br />
if ( nSrcIndex >= nSrcLen )<br />
{ // this is the last byte<br />
pDst[nDstIndex] += 0x20;<br />
nDstIndex++;<br />
break;<br />
}<br />
// Encode B<br />
pDst[nDstIndex] |= (pSrc[nSrcIndex] >> 4) & 0x3F;<br />
pDst[nDstIndex++] += 0x20;<br />
pDst[nDstIndex] = (pSrc[nSrcIndex++] << 2) & 0x3F;<br />
if ( nSrcIndex >= nSrcLen )<br />
{ // this is the last byte<br />
pDst[nDstIndex] += 0x20;<br />
nDstIndex++;<br />
break;<br />
}<br />
// Encode C<br />
pDst[nDstIndex] |= (pSrc[nSrcIndex] >> 6) & 0x3F;<br />
pDst[nDstIndex++] += 0x20;<br />
pDst[nDstIndex] = (pSrc[nSrcIndex++] & 0x3F) + 0x20;<br />
nDstIndex++;<br />
}<br />
return nDstIndex;<br />
}<br />

AnswerRe: Translate C-Code to Csharp Pin
Sauro Viti8-Nov-10 2:24
professionalSauro Viti8-Nov-10 2:24 
GeneralRe: Translate C-Code to Csharp Pin
djfresh8-Nov-10 2:51
djfresh8-Nov-10 2:51 
GeneralRe: Translate C-Code to Csharp Pin
Sauro Viti8-Nov-10 3:31
professionalSauro Viti8-Nov-10 3:31 
GeneralRe: Translate C-Code to Csharp Pin
djfresh8-Nov-10 3:47
djfresh8-Nov-10 3:47 
AnswerRe: Translate C-Code to Csharp Pin
Sauro Viti8-Nov-10 4:07
professionalSauro Viti8-Nov-10 4:07 
GeneralRe: Translate C-Code to Csharp Pin
djfresh9-Nov-10 2:12
djfresh9-Nov-10 2:12 
AnswerRe: Translate C-Code to Csharp Pin
Luc Pattyn8-Nov-10 4:07
sitebuilderLuc Pattyn8-Nov-10 4:07 
QuestionWhy SampleGrabber->SetOneShot(FALSE) fails with video files? Pin
Chesnokov Yuriy8-Nov-10 0:12
professionalChesnokov Yuriy8-Nov-10 0:12 
Question890817 - what's wrong with clicking on a control in a dockable pane? Pin
ilostmyid28-Nov-10 0:02
professionalilostmyid28-Nov-10 0:02 
AnswerRe: 890817 - what's wrong with clicking on a control in a dockable pane? Pin
Sauro Viti8-Nov-10 1:04
professionalSauro Viti8-Nov-10 1:04 
GeneralRe: 890817 - what's wrong with clicking on a control in a dockable pane? Pin
ilostmyid28-Nov-10 1:51
professionalilostmyid28-Nov-10 1:51 
GeneralRe: 890817 - what's wrong with clicking on a control in a dockable pane? Pin
Sauro Viti8-Nov-10 2:12
professionalSauro Viti8-Nov-10 2:12 
AnswerRe: 890817 - what's wrong with clicking on a control in a dockable pane? Pin
Sauro Viti8-Nov-10 2:18
professionalSauro Viti8-Nov-10 2:18 
GeneralRe: 890817 - what's wrong with clicking on a control in a dockable pane? Pin
ilostmyid28-Nov-10 18:03
professionalilostmyid28-Nov-10 18:03 
QuestionHow to use get the image's URL from web page Pin
yu-jian6-Nov-10 6:24
yu-jian6-Nov-10 6:24 
AnswerRe: How to use get the image's URL from web page Pin
«_Superman_»6-Nov-10 6:48
professional«_Superman_»6-Nov-10 6:48 
GeneralRe: How to use get the image's URL from web page Pin
yu-jian7-Nov-10 14:55
yu-jian7-Nov-10 14:55 

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.