|
??
Is this kinda what u mean:
CString m = "a";
int size = sizeof(m) + m.GetLength() + 1; //1 for null
size will contain '6' bytes...
(4 for the internal pointer it maintains, + 1 for the "a", plus 1 for the null byte...)
Bikram Singh
|
|
|
|
|
CString s are unicode objects (each character occupied 2 bytes). Also, as I understand it, the size of a CString object is fixed, regardless of the length of the string, since memory required to store the string is obtained from the heap.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
CStrings are unicode objects (each character occupied 2 bytes).
Possibly, but only with the UNICODE directive turned on i should think..
Ravi Bhavnani wrote:
Also, as I understand it, the size of a CString object is fixed, regardless of the length of the string
True, since CString contains only one pointer data member. But, Abdu's question was a bit vague ("actual size" was unclear to me, so i took a wild guess).
Bikram Singh
|
|
|
|
|
bikram singh wrote:
Possibly, but only with the UNICODE directive turned on i should think..
Yes, you're quite correct. I was hasty in replying and am also guilty (?) of always supporting Unicode.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Works for both ansi, unicode.
CString s = _T("Hello");
int bytes = (s.GetLength() + 1) * sizeof(TCHAR);
|
|
|
|
|
|
iam making a program like Norton ghost
i want to save the files and their paths on another partition as a backup
do you have any better idea to make a program like Norton Ghost?
do know any function that copy a complete partition into backup disk?
|
|
|
|
|
For your purpose, the others said it already, it's (s.GetLength()+1)*sizeof(TCHAR) .
(however, you cannot simply pass the address of CString itself to a binary reader/writer)
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
is there any way or functions that can copy data as a low level binary from the drive to another location or drive (Norton Ghost like) .
ex: copy files and directories with out getting the path of each file and copy it to the new location i mean to get binary data from the drive direct and copy it
|
|
|
|
|
Under WinNT+, you can use CreateFile("\\\\.\\C:") to open read-only access to any disk drive (hdd or fdd), and if you know the FAT/other file system format, you can easily read data using ReadFile().
On Win9x, you can read floppies using VxD services (it's there in MSDN as an example, but i dont remember where). For reading HDD's you need to either use 16-bit code (to call BIOS functions), or write a VxD.
Bikram Singh
|
|
|
|
|
I think what you want to know is how to calculate the size in pixels the string is going to occupy on the screen
to do this just find the font's width ( i think there is a function like GetFont you could use to find it ) then multiply the font width by the number of characters in the string
|
|
|
|
|
I am working on an OSD for Girder[^]. I want my application to have some fancy 3D accelerated graphics. Is it possible in windowed mode to have per pixel alpha blending with the windows underneath in real time?
Joel Holdsworth
|
|
|
|
|
The DirectX C++ Documentation doesn't speak for or against this subject.
Apparently the only reasonable way to know for sure is to test. The Direct3D scenes are drawn in the backbuffer and then blitted to the target area. As the backbuffer can be initialized so that it's handled like a full-screen scene (although only a part of it can be blitted), then I believe all Direct3D effects are available in windowed mode as well.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
i m writting a C++ Win32 DLL which is called by a C# application.
i want the DLL can trigger an event to the Calling C# app after some operations which might like the Win MSG mechanism: The DLL send a message to the C# app and the C# app handle the msg.
the C# use the EventHandle/EventArgs on this issue.
But can i trigger an event to C# app in a C++ Win32 DLL ?
please help me.
|
|
|
|
|
could i grab textout api when it want to draw a text on the screen ,in this way i can buufer alll messages are printed on the screen.
|
|
|
|
|
i think you need hooks.
read some Windows Hook artical at Codeproject or
in MSDN
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Possible. No easy way though. Google for APISpy32 and "Matt Pietrek".
Bikram Singh
|
|
|
|
|
By defining your own window class you get to have a HWND and HINSTANCE vars to use later. Any ideea how to get them in a dialog-based app ?
|
|
|
|
|
Hi all,
I am new to MFC.
I would like to know that how can I make Edit Box in MFC Read Only and Background of Box should be white?
Any help be appreciated .
Best Regards
Rajesh
rajesh
|
|
|
|
|
Rajesh_K_Sharma wrote:
how can I make Edit Box in MFC Read Only
editbox->SetReadOnly();
Rajesh_K_Sharma wrote:
Background of Box should be white
for changing bg color, intercept the WM_CTLCOLOREDIT message and set the HDC's(in the wParam), brush to a white brush..
Bikram Singh
|
|
|
|
|
Is there any message generated when a laptop lid is closed, as I would like to run a function when the lid has just been shut?
Thanks
|
|
|
|
|
Maybe ACPI/OnNow has something of interest?
Check it out on google..
Bikram Singh
|
|
|
|
|
CString m_sname ;
Rsc->PutCollect("s_name",_variant_t(m_sname));
the question is
when m_sname's value is 6B 62 7A FA 1B D4 A2 7C,
6B is 'k',62 is 'b',7A is 'z',D4 A2 is '寓'(chinese word),7C is '|',but 7A FA has no corresponding character .so 7A FA has
been changed to 3F('?') and stored .I want to know if some methods can solve it .Thank you !
|
|
|
|
|
Please pay attention on replies to your questions.
You have asked this twice.. the first time I have answered:
"use nvarchar datatype in the SQL Server column"
Cheers
Jaime
|
|
|
|
|
Thank you.
Sorry ,I cann't find the first subject that I had send,so I think it may be not submitted successfully.
I had used nvarchar datatype ,but the question is same.I also used ODBC
and it worked well .I think it is a bug of VC and I have installed the new patch but it no use. Would you help me? thanks!
|
|
|
|