|
I had a in-process dll which is injected in IE (dll developed in vc6.0).
This dll shows affect in windowsVista IE& whwn protected mode is OFF, but it doesnot show its effect when protected mode is ON.
What may be the causes fior this?
Can anyone suggest something?
|
|
|
|
|
svt gdwl wrote: protected mode
The last time I heard this I was using Windows 3.1 on DOS.
|
|
|
|
|
humm does windows 3.1 has IE ?
|
|
|
|
|
I´m trying to use some Icelandic characters in a program:
wchar_t *unichars = L"áéíóúýðöæþÁÉÍÓÚÝÐÖÆÞ";
std::wcout << unichars << std::endl;
The output I get in the console isn't great:
ßΘφ≤·²≡÷µ■┴╔═╙┌▌╨╓╞▐
Any idea on what is going wrong?
Jon
|
|
|
|
|
Jon wrote: Any idea on what is going wrong?
Set your locale to Icelandic:
_tsetlocale(LC_ALL,L"Icelandic");
Best Wishes,
-David Delaune
|
|
|
|
|
Thanks for the reply, that does help the console output (although it still isn't quite right).
I think the actual problem I was having was the encoding dev studio was using to save the file. Somehow the characters appear fine in the editor but only compile correctly when I saved the file in "Unicode - codepage 1200" format.
Jon
|
|
|
|
|
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
|
|
|
|