|
toxcct wrote: TCHAR pStr[50] = {0};
CString str = _T("Hello World");
pStr = (LPCTSTR)str;
You might want to rethink this.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: You might want to rethink this
:->
is it better now ?
|
|
|
|
|
i have a listView control has over 1000 no of items displayed, and a text box on which user types to filter the items in listview.
my problem is how to filter the items in ListView contorl. is it possible to hide contents in ListView? or any other idea to do so ?
Thanks & Regards
|
|
|
|
|
nitin3 wrote: is it possible to hide contents in ListView?
No, you have to change the ListView content.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I would make it, saving the original data in a place, and then according on the filter, take the relevant data, erasing all datas in the list ctrl and filling it another time.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
You could make two controls, and one will always be visible and enabled and the other one will always be hidden and disabled. That way the main (unfiltered) control does not need to be recreated each time, which makes things easier for you, Windows and the user.
I need to do the same type of thing that you are describing and that is how I intend to do it.
There are many other possibilities, depending on what you need or want to do for the user.
|
|
|
|
|
Hi all,
I have made a dialog based application. In that application from the main dialog box i am opening a second dialog box, on that dialog box i have made a button control and on clicking the button a context menu appears. Now my problem is i have to write functions on items of that context menu. i derive them from the class on which button is made that is second dialog box class.
Function is being made in the second dialog box class but when i write code for displaying the message box....Nothing happens on the click event.
Can anybody please solve my problem.
Thanks in advance
|
|
|
|
|
can anybody tell me how to print the datagrid.I am using ado to load the datagrid
||SnAkeBed||
|
|
|
|
|
iam not sure about any api which prints the data grid. but i can suggest you some technique to achieve your task. even i use the same technique, to get my data printed.
1.write a function to print the data in the grid to a text file.
2.using system command or createprocess command, try to print it.
if you want, then i can share the function iam using to print the flex grid contents. may be you may have to fine tune it to suit your data grid.
good luck.
|
|
|
|
|
I want to use ffmpeg library to convert my data(could be anythng simply camera picture or char *) to flv for live streaming. So i would like to know how could i include ffmpeg library into my application.
Regards,
Hemang
Hemang Raval
|
|
|
|
|
Hi,,
Is it Possible to include DLL project into the MFC Activex project's solution??
Thanks.
Ashish Bhatt
|
|
|
|
|
I need to get handle to EXE's icon to use it in other DLL/EXE.
How do we get it?
|
|
|
|
|
Hi,
I asked a few days ago about associating files with application and someone answered me with a link about icons, maybe that link is helpfull for u. This is my message[^]
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Do you need to SHGetFileInfo ?
|
|
|
|
|
hi all,
in the dialog we are initializing through initdialog , as like in the form how we do that?
thanks
panthal
|
|
|
|
|
look for OnInitialUpdate
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
thank u nelek, just now i found that.
thanks for ur response
panthal
|
|
|
|
|
Hi,
I need to use a function that uses an array of pointers to a base class, and inside the function handles the pointer according to it's real type (Tha actual type is a derived class).
But i get an error when i call the function :
"Object0124.cpp(1905) : error C2664: 'InsertOutputData' : cannot convert parameter 1 from 'class Array<class Object0124::CDerived *,class Object0124::CDerived *> *' to 'class Array<class Object0124::CBase *,class Object0124::CBase *> &'
A reference that is not to 'const' cannot be bound to a non-lvalue"
I hope that it's clear:
h. file
----------
class CBase
{
int x;
CBase(){x=0;}
};
class CDrived :public base
{
int y;
CString z;
CDrived(){y = 0;z = _T("");}
};
typedef Array<CBase*,CBase *> m_CBaseArray;
typedef Array<CDerived*,CDerived *> m_CderivedArray;
void InsertOutputData(CBaseArray &arrInput,int Mode);
cpp file
---------
void Func()
{
CderivedArray arr;
CDrived var;
var.x = 10;
var.y = 16.533;
var.z = "value"
arr.Add(var)
InsertOutputData(&arr);//or InsertOutputData(arr);//error C2664
}
void InsertOutputData(CBaseArray & arrInput,int mode)
{
for(i = 0;j = 1; j < arrInput.GetSize(),!; j++)
{
if((arrInput.GetAt(i)->x != arrInput.GetAt(j)->x))
{
if(arrInput.GetAt(i)->y == arrInput.GetAt(j)->y)
{
//do something
}
}
}
}
Can anyone tell me what am i doing wrong???
-- modified at 5:22 Tuesday 6th November, 2007
|
|
|
|
|
Your code is unreadable. Check point 5 here[^]
|
|
|
|
|
mrobeda wrote: Can anyone tell me what am i doing wrong???
You treat
typedef Array<CBase*,CBase *> m_CBaseArray;
typedef Array<CDerived*,CDerived *> m_CderivedArray; as being related types.
They are not. The fact that CDerived is related to CBase does not make the container types releated.
What is related, though, are the dereferenced items of both containers.
What is Array<T>, btw?
A bastardized STL-class?
MFcs CArray, the handicapped step-brother of a STL-class?
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"
|
|
|
|
|
Array - inherit from MFC's CArray and created my AArray.
So how can i use a generic array that can handle different type of objects?
I need that the fuction will get each time a different type of object in the array.
|
|
|
|
|
mrobeda wrote: So how can i use a generic array that can handle different type of objects?
You just have to use an array that is declared as an array of pointers to your base class. Then you can fill it with pointers to child classes if you want to (but you need to create the objects dynamically with new, and not forget to delete them afterwards). That's the power of polymorphism
|
|
|
|
|
mrobeda wrote: So how can i use a generic array that can handle different type of objects?
Personally, I would create a pure abstract base class (Interface) for the object-types I would need to put in the container.
You could then either use RTTI/dynamic_cast or a self-devised mechanism of type-determination.
May I ask if you come from a scripting-language background?
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,
Thanks for your help, i took Cedric Moonen advise (part of it).
btw - the answear to your question is no.
|
|
|
|
|
On my MFC application I read file and do some process on it. Here is the code I used to open and read only.
<br />
CFile srf_ReadFile;<br />
char * srf_FilePath = "ReadFile_001.txt";<br />
if(srf_ReadFile.Open(srf_FilePath, CFile::modeRead))<br />
{<br />
}<br />
So, the file should be always in the same folder which the project/solution contain. If I want to read another file, say ReadFile_002.txt, have to do it manually, go to the code and gives the new file name.
char * srf_FilePath = "ReadFile_002.txt";
It is too boring. So I want to make it more reliable to use. I want to add a browse button(I think that is the correct word, which is used to find the file in Windows) and set it as the file which I want to read.
How can I do it. Can you guys explain.
I appreciate your help all the time...
Eranga
|
|
|
|