|
If I add UNICODE support to an ATL dll, it can not compile as adding wWinMainCRTStartup into Setting->Link->Output->Entry-point symbol relates to MFC apps, and there is no such call when you have a dll project tol include the UNICODE. Or if you can direct me to any article on the net where somebody explains how to add UNICODE support to an ATL project.
Thanks.
|
|
|
|
|
If you are using Visual C++ to create the ATL dll, shouldn't it already create the entry point for you? It seems to me you just have to define UNICODE and _UNICODE in your preprocessor settings for the project.
Deus caritas est
|
|
|
|
|
That entry point is ANSI, not the UNICODE one. I do use _UNICODE and UNICODE in the preprocessor definitions, but when I build any of the Unicode configurations it doesn't show the Unicode letters properly. Of course, I have changed all the CString to use _T macros, all atoi to _ttoi, all A2BSTR to T2BSTR and similar, but to no avail.
Thanks.
|
|
|
|
|
The entry point function does not determine how your Unicode letters are being displayed. Are you trying to convert a char* to a Unicode string? Take a look at MultiByteToWideChar . This may be what you are looking for.
I hope this helps.
Deus caritas est
|
|
|
|
|
Not quite... wWinMainCRTStartup is the UNICODE entry point for the CRT, WinMainCRTStartup is the ANSI version. They have nothing to do with MFC as far as your ATL project is concerned.
Adding UNICODE support to an ATL project is not the same as BUILDING your project as UNICODE. I am under the impression that MFC and ATL projects already have most of the UNICODE support required (use of TCHAR -based characters/strings).
When you build the UNICODE version of your project, you need to have the linker use wWinMainCRTStartup as the entry point. Leave things the way they are/were for ANSI builds.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Thanks for your reply.
The ATL project has some drawing and I used MFC, even if it bloats the code, as I am so used to MFC things in doing this. The reason for building it inside the ATL is that I can possibly use it later on under the .Net, avoiding all the problems and sluggishness of the .Net GDI+.
Anyways, I know I have to use UNICODE support, but it just does not show it, for instance, if I set a name of the static control to some UNICODE name in Bosnian, then it would be properly displayed in the code editor (using Courier New CE), but when I compile it and test the control it just shows | instead of the characters, or something else.
The wWinMainCRTStartup is the entry point for CRT, but the build fails if I define it, showing something like:
"_wWinMainCRTStartup" is not __stdcall with 12 bytes of arguments; image may not run correctly"
The dll crashes in run-time if I compile it that way. So the question is: what else I have to do to enable UNICODE character set in it.
Thanks.
|
|
|
|
|
Am trying to write a program when given a folder name path, it will traverse/recursively go through the whole folder & sub-folders, opening each file.
How can I go about this in C++?
I want to write a ASP, ASPX, PHP, JS, XSL comment remover for web applications using state machine. I have found a C/C++ comment remover and will modify it so that it will take into account of which file type it has opened, and apply the scope rule (see table below).
Refs (C/C++ comments only):
http://home.att.net/~jackklein/c/code/comments.html
Comment style File Scope
VBScript ' (apostrophe) .asp <% %>
HTML <!-- --> .asp all
HTML <!-- --> .xsl all
C/C++ // /* */ .asp <script </script
C/C++ // /* */ .xsl <script </script
C/C++ // /* */ .js all
|
|
|
|
|
Look up FindFirstFile(...) for information on how to traverse the contents of a directory looking for files.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
[quote="Colin Jeanne"]The most portable way to do this would be to use [url=http://www.boost.org/libs/filesystem/doc/]boost::filesystem[/url] but if you dont want to use it then you'll have to tell us what operating system you're using.
C++ does not contain functions to enumerate files or directories natively.[/quote]
Yes! I would like this being portable so that it'll work under windows and linux file systems. I'll have a look at this boost fs class library. Cheers!
Anyone else know of, or seen a web application (multi-language) comment remover? Or know how to go about it, or any advice or tips they can give me? Much appreciated!
|
|
|
|
|
Hi,
I've an application that allows user to switch GUI language
mnemonic keys (ALT + F for File menu) works in english mode i need to give the same shortcuts for the user even in non-english language modes where "&File" for menu is changed with some other strings without "&" in it
How can i do that ?
thanks in advance
|
|
|
|
|
Menu item mnemonics are generally handled by Accelerators (in your resources). You could look into discarding and reloading a different set of Accelerators.
Barring that, you could use PreTranslateMessage at the application level to handle the key combinations and trigger commands from there, but that would be kinda kludgy.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
|
I am getting problem in deleting combobox pointer.
My snipset is,
CComboBox combo;
combo=new CComboBox;
combo=(CComboBox*)GetDlgItem(nID);
...
...// Its working fine
But
delete combo; // its not working
Pls suggest me a solution. and plz tell me whether i can do all the handling with Combobox object itself, without creating pointer.
Thanks in advance
|
|
|
|
|
from the MSDN for GetDlgItem:
The returned pointer may be temporary and should not be stored for later use.
so, don't overwrite the result of the 'new'. store it away somewhere safe, and delete that. don't delete the result of GetDlgItem.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
i am not deleting the result of GetDlgItem.
still not working
|
|
|
|
|
GetDlgItem returns you a pointer. And you use this pointer to replace the previous pointer that was in combo.
So, when you call delete, you try to delete the pointer which is in the combo variable which is the pointer retrieved from GetDlgItem
|
|
|
|
|
|
combo is not a pointer yet you are trying to use the new operator on it.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
CComboBox combo;<br />
combo=new CComboBox;<br />
combo=(CComboBox*)GetDlgItem(nID);
That snippet should not even compile - post the real code and maybe we can help you. If you allocate a CComboBox object, you should not be overwriting that pointer before trying to delete it.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
sorry i have made a mistake in giving the snipset.
it is like
CComboBox* combo;
combo=new CComboBox;
combo=(CComboBox*)GetDlgItem(nID);
...
...// Its working fine
But
delete combo; // its not working
|
|
|
|
|
damn, you have mud on your eyes !!!
Aryan S wrote: combo=new CComboBox;
combo=(CComboBox*)GetDlgItem(nID);
you assign combo twice... so you are not delete ing what you previously new ed
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
Why are you even bothering with new and delete ? If you already have a combobox control on the dialog, you should also have a CComboBox member variable associated with that control.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
don't change the value of combo after the initialization with new , and delete will work well.
If you want to destroy the object use combo->DestroyWindow() , and then call delete combo; .
Hope this help,
Bye
Have a nice code day
|
|
|
|
|
|