|
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.
|
|
|
|
|
Same as the previous reply: if you only need a basic numerical edit (no floating point for instance), then you can simply set it as a property on the edit control. Only numbers can be entered then.
If you need something a bit more complex (e.g. support for floating points), you could reuse one of the existing control on CP[^]. The first one looks promising but you might want something simpler. Simply check the list and find something that suits your needs.
|
|
|
|
|
Thank you for the guide. i will try my best to done it.
by the way, the data i store is include the floating number..
|
|
|
|
|
Hi,
i need to increase the height of a headerctrl ..So can i call Movewindow() in DrawItem method...
Please correct me if im wrong..
|
|
|
|
|
Are you trying to increase the height of a list control's header control? If it is, I guess the only way for doing that is by changing the font size of the list control.
|
|
|
|
|
in onpaint() of headerCtrl i changed the font but the issue is only half of the font is visible in Header ctrl..when the font is bigger...
|
|
|
|
|
No no..Change the font ( Call Setfont() ) of the list control from the onInitdialog() function of the dialog.
|
|
|
|
|
|
In Windows Vista (only) when I double click on a file in Windows Explorer that is associated with my application Vista displays: Windows cannot find "abc.def". Make sure you typed the name correctly and then try again." Where abc.def is the file I double click on in Explorer and it is associated with my app.
My app starts, if it isn't already running and the file does get opened correctly. Likewise if my app is already running the file is opened correctly. But this error is always displayed.
If instead I use "Open With" and select my app the file opens and no error is displayed.
I've Google'd and found various posts from people getting this error with Word, Excel files etc. but no real solution.
|
|
|
|
|
Neville - a suggestion - why not use Process Monitor[^] to see what Windows is actually looking at - you may well find the operation that can't find abc.def, and that might give you the clue you need to solve the problem?
That's what I'd do, anyway!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|