|
Subclass or hooks I would think!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
For example:
Move "Hello world" from CRect(0,0,100,100) to CRect( 100,100,200,200) smoothly in a view.
I don't like to earse all area of view and then redraw it, because it is too slow.
I'm amumu, and you?
|
|
|
|
|
Check out ScrollWindowEx() . It should do what you need.
Alternately, check out my article
You'r apostrophe bug's me.
|
|
|
|
|
InvalidateRect() is your clown
- Roman -
|
|
|
|
|
Hi,
I am creating an app that integrates the CHtmlView. On certain occasions, I would like to load a HTML file (or images) from a resource dll, so that all the files are kept together, cannot be deleted or edited etc.
Has anyone succeeded in creating a DLL with resources in it used by Internet Explorer and the res:// protocol?
If so, could it be explained how, or does anyone have *decent* links to:
1. how to create a resource dll
2. how to make resources accessible from it to IE and the res:// protocol
Thanks in advance,
Simon
PS: I have seen the (very) few MSDN articles, that have left me suitably high and dry.
|
|
|
|
|
Do you mean res://yourdll.dll/yourpage.html ?
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
Yup, that's exactly what I am after.
I created a Win32 Dynamic-Link Library project (empty) and ripped all the code link settings out, then added a resource file. To that I added a HTML resource, with the resource identifier IDR_HOME.
This resulted in the following line being in my resource file when viewed as text: IDR_HOME HTML DISCARDABLE "home.htm"
Also, a home.htm file gets created in my project folder, so I put in some source and then build it.
Then typing in the actual path (given here for completeness):
res://C:\Program Files\Microsoft Visual Studio\VC98\MyProjects\HtmlRes\reslocal\Debug\reslocal.dll/home.htm
simply results in the 'Page Cannot be Displayed' IE error from it's own shdocl.dll thingy.
Anything obvious I am doing wrong here?
Thanks,
Simon
|
|
|
|
|
Make the resource ID "HOME.HTM" with quotes, then red://reslocal.dll/home.htm will work.
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
Absolutely stunning! Cheers so much Matt.
I wasn't far away (well I was), I had it working with the resource identifier bit:
blah-blah/%23101
The quotes has just made it all look so much more friendly when the source if viewed etc.
Thanks again,
Simon
|
|
|
|
|
No problem. It was a simple problem with an answer someone would never think of
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
Create an HTML resource in your module (can be an EXE or DLL) with a string ID (not an integer ID) and reference it like:
res://C:\path\to\your\file.dll/YOURPAGEID.html
--Mike--
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
Thanks for the pointer Michael.
It seems obvious know that a string id is one with " around it, but that don't look right in the IDE, so I was having trouble with that in the end. All working now though.
Thanks,
Simon
|
|
|
|
|
It's said that if two threads in different processes communicate with each other, a window must be there for the sake of a message called WM_COPYDATA.
My question is:
Without any window, can these two threads communicate with each other, and how?
Best regard
Best regard.
I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
|
|
|
|
|
If the target thread/process does not have a window then WM_COPYDATA is not an option for you.
If it is only simple data you can try using the clipboard, though you can't notify the target thread. It'll have to keep checking the clipboard on it's own.
I guess you can try memory mapped files [a topic I know nothing about]
Nish
If I am awake and my eyes are closed, it does not necessarily mean that I am thinking of naked women.
|
|
|
|
|
The following possibilities spring to mind...
* mutex/event if only signalling is required
* Memory mapped files(I seem to recall a rather nice tutorial on this site somewhere)
*Sockets
*Local RPC (You need to understand IDL)
*Named pipes (Similar in concept to sockets)
*DCOM
I'd probably use sockets myself, because that's what I'm most familiar with.
Rob.
|
|
|
|
|
I am completely frustrated!
I have read from several sources, that you can use the GetIRichEditOle() function to get to the ITextDocument interface for a CRichEditCtrl.
I am using VC 6, and the RichEdit version looks like it is 3.0.
I am using the following code:
ITextDocument *pTextDoc = NULL;
IRichEditOle * ire = m_RichEdit.GetIRichEditOle();
if ((ire == NULL) || (ire->QueryInterface(IID_ITextDocument, (void**) &pTextDoc) != S_OK) || (pTextDoc == NULL)){
DWORD dwErr = GetLastError();
if (ire != NULL)
ire->Release();
TRACE("Failed ITextDoc\n");
}
The pTextDoc is always NULL. The GetLastError() returns 0.
I have also tried the method specified in MSDN, but it fails also. The method they use is very similar to the above code, so that's no surprise.
I am getting desperate! I need to get the ITextDocument interface to do some things like set the line spacing.
Please, if anyone knows how to do this, let me know.
Thank you very much,
David
|
|
|
|
|
Check the return value from QueryInterface() - that should give a clue regarding what error happened. Enter the return code into the Error Lookup util (on the VC Tools menu) to get a text description of the error.
--Mike--
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
Thank you for the suggestion. I forgot I could get that information from the Query call.
The code was 0x80004002 which means no such interface supported!
Any idea why?
Have you ever tried this? Do you think it is possible that MFC is actually using a differnt RichEdit implementation? I also have RICHED.DLL, and RichEd32.dll, in addition to RICHED20.DLL. The debug output shows that RICHED20.DLL is being loaded, so I should be OK right (RICHED20.DLL has v3.0 support)?
Thanks again,
David
|
|
|
|
|
|
Thank you very much.
I see the problem. I'm actually trying to use CRichEditView. I see where the call is being made.
I guess I will have to play around with loading the RICHED20.DLL, maybe by overriding PreCreateWindow()? I'll try not to bother you again.
Thank you.
David
|
|
|
|
|
Can I use those modes together?
I got an error message that says that an error occured when tried acces the file... hmnmm....
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Use CFile::modeReadWrite instead.
--
Andrew.
|
|
|
|
|
I see you got your answer so I feel able to make my usual comment in addition - if you use iostreams they will do the same thing and you won't be tied to MFC. You'll also be able to easily extend your stream to accept your own types.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Christian Graus wrote:
You'll also be able to easily extend your stream to accept your own types.
How!!!!!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
By writing iostream insertion and extraction operators. I guess I should write an article...
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|