|
Jon wrote: codepage 1200
There is no codepage 1200. Icelandic uses code page 1252 (Western European) so you shouldn't have to change your language settings at all. I think you're getting things messed up somehow with Unicode and Ansi/OEM strings.
|
|
|
|
|
I am sure it is the file encoding, the original file is encoded in Western and if I open the file in a text editor the string reads:
"abdefghijklmnoprstuvxyzáéÃóúýðþæö"
through some dev studio magic the editor there shows the correct values (but it doesn't run correctly):
"abdefghijklmnoprstuvxyzáéíóúýðþæö"
If I change the file to UTF-16 then the text editor and the runtime all agree. Could it be that the file is using MBCS?
I'm using dev studio 2008, if you select file->save as, then click the arrow by the save and select "save with encoding...", one of the options is "Unicode - Codepage 1200".
Looking this up on wikipedia shows that this is:
# 1200 — UCS-2LE Unicode little-endian
Jon
|
|
|
|
|
Jon wrote: if I open the file in a text editor
Which editor?
|
|
|
|
|
If I open it with SciTE, it reports the encoding as "code page property" and the string isn't shown correctly. If I select UTF-8 as the enoding it shows correctly. I'm guessing the c++ compiler is reading this file in ascii giving the problem. There isn't a BOM on this file which is what was going wrong I guess.
Jon
|
|
|
|
|
In addition to David's suggestion - If you are using the console as output you need also CharToOem() or CharToOemBuff()
|
|
|
|
|
The console was only for testing, the font has to be set correctly as well I think. Anyway it's all working again now.
Jon
|
|
|
|
|
1. Using Visual Studio?
2. Hope the laguage settings from control panel are changed to icelandic.
|
|
|
|
|
That's not entirely necessary I think, although that would probably ensure the default file encoding was correct.
Another approach is to specify the unicode characters by number, something like:
wchar_t *unichars = L"\u00FE\u00D1...
This would work (if I knew all the codes) but wouldn't be very readable.
Jon
|
|
|
|
|
Jon wrote: Any idea on what is going wrong?
Yes.[^]
Besides the problem described in the article (conversion from wide char to multibyte), there are additional problems: the default console font on Windows does not support Unicode.
|
|
|
|
|
i am working in a code, in which they have used DHTML Edit Control(Dhtmled.ocx) to implement IE HTML editor sort of application. pasteHTML method is crashing when it get some strange HTML text. this is not happening at all the time. i have added the code below.
but i cannot add the HTML code which is causing the problem ,since it is too huge text. this is happening at client's place only.
this happens with Windows XP , IE6-SP3
it is working fine in Windows 2003 server with IE 7.
I am passing HTML text as 1'st argument.
i have searched all over the place in the net, but nobody discussed about the problem.
i know microsoft dropped supporting DHTML Edit for long time before, but we can not migrate it to MSHTML, , because it will take long time for me to rewrite exact the code to simulate DHTML Edit control wrapper class in MSHTML, i have to give a fix for time being,
Please throw me a clue if anybody have an idea, if
1. is there any way to find out a HTML tag which is causing the crash,
2. any workaround for pasteHTML method , .
void CDHTMLEdit::ReplaceSel(LPCTSTR lpszNewText,bool bHTML/* = true */)
{
try
{
CHTMLSelectionObject SelObj = GetDom().GetSelection();
CString strText = SelObj.GetType();
LPDISPATCH lpIDispatch= SelObj.createRange();
IHTMLTxtRange * lpTxtRange;
if(S_OK != lpIDispatch->QueryInterface(IID_IHTMLTxtRange,(void **)&lpTxtRange))
{
lpIDispatch->Release();
return;
}
if(bHTML)
{
CComBSTR bstrReplaceText = lpszNewText;
lpTxtRange->pasteHTML(bstrReplaceText);
}
else
{
CComBSTR bstrReplaceText = lpszNewText;
lpTxtRange->put_text(bstrReplaceText);
}
lpTxtRange->collapse(false);
lpTxtRange->select();
lpTxtRange->Release();
lpIDispatch->Release();
}
catch(COleDispatchException * pDE)
{
FILETRACE(_T(" COleDispatchException caught in CDHTMLEdit::ReplaceSel."));
pDE->Delete();
ASSERT(FALSE);
}
catch(...)
{
FILETRACE(_T("CDHTMLEdit::ReplaceSel - Unhandled exception caught"));
ASSERT(FALSE);
}
}
|
|
|
|
|
class base
{
protected:
base(const&base) {}
};
When the above code is compiled with VS 6.0 compiles without any error, but if the same is compiled in VS 2008 following is the error
“error C4430: missing type specifier - int assumed. Note: C++ does not support default-int”
Can you please let me know what causes this error.
|
|
|
|
|
Are you instantiating the class? If yes, how are you instantiating the class? Where is the default constructor?
It is a crappy thing, but it's life -^ Carlo Pallini
modified on Friday, July 17, 2009 6:05 AM
|
|
|
|
|
Constructor can have return type?
|
|
|
|
|
Sorry, I overlooked your query. The post is modified.
Coffee needed.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
class base
{
protected:
base(){}
base(const&base) {}
};
int _tmain(int argc, _TCHAR* argv[])
{
base obj;
return 0;
}
Even if the above case same error.
|
|
|
|
|
Nandu_77b wrote: class base
{
protected:
base(){}
base(const&base) {}
};
int _tmain(int argc, _TCHAR* argv[])
{
base obj;
return 0;
}
The constructor is not public, so how can you create an object like that? Also, I don't see why would you receive a C4430 for this. I thought it must complain about not being able to access a protected function. (C2448 or whatever, I ain't sure - don't have a compiler here Searched for it, found it - C2248[^]).
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Look at the placement of the reference specifier (the & ). It' meant to come after the type you want to reference. So, the compiler is seeing const&base as (const& )==type and (base )==parameter name.
Solution - use const base& .
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Mr. Eagle Eye prevails again. I hadn't noticed such a minute thing. Have a 5.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: Eagle Eye
That's what comes of too many years in safety-critical projects - stringent code reviews are an integral part of the process, so you develop an instinct for those small errors - you get of anything...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Use like constructor like
this base(const base&)
{
}
|
|
|
|
|
We have ported windows active x control plugin from 32bit to 64bit and we build cab file with my inf file.
We used dependency dlls mfc42.dll,olepro32.dll.
when we try to install cab file ...it crashes....
Do we need to change those mfc dll for 64bit?
Need help on this.
This is my detailed steps
1. Used VS2008 and compiled my active x control project with settings x64. IT generated my.ocx file and my.dll
file.
2. My inf file is
[version]
; version signature (same for both NT and Win95) do not remove
signature="$CHICAGO$"
AdvancedINF=2.0
[Add.Code]
my.ocx=my.ocx
my.dll=my.dll
; These are the necessary supporting DLLs for MFC 4.2 ActiveX Controls
mfc90.dll=mfc90.dll
msvcr90.dll=msvcr90.dll
olepro32.dll=olepro32.dll
rac5vml.dll=rac5vml.dll
; thiscab is a keyword which, in this case, means that rac5vm.ocx
; can be found in the same .cab file as this .inf file
; file-win32-x86 is an x86 platform specific identifier
; See the ActiveX SDK - ActiveX Controls - Internet Component Download -
; Packaging component code for automatic download
[my.ocx]
file-win32-x86=thiscab
; *** add your controls CLSID here ***
clsid={CCA1618B-7D6E-4432-8FA4-3E01A1AD78A8}
; Add your ocx's file version here.
FileVersion=0,0,0,0
RegisterServer=yes
[rac5vml.dll]
file=thiscab
FileVersion=0,0,0,0
[libeay32.dll]
file=thiscab
FileVersion=0,9,7,6
[libssl32.dll]
file=thiscab
FileVersion=0,9,7,6
I tried with mfc90.dll as well as still it crashes...Please help me out here.
modified on Monday, July 20, 2009 2:21 AM
|
|
|
|
|
I am using VC++ MFC Application wizard.I am having Windows 2000 professional at my work place.Actually there are many word documents with almost the same information, with little changes.As saving all these word documents will take unneccesary space in the system,I would like to use crystal reports,so that I can set the common format of this word document and make them as report and print whenever necessary.
As I havnt worked on crystal reports before, I just wanted to know Can I do the above procedure and which version of crystal reports should I download for Windows 2000 professional OS?Can anyone tell me..pls?
|
|
|
|
|
Hi,
Currently i write a program allow a user key in the numeric number into edit control. When the user press 'OK' button, it will check the contain what user key in, if is not a numeric number, it will popup a message box..
But i think this method is a bit not convenient, so is there any method can check the value when the moment the user is key in without press the "OK" button.
I'm waiting from your reply. Sorry for my poor English....
|
|
|
|
|
The parent window of the edit control will receive the EN_UPDATE[^] notification before the text is displayed. In this handler you can check the edit box text.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
DevelopmentNoob wrote: numeric number into edit control.
There is also property "Number" for edit control.
Check if it suits your need. I think it will not allow -ve and floating point numbers as well.
But it is better to check also as users can always copy paste anything they want in the edit box.
Regards,
Sandip.
|
|
|
|