|
Guess what - the answer's the same as when you asked this question before[^].
You need the VC++2008 redist for your program to run. You need to install that either within your MSI or separately - doesn't really matter which route you take, except obviously it's more convenient if you bunle it all up in the MSI.
|
|
|
|
|
|
You could also static link with your dependencies and avoid both the MSI and redistributable. Naturally your executable will be substantially larger as a result.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi,
I dont want to statically link the libraries.
I am using wise installer, where can i add the redistributable setup so that the redistributable setup run before the application is deployed.
Thanks.
|
|
|
|
|
Hi,
I have a RichEditCtrl in my dialog and the plan is, that I can hide some lines like you can in nearly every text editor or in Visual Studio as well. It would be perfect if it would work with those little boxes with + and - in it, but I would be satisfied if I could just do it with a right-click on the line and select 'hide' from the context menu and the text up to the next headline will get stored and be hidden so that I can make it visible again later. (The context menu is not the problem here )
I don't think RichEditCtrl does have something like this implemented. Does anyone have an idea how this could possibly be done? Because I start loosing my hair caused by all this scratching of my head
Thank you
|
|
|
|
|
You'd have to do it manually - remove the lines of text from the rich edit control and remember that you'd hidden them, provide some mechanism for unhiding that would re-insert the text into the control.
|
|
|
|
|
As far as i know -i never did this- you can insert OLE objects into rich edit view. So you could try creating an ole object that contains text to be hidden and can insert it back to the control when it is clicked. So your user could select some text and if she then wants to hide it you would create your OLE object, place the selected text (i guess with formatting and all that too) into it and then replace the original selection with your newly created object. Then, when the user clicks on your object, it would simply "paste" whatever it hols back onto the position it is on and then delete itself. No idea if this is possible or not, just an idea.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi Code-o-mat,
sounds promising, I'll have a look at this right now.
|
|
|
|
|
Hi,
just wanted to give you an update.
I've found a new possible solution: text object models.
According to the MSDN RichEdit controls are able to deal with those 'TOMs' and there is an interface called 'ITextRange' with a method named 'Collapse' which promises to do exactly what I'm trying to achieve. But I couldn't make it work so far.
|
|
|
|
|
Thank you for the update, sounds interesting, if you can, tell us/me if you get it to work and how you did it, always nice to learn something new.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
I would explain you how it works - if I knew...
Still no breakthrough.
What I have is the following which I got from an example I found:
IRichEditOle* pOle = NULL;
SendMessage(EM_GETOLEINTERFACE,0,(LPARAM)&pOle);
ITextRange* pTextRange = NULL;
pOle->QueryInterface(IID_ITextRange,(void**)&pTextRange);
Then I would try:
if (pTextRange != NULL)
{
pTextRange->SetRange(lChar, lChar+10);
pTextRange->Collapse(tomStart);
}
But after calling QueryInterface pTextRange is still NULL.
There are really few examples in the net concerning text object models. If I don't get it the next days I probably start a new question on this topic. Perhaps there is somebody around who knows how to handle TOMs.
|
|
|
|
|
SutterA wrote: pOle->QueryInterface(IID_ITextRange,(void**)&pTextRange);
What does this return? I believe it returns a HRESULT type something, check what it is, maybe it gives you a hint. It could be that you didn't initialize OLE with OleInitialize[^] yet.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
a step forward. It doesn't work with ITextRange directly but only with the ITextDocument so I changed it to:
IRichEditOle* pOle = GetIRichEditOle();
ITextDocument* pTextDoc = NULL;
pOle->QueryInterface( __uuidof(ITextDocument),(void**)&pTextDoc);
long lChar = (long)LineIndex(m_nLine);
if (pTextDoc != NULL)
{
ITextRange *pTextRange;
pTextDoc->Range(lChar, lChar+200, &pTextRange);
pTextRange->Collapse(tomStart);
Invalidate();
}
Now I have the valid pointers pTextDoc (ITextDocument) and pTextRange (ITextRange). I can compile and link and it doesn't cause a runtime error BUT it doesn't change anything in my richedit .
At first I thought perhaps I have to invalidate my RichEditCtrl but still no success. I'll continue to investigate...
|
|
|
|
|
Again, i say check what Collapse returns, maybe it's something logical, also try setting a range explicitly to 0 to 100 for example just to see if it works that way or not, maybe the provlem lies in the value of lChar or such...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
I checked this things... Collapse() returns (HRESULT)S_OK, so no problem there. Also I tried different values, like you said from 0 to 100.
Interesting is, that this is not the only Method that does not work from ITextRange. Some work like GetText() but others don't like ChangeCase(). This really starts bothering me.
But thanks for your interest and help.
|
|
|
|
|
Maybe Rich edit doesn't have those methods implemented and it only returns you S_OK and does nothing, althorough -afaik- the correct thing to do if you don't implement a method of an interface is to return E_NOTIMPL, so maybe it is something different.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
bad news. Seems the language problem was too big or the description in the MSDN too bad. Anyway collapse does not have the effect I though it would have. I found the following description:
The expand and collapse Methods
The expand method expands a TextRange object to fully encompass a character, a word, a sentence, or the entire text of the text edit owner on which it was created. For example, if the TextRange object spans a portion of a word, calling its expand method with the parameter word causes it to span the entire word. The expand method returns a Boolean value indicating whether the method succeeded.
The collapse method performs the reverse operation, placing the TextRange object's begin and end markers together as an insertion point. An optional parameter determines whether the insertion point is placed at the beginning or end of the current range; the default value is true, which places the insertion point at the beginning.
This means, it only changes the range that is marked and not the text itself. Too bad, this would have been nice and easy. Looks like I have to think about creating OLE objects myself again.
|
|
|
|
|
Think of it this way: now you have the great opportunity to learn about writing OLE objects. Too bad it doesn't work the way we thought it would. I haven't done much COM object implementing either (only a few times here and there), but if you get stuck somewhere feel free to ask, if i can, i will help, and i am sure others here will too. I think that IRichEditOle::InsertObject Method[^] could be a startup point for your "research", good luck.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi all,
I am developing a DrawCli like application in which I apply the double buffering using Keith Rule's class CMemDc.
Now the class works meanwhile I use the CView class as base class for my View class. When I use CScrollView I have some problem. Meanwhile I don't use the scrollbar there isn't any problem but when I use the scrollbar The part of the screen the isn't visualized before appears as white before it charges the object on the background so I have a flicker like effect when I scroll the screen.
To solve the problem I have thought to do a two bitmap structure with a bitmap that will contain all the scrollable area and a second bitmap that will contain only the part of the bitmap that will be shown on screen. I think that in theory the solution will work but I'm not able to develop that solution. My problem are:
1- How can I do a bitmap that will containt all the scrollable area?
2- How I have to organize the double bitmap system in order to make it efficient?
(in the article that I have read often to actualize the solution there are reference to cached bitmap should I have to use this solution and if yes how can i do that?)
Hope that I'll be clear thank you in advance for your help
|
|
|
|
|
I am trying to include AddFontResourceEx(Fontname,FR_PRIVATE,0); but get the error message that the function and FR_PRIVATE are undefined. Of course I have wingdi.h in the opening lines :
#define UNICODE // Save as Unicode -Codepage 1200
#include <windows.h>;
#include <wingdi.h>;
The error is produced when I try to compile.
I have added gdi32.lib to the command line.
What am I supposed to do about gdi32.dll ?
Thanks for any help
Raymond Mercier
|
|
|
|
|
Sorry, this failed to appear !
#define UNICODE // Save as Unicode -Codepage 1200
#include <windows.h>
#include <Winbase.h>
#include <WinGDI.h>
|
|
|
|
|
|
Thanks for the tip, but I should have mentioned that I have been compiling with VS 6 with Net Framework 1.1.
Meanwhile I have managed (sort of) with these lines, which do allow me to get the function.
I still fail to see why I have to go through all this, but not for AddFontResource,
and I still have to put 0x10, since FR_PRIVATE is not recognized.
static FARPROC fpAddFontRes,fpRemoveFontRes;
HMODULE hLibrary;
hLibrary=LoadLibraryW(L"gdi32.dll");
fpAddFontRes=GetProcAddress(hLibrary,(LPCSTR)"AddFontResourceExW");
fpRemoveFontRes=GetProcAddress(hLibrary,(LPCSTR)"RemoveFontResourceExW");
.....
nFontLoad=(*fpAddFontRes)(Bact,0x10,0);
At least this works fine !
Raymond Mercier
|
|
|
|
|
RaymondM wrote: Thanks for the tip, but I should have mentioned that I have been compiling with VS 6 with Net Framework 1.1.
My recommendation remains the same. The updated headers are included with the Platform SDK. You can use the Platform SDK with VC6. I have a copy of VC6 installed along-side several versions of the Platform SDK. I can't believe that you went this many years without it.
The LoadLibrary/GetProcAddress technique will also work if you choose to do it that way. But the next time you try to use a new GDI enum/constant or data type you might be back in the same boat.
RaymondM wrote: I still fail to see why I have to go through all this, but not for AddFontResource
AddFontResource[^] was included in the VC6 header distribution. AddFontResourceEx [^]is available in Windows 2000 and above and the header file was updated in the Platform SDK.
The declaration for AddFontResourceEx [^]is preceeded by:
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
So you would need:
1.) A header file with the AddFontResourceEx declaration.
2.) Declare a windows version greater or equal to _WIN32_WINNT_WIN2K.
Best Wishes,
-David Delaune
modified on Tuesday, January 27, 2009 3:19 AM
|
|
|
|
|