|
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??
|
|
|
|
|
I too don't know... If possible, upload the image file to any free file hosting sites. So others can view the file...
- ns -
|
|
|
|
|
Hello,
I have an application that monitors phone calls,
when a new call arrives I'm opening a new tab on my PropertySheet using AddPage and then SetActivePage.
What happen is that when the application is minimized and a new call comes in, I'm losing focus on what ever i'm working on, (playing a game / word / writing this message).
I don't want to change the application so it will not Create the window when the application is minimized, it is very important that all works the same even if it is minimized.
Is there a way I can create the page, but not set it to SetActivePage? or to do it but without losing focus?
Thank you.
Rami.
|
|
|
|
|
Ugly, but...you could try disabling your property sheet or window it contains when adding a new tab and then re-enabling it, maybe by using this with SetRedraw() to avoid flickering...since disabled windows probably are not allowed to get the focus.
> 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. <
|
|
|
|
|
m_sheet.EnableWindow(FALSE);
m_sheet.SetActivePage(m_pCalDlg);
m_sheet.EnableWindow(TRUE);
And problem is solved !!!
I can't describe to you how much efforts I wasted on this
Thank you very very very much
|
|
|
|
|
Yourwelcome, i'm glad i could help.
> 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 have a .reg file which copies some menu items as keys in the registry. My dll collects all of them and show up on right click if i selected any thing on the explorer.
How to make my 32 bit com dll works in 64bit machine? I recompiled in 64 bit machine using visual studio 2008. It did not show up the right results. it is not showing up any menus on the right click.
Thanks in advance.
Regards,
|
|
|
|
|