Re: pop up a TCHAR[1024]

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



So, you haven't been working on it, huh?

-----

{
char testbufs[ 1024 ]; // ANSI buffer to receive data from remote
file
TCHAR testbuff[1024]; // Unicode buffer to receive translated data.
Note that,
// if remote file contains null
characters, that's where the
// string will end after
translation!
DWORD dwDataSize = 0;
DWORD dwBytesRead = 0;

InternetQueryDataAvailable(hOpen, &dwDataSize, 0, 0); // Not sure
why we're doing this

// since we ignore the value!

int j=0;
while (
InternetReadFile( hOpen, testbufs[ j ], 1, &dwBytesRead) &&
( dwBytesRead!=0 )
)
{
j++;
}

// Null terminate the ANSI buffer.
testbuffs[j]='\0';

// Data is in buffer, but in ANSI, not Unicode. Translate it. If it
has null characters,
// other than the one we added at the end above, the string will not
come out right
// after the translation.
MultiByteToWideChar( CP_ACP, 0, testbufs, -1,
testbuff, sizeof( testbuff ) / sizeof( testbuff[0] ),

MessageBox(hDlg, testbuff, TEXT("You've got the licence"),MB_OK);
}

-----

Paul T.

"paul" <chu2802@xxxxxxxxx> wrote in message
news:u%23ToONYXGHA.1084@xxxxxxxxxxxxxxxxxxxxxxx
thanks all your advice and suggestions, i really appreciate.

but i'm sorry that i'm running out of time for the completion of this
function. could anyone kindly do me a favor by modifying the code for me,
such the the messagebox can pop up with what it read from a text file on
internet.

many thanks!

best regards,
paul


"paul" <chu2802@xxxxxxxxx> ¼¶¼g©ó¶l¥ó·s»D
:ezfP5KtWGHA.4620@xxxxxxxxxxxxxxxxxxxxxxx
hi,
i have

TCHAR buff[1024] = "testing";
MessageBox(hWnd, buff, TEXT("caption"), MB_OK);

it only output the first character of buff, how can i output the whole
string?

regards,
Paul






.



Relevant Pages

  • Re: find and remove "" character from string
    ... i have the following string s and the following code, ... remaining characters have been mapped through the given translation table, which must be a string of length 256". ... For Unicode objects, the translatemethod does not accept the ...
    (comp.lang.python)
  • Re: Product Key
    ... The functions won't do creation and translation of a specific key; ... chosen characters to a specific set of characters. ... <MS ACCESS MVP> ... how I would use it to translate a string into a key. ...
    (microsoft.public.access.modulesdaovba)
  • Re: pop up a TCHAR[1024]
    ... best regards, ... DWORD dwDataSize = 0; ... // other than the one we added at the end above, the string will not ... // after the translation. ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Micro-PEP: str.translate(None) to mean identity translation
    ... >> Bengt Richter ... characters, each and all of whose instances in the source string ... will be deleted from the source string. ... translation table, which must be a string of length 256. ...
    (comp.lang.python)
  • Re: pop up a TCHAR[1024]
    ... Send me your paycheck and I'll send you the modified code. ... null characters, that's where the ... // other than the one we added at the end above, the string will not ... // after the translation. ...
    (microsoft.public.windowsce.embedded.vc)