|
Thanks Michael!
I also want to congratulate you to your tutorials about strings!
Thanks!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Hi Michael!
Can you take a look on Works under UNICODE ???
Thanks!!!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Hi Mike!
I have a question to you about the T2CA() macro! Please help!
Is it possible that the T2CA() macro deletes some characters (like ü,ä,ö,...) during the conversion?
I have a UNICODE string (CString) "Büro" (a german word) and converts it to a ANSI string to save it to a file.
The problem is that I get the following string: "Bro"
It looks like that the macro deletes the "ü" .
How does tI fix that problem? How does I convert the UNICODE to ANSI the right way, so that it doesn't deletes some characters?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Hi,
What's the equivalent of JAVA's "URLEncoder.encode" in VC++?
or is there an alternate way of encoding to be compatable with Java's "URLDecoder.decode"?
Many Thanks,
John
|
|
|
|
|
Write one! it's not hard.
1. replace any occurance of space " " with "+".
2. any character that is not A-Z a-z 0-9 - . _ is replaced with the token %XX where XX is the string hex representation of the ascii character it replaces.
Signature space for rent. Apply by email to....
|
|
|
|
|
Hi,
I've written a code which replaces characters in a string with their respective URLEncode (i.e a " " will be replaced by "+" etc..).
However the code crashes at execution.
Please help!!
Here's the code extract;
Code:
------------------------------------------------------------------------------
for(j=0;j
|
|
|
|
|
hi, I find myself easy to fall in trouble with callback functions, and want get a pan view of it, any source is appreciated.
Thanks in advance.
Extreme programming. Do the No.1
|
|
|
|
|
PCL drivers does not return scale data in the proper dmScale field of DEVMODE when I used DocumentProperties() function of MS VC++. Instead it stores the scale data in the extra bytes at the end of DEVMODE using the dmDriverExtra field. How can I get that data out for my use ? I want to display it in a separate text box in different dialog box.
Sanjay Mishra
|
|
|
|
|
hi,
I start a thread in a class' constructor and end it in the class' destructor.
This thread has a message queue which works as a headquarter to control the class' members.
My problem is, in the switch-case body, any call of members is not permitted.
My question is,
How to let the call permitted,
and any altinative is appreciated.
Thanks alot.
Extreme programming. Do the No.1
|
|
|
|
|
|
The problem (I guess) is that the thread function is a static member function of the class. Basically, you're missing information of the this parameter in the thread execution. To workaround this, pass this as the lpParameter of the thread: to make things neater, you can resort to a stub thread function that forwards to a non-static function, just like this:
class CYourClass
{
CYourClass()
{
...
CreateThread(NULL,0,thread_stub,this,0,&dwThreadId);
...
}
static DWORD WINAPI thread_stub(LPVOID arg)
{
CYourClass * p=static_cast<CYourClass *>(arg);
return p->thread();
}
DWORD thread()
{
}
...
};
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Does anybody have an idea of how i can change the TabControl background color?
I did set to owner draw mode and i also draw all the tab caption myself.
But i just no idea how can I change the background color as well.
regards,
K-PAX
|
|
|
|
|
Hello everybody!
I have been encountering some difficulties with my applications and it constantly crashes. Lacking VC++ at the place of installment, it basically gives a dialog from the system stating a page fault has occurred.
The error could be a pointer pointing to NULL, moving ptrs to garbage areas, or anything..but the only information I get is a page faullt has occurred, which really isn't helpful.
Is there another way that will give more details about the error?
Cheers,
wilche
|
|
|
|
|
You need to catch the exception and then print out a stack dump to let you know where it crashed. There are some debuggin libraries available on codeproject that will handle stack dumps.
Todd Smith
|
|
|
|
|
Hi
i have an app i'm coding and it needs a standalone DataBase.
So i figure using jet engine via DAO...is there a better option?
cheers
bryce
|
|
|
|
|
Yeah, most of them. Jet is hopelessly out of date and deprecated. Check out MSDE instead, it's a lite version of SQL Server.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
coolo...
i shall investigate
cheers
bryce
|
|
|
|
|
Hi, I want 0xf2f2 to be displayed in a Messagebox, but what I got is a "?",
tell me how to accomplish this mission.
Appreciation
Extreme programming. Do the No.1
|
|
|
|
|
this will convert an arbitrary stream of bytes to a CString:
CString HexDump(BYTE *pData, DWORD dwSize)
{
CString out;
for (DWORD i=0; i < dwSize; i++)
{
CString f;
if (pData[i] < 16)
f.Format("0%x", pData[i]);
else
f.Format("%x", pData[i]);
out+=f;
}
return out;
}
-c
Support regime change. Vote.
|
|
|
|
|
I was looking at converting a project from VC6 to VC7.
Deep in the code something like this happens:
LPCTSTR szDesc; is passed into a function,
CString *pstrDesc = new CString();
...
...
(*pstrDesc) = szDesc;
This runs fine in VC6, but the memory management class in VC7 passes null pointers, which promptly crash.
I can find lots of info about how the CString class has changed, but nothing about how/whether code should be rewriiten/changed to deal with th new implementation.
Can anyone help with a fix/workaround? There are an awful lot of CStrings to convert to TCHARS before we can justify an upgrade to .net!!!!
Hugh
|
|
|
|
|
are you testing for NULL on each "new" you do?
-c
Support regime change. Vote.
|
|
|
|
|
The null is being passed, and crashing, inside the Microsoft code. The best I could do to detect it would be an exception handler!!!!
Hugh
|
|
|
|
|
I attempted to reproduce this error but could not. If an instantiated CString object is assigned a NULL, it empties that object.
If a CString constructor fails due to insufficient memory, an exception will be thrown (I verified this.)
Something else is happening in your code. I suspect memory corruption before you even get to the "new CString()"
|
|
|
|
|
The problem is so serious I expect it is something else in my code, my problem is what!
It appears to me that there is an error being passed from the memory management to the CString code. This is mostly MFC, and although I can step through it, I don't understand the logic behind it.
I have pushed up the error reporting on Bounds Checker and it reports nothing.
I am lost as to what is wrong, but as the code has been running without (reported) problems for over 3 years, under VC6, I am assuming something in the new MFC/template is less forgiving.
Does anyone know of a technical description of the changes in the CString class, between 6 and 7, which may give me a clue as to where to look?
|
|
|
|
|
These kinds of bugs are among the most aggravating.
CString changed drastically between 6 and 7. The new CString is a typedef of CStringT which is derived from CSimpleStringT. Unfortunately, while I knew the old CString like the back of my hand, I am just getting acquainted with the new.
One thing to check for is a buffer overrun. The old CString used a fixed memory allocator pool which meant that depending on the size of the string, you could do a GetBuffer() then copy more data to the string than you had requested be allocated. Of course, this would usually be caught in debug mode, but it's worth a look.
(That your problem is with the memory points me in this general direction.)
My only other suggestion is to write a test program and break out chunks of code and test them in it. (And if my experience is normal, the test program will probably grow into a hideous monster, but it may help.)
And nothing beats just stepping through the code, line by line.
|
|
|
|