|
Hi Michael! Thanks for your answer!
Can I also use the ATL macro T2CA ???
I don't like to use the WideCharToMultiByte() API, because when I compile the file under a NON UNICODE system I have to remove the API function.
So I would prefer a function (macro) that works on both systems (UNICODE and non UNICODE).
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Daniel S. wrote:
Can I also use the ATL macro T2CA ???
Ah yes, that's another way to do it.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
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![Confused | :confused:](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_confused.gif)
|
|
|
|
|
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()"
|
|
|
|