|
Thank you very much for your suggestion.
I have a doubt in the first one. Is there any standard library container which stores different data types in one list, i mean first object is 'int', second is some user defined and so on?
In the second suggestion by saying 'Exploit polymorphism' i beleve you are talking about run time polymorphism i.e using virtual functions. But i am afraid i can't do that because the base class doesn't know about the object type to do any manipulation. If i make it a template class then i cannot have a base pointer in node to point to any data type.
Thank you once again for your time and effort.
|
|
|
|
|
C.P.Rajesh wrote: Is there any standard library container which stores different data types in one list, i mean first object is 'int', second is some user defined and so on?
No. But you could save yourself the complete container hassle, and focus on the conversion.
Or, you could use STL container with boost::any[^]
Boost is quite renowned for their rigid code review and their focus on well thought out concepts.
Its founder list is a who-is-who of the c++-world.
A number of classes from that web site will be part of the next C++ standard library.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
hi,
I am developing SDI application ,inherits from FomView.
It is required that i have to use TTF font type(which i downloaded from Ineternet) on button in run time.
Thank u....
|
|
|
|
|
You can use of CFont::Create and use of SetFont.
|
|
|
|
|
Mira wey, necesitas poner:
CMyView : public CFormView{
CFont fontButton;
//
};
CMyView::OnInitialUpdate(){
LOGFONT lf;
memset(&lf,0,sizeof(lf));
lf.lfHeight=(int)(33);
lf.lfWeight=FW_BOLD;
strcpy(lf.lfFaceName,"Arial");
m_fontButton.CreateFontIndirect(&lf);
GetDlgItem(IDC_MYBUTTON)->SetFont(&fontButton);
}
|
|
|
|
|
hi..
Thanks for Reply..
But when i try to do the same
but "AkruthiDev1"(ttf font for Hindi)inplace of "Arial"..
the code doesn't work..
In some aticle ,they mention that we have to use EnumFontProc() callback function.
Can u please tell me ,how to use that function.
|
|
|
|
|
nop. You Need Install the Font, copy the file .ttf to C:windows/Fonts or $system$/Fonts
Open ControlPanel->fontS
go to menu File->Install New Font
Choice your file .ttf for intall in windows
|
|
|
|
|
i have a huge folder that has over 200 files.
the format of the file struture os like this
main folder -> 3 sub folders
subfolder1 -> folder1, folder2, folder3 ... foldern
subfolder2 -> folder1, folder2, folder3 ... foldern
subfolder3 -> folder1, folder2, folder3 ... foldern
folder i to n has files
everything together will be some 2 gb of data.
i hope the folder structure is clear
now the requirement is each folder has files and there are headers in each file.
i want to extract the header and show the parameters on the combo box. how do i do that?
|
|
|
|
|
Im not sure do you need to FindFirstFile/FindNextFile? for show files
|
|
|
|
|
If your names are very predictable, how about something like:
...
CString s;
CFile f;
for (i = 0; i < 3; i++)
{
for (j = 0; ; j++)
{
s.Format ("c:\\subfolder%i\\folder%i\\blah.file", i, j);
if (!f.Open (s, ..., CFile::modeRead, ...))
break;
f.Read (stuff);
DoSomething (stuff);
f.Close ();
}
}
?
Check parameters for yourself - I know CFile::Open has not been done correctly.
If your subfolders have more random names, then you're going to have to use FindFirstFile / FindNextFile. It will be a bit harder, but not lots.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
hi ,
In dialog based application i have added one menu bar. this menu working properly before apply the theme. but when i am applying theme to dialog then menu position will be changed and disappeared. y it is happening like this.
have any idea to reposition the menu bar?
or any way to solve this problem?
Regards,
Srinivas
|
|
|
|
|
Actually after 45 hours of endurance test of our application, a crash occured at SaveDC please let me know when the SaveDC fails.
Here the SaveDC is returning 0.
|
|
|
|
|
|
In what cases SaveDc returns 0?
|
|
|
|
|
Did you use of GetLastError for see error information?
|
|
|
|
|
No I didn't use GetLastError(), I will check with it. Thank you for reply Hamid.
|
|
|
|
|
You're welcome,I hope you can find it.
|
|
|
|
|
hello everybody
i have taken as input the wireless packets. it contains a two byte control field. i want to extract bits information from these two byte information. how can i do that.
Like control field has 2 bits of type information and 4 bits of subtype information . i want to extract these pieces of information. can anybody tell me how can i do that. in what data type should i take the bits information.
thanks
|
|
|
|
|
|
Hi,
I have a static CString variable declared in the dll.
static CString strUserName;
After which i make some modification to this CString inside the file. Now, I want to export this value.
However in the .def file of the dll, in EXPORTS i mention only the variable name.
EXPORTS
; Explicit exports can go here
strUserName
But i am getting linker error.
Linking...
AppProject.def: error LNK2001: unresolved external symbol strUserName
Kindly help
Priya Sundar
|
|
|
|
|
Priya_Sundar wrote: static CString strUserName;
Remove the static keyword from declaration. If the varaible is global, then there is no need of static isnt it?
|
|
|
|
|
I suspect you also need to declare in the CPP file that the variable will be exported, using __declspec(dllexport) .
But I've never actually exported a variable. Always a class, or a function which can modify or retrieve that variable. This gives me room at a later date to change how I work on the variable. Does it exist in the DLL? Do I interrogate some other resource (ie a DCOM object) for it, etc. It gives me more flexibility. Just a style recomendation, not a RULE.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
hi all,
i am trying to use a .lib file in dialog application by adding name of .lib in project settings linker tab and adding .h file in the project which is having declarations of functions this lib file contains.
i am receiving linker error , meaning that linker is unable to find definition of these functions.
i'll be thankful if somebody helps
|
|
|
|
|
How to get the system time in MFC?
Give me some samples r urls
Regards
Nisha.S
|
|
|
|
|
nisha00000 wrote: How to get the systemtime in MFC?
The solution resides in your query itself. See GetSystemTime().
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|