|
Looking at the docs[^], you'll get sent an EN_MSGFILTER[^] notification, which includes a pointer to a MSGFILTER[^] structure. This structure includes the original mouse wheel message, which you could send to the form? So, if I understand your question correctly, you could do the scrolling by forwarding the mouse wheel message to the form.
|
|
|
|
|
Hello All,
I am doing SDI application in MFC (VC++) . In that parent, window is having a Menu Bar. When I select one of the Menu option from parent window, another child window will be created. This child window is having its own Menu Bar.
Problem is that this Menu Bar’s submenu is disabled at starting. But when I click on child window’s view, this child window’s submenu item is enabled. How can I enable child window’s submenu item without clicking on child window’s view.
I written the follwing code in the Parent window's MenuBar. When i click on this Parent window sub menu item, child window is created of the name "Bed1" and attach the MenuBar IDR_MENU1 to this chile window
//////
CFrameWnd* pFrame ;
pFrame = new CFrameWnd;
if(!pFrame->Create(NULL,_T("Bed1"),WS_OVERLAPPEDWINDOW ,CRect(0,0,200,200),this,MAKEINTRESOURCE(IDR_MENU1),NULL,&newContext))
{
TRACE0("Failed to create MenuBar");
}
pFrame->SetWindowPos(NULL,rect.left,rect.top,rect.Width()/2,rect.Height()/2,SWP_SHOWWINDOW);
//////
If anybody know the solution, please help.
|
|
|
|
|
I want to show hotkey for menu items like "Ctrl + L" etc.
I have given it with "\t" like "E-mail\tCtrl + E" to align it in right side.
But when running application, the hotkey text is not visible.
Instead of tab, if I give spaces, it is showing, but alignment is varying between systems.
How to solve this, is there any other way to do this?
|
|
|
|
|
Are you doing any sort of menu owner drawing?
If in doubt, create a brand new project, SDI app, and try tweaking that menu. If the new project works, and yours does not - you need to track down the error.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
I am using Xtreme Toolkit's CXTPToolbar to load the menu and other toolbars.
Instead of CFrameWnd, I am deriving my mainframe class from CXTPFrameWnd as I am using many stuff from Xtreme Toolkit for GUI style & design.
|
|
|
|
|
Well, you can do the step I suggested and create a virgin project. If that works correctly, you have either found a bug in CXTPxxxx, or a bug in your useage of it.
If you can confirm then, then maybe they have a forum there that can help you? You can still try here of course - just because I have no clue about this tookit doesn't mean nobody does - but you'll stand a better chance on their forums.
Good luck,
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hello,
I'm facing problems with the two-stage name lookup for templates, and I'm wondering what could be the right way to deal with it.
The issue is that non dependent names of template base class can not be "seen" at parse time in the derived class, and must therefore be made dependent, either using "this->" or qualification "base<T>::"
I can understand the usefullness of 2 stage name lookup, but also having all members and functions of base class used through "this->" in the derived class is "not a standard" and is ugly.
So What should be the right way of coding to work around this?
Thanks.
BR.
|
|
|
|
|
Can you post a sample code? What's the version of your compiler?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
One alternative mentioned by the GCC docs[^] is this:
template <typename T> struct Base
{
int i;
};
template <typename T> struct Derived : public Base<T>
{
using Base<T>::i;
int get_i()
{
return i;
}
};
i.e. have a using declaration to bring the base classes name into the derived classes scope. This declaration has to be at the class, not in the method(s) that use the base classes name.
[edit] PS - as far as I can tell, no Microsoft C++ compiler up to and including the one in Visual Studio 2008 does this as per the standard - it will see the non-dependent name even though it's not meant to. g++ does conform to the standard, however, and has done since at least gcc 3.4.2 (which is the earliest one I've got access to). [/edit]
|
|
|
|
|
Thanks Stuart for the reply.
"using" declaration can be in fact more practical...
About the compiler, I tried with gcc4.0.1.
|
|
|
|
|
In the same context, I'm trying to minimize the changes and extra code to be added in derived class, is there a way to group together the non dependent names? Can the keyword "export" be of any help?
Thanks for any suggestion.
Regards.
|
|
|
|
|
f_jo wrote: Can the keyword "export" be of any help?
Unlikely, given that export is supported by Comeau ++ and Borland C++ (possibly) and...well, that's it...
f_jo wrote: In the same context, I'm trying to minimize the changes and extra code to be added in derived class, is there a way to group together the non dependent names?
Not entirely sure what you mea.
|
|
|
|
|
Hi,
I'm writing a small app that uses plug ins in for of DLLs that export a class, to get the best compatibility I used am abstract interface as described in http://www.codeproject.com/KB/DLL/dlltips.aspx[^]
But I'm not sure what to do with functions that has to return a string, or that takes a reference to a string as parameter and modifyed it so that one function fills 3 strings.
afaik I should only use LPWSTR as parameter and in such functions and dont return any strings directly, but this brings the problem that I have to know prior how long the string may become, or define a max length that is always prealocated and the string cant be longer.
Is there some way that does not require much code how to properly pass the strings to the application?
Using 3x (GetStrLen & PutStr) functions isn't that prety.
I thought about allocating a WCHAR array in the dll and passing it to the client copying there and unalocating but afaik to be 100% correct i would need to dealocate it again inside the dll so it would have to give me an free function.
What would be the best way here?
|
|
|
|
|
There's not really one 'proper' way to do it - Microsoft use both techniques at different places in Windows (the Win32 API generally requires you to allocate strings in user code, while OLE has a custom allocator[^].
I'd probably go with the user pre-allocating buffers and telling me how large they were, like Win32.
Alternatively, you could probably design a string class (yet another string class!) that ensured that memory allocation and deallocation was performed inside your DLL (via constructor and destructor) without the DLL's client having to do too much work.
|
|
|
|
|
Hi
Is there a way to convert a text file into an image file(tiff file).
Thank you
Saadhinchaali
|
|
|
|
|
1. Open your text file in notepad.
2. Alt+Print Screen,
3. Copy to your favorite image editor save as TIFF(Paint .NET is free and a nice choice)
Normally Text file contains ASCII characters and TIFF file contains binary data with image headers, pixel data and any other associated information related to TIFF....
Please make your question clear. What's the content of your text file? and how you want to be converted?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Nice steps...
- ns -
|
|
|
|
|
HI,
Thats the esaiest way. Thank you for ur reply.
Saadhinchaali
|
|
|
|
|
Tritva wrote: Is there a way to convert a text file into an image file(tiff file).
If you mean to do it programmatically, you need to draw the text to some memory DCs and save it to bitmap. You can use BMGLib[^] to save to TIFF file.
- ns -
|
|
|
|
|
You can draw your text to memory DCs and then you can use of CImage class for save it(jpg,gif,...).
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi,
I managed to draw outlne for fonts of size more than 20 using the code below.
/////////////////////////////////////////////////////////////////////////////////////////
CDC *pDC;
...............
................
pDC->Beginpath();
pDC->Textout();
pDC->Endpath();
..........................
.......................
pDC->PolyDraw();
.............................
...........................
pDC->StrokeAndFillPath();
////////////////////////////////////////////////////////////////
But when the font size is small the string becomes unreadable as the black outline becomes too heavy .
Thanks
Naveen
|
|
|
|
|
Naveen_Kummar wrote: when the font size is small the string becomes unreadable as the black outline becomes too heavy .
Quite natural.
I think you need to increase character spacing or change to a better font... (just a suggestion)
- ns -
|
|
|
|
|
Hi,
Thanks for reply.
But one of our competitor has managed to do the outlined font of size 8 as attached.
Is there to do something with the pixel size of font?
Thanks
Naveen
|
|
|
|
|
Naveen_Kummar wrote: as attached
means?
- ns -
|
|
|
|
|
Hi I do not know how to attach a file here can you help me out??
|
|
|
|