Re: Problem related to BYTE*
Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance
"Harish Kumar Dixit" <harishdixit1@xxxxxxxxx> ha scritto nel messaggio
news:8260df4c-1ebe-4c0b-a559-8e6b1313d2dc@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Yes after execution of method i got pdwDataLength value.
I got the reason my string contains '\0' chars inside it.
We can't handle such string using c/c++ normal methods because '\0'
means end of the string , thats why i am getting blank. Blan is the
1st char and '\0' is the 2nd in my string.
Can u help me how to handle it
I think that your problem is that you are trying to using char * or CStringA
or std::string to "handle" strings, instead the strings used by the
aforementioned API are *Unicode* (UTF-16) strings, so you should use a
wchar_t-based string, e.g. wchar_t *, or CStringW, or std::wstring.
This is my guess, not being able to read "real" code...
HTH,
Giovanni
.
Relevant Pages
- Re: C++ DLL crashed my application. I need expert help.
... on passing strings from and to VB from C/C++. ... string to a C/C++ DLL. ... > int __stdcall SfmConfigGetServer (const char* pAppName, ... > pReturnedStr, char pWhich) ... (microsoft.public.vc.language) - Re: How to add thousand separators
... First, this code is obsolete as written, because char is a dead data type and should not ... Note that both of these should be stored as string resources since they might need to be ... 18 digits for any reason. ... you have made a VERY SERIOUS DESIGN ERROR. ... (microsoft.public.vc.mfc) - Re: what is the best way of passing floats into a string
... I do not null-terminate as snprintf takes care of this (according to ... But the easiest way to determine the size needed to format a number, ... int length_of_representation(double n,const char* format){ ... I get a nice result of -10.000000 in my char * string. ... (comp.unix.programmer) - Re: weird problem
... I already told you that the comparison between an integer and a float ... to strcmpwhich expects a pointer to a string. ... And now a question about something else: why do you use floating ... int,float, char, etc. ... (comp.lang.c) - Re: why I can not write to the file after initialize the MFC in a service program
... you don't use char, an obsolete data type ... Why do you need an intermedate buffer to write literal strings anyway? ... For example, if AfxWinInit fails, you copy a 45-character string into a ... So you are going to try to initialize MFC EACH TIME THROUGH THE LOOP? ... (microsoft.public.vc.mfc) |
|