|
Llasus wrote: sorry if i did not mention but I am specifically looking for a sort of process which I should do with my codes or rather an existing object within c++.
If I understand it right, you want to redo something similar? Why would you do it, when somebody has already done it? The classes I linked you to are built very well, presented to the community and are already being used by people.
I suggested you to use it because it will enable you to build a more friendly and more easily manageable user interface. If you are worried only because your application is cluttered with lots and lots of dialog boxes and you don't know how to manage them together, then CTreePropSheet or CTreePropSheetEx are very good options.
Llasus wrote: I'll maybe import this if there is really no other possible way.
You see, there's a thing called code-reusability, which is one of the major advantages of OOP. Why don't you take full advantage of that? Making use of those classes will do good for you, because you are with a typical problem of having lots of dialogs and you don't know how to mend them together. By using either of those classes, you could also group dialogs that are closely related into a category. By all means, I will suggest you to at least try either of those classes once.
|
|
|
|
|
Rajesh R Subramanian wrote: If I understand it right, you want to redo something similar? Why would you do it, when somebody has already done it? The classes I linked you to are built very well, presented to the community and are already being used by people.
no, actually I want to find another option or another way that I can do. Like I am reading about design patterns and looking for one that could be applicable to this problem. Sorry if I might have not clearly explained myself well. I appreciate that I now have one possible solution which is the CTreePropSheet but I just want to know if there would be other solutions. Certainly I won't attempt to redo this, unless I have lots of time, knowing it's already proven and tested by the community.
Rajesh R Subramanian wrote: By all means, I will suggest you to at least try either of those classes once.
Thanks and I will try this first thing tomorrow. But even with this, I would still like to know if there are any other possible solutions to my problem. greatly appreciate it. thanks.
|
|
|
|
|
Hi everybody......
I hav a small query on ActiveX Combobox control. I was not able to add items to a Microsoft 2.0 combo box (ActiveX) control. Please help me if anybody knows
Thanks in advance
Sai
|
|
|
|
|
Hi I'm Rathakrishnan. I have created File Save Dialog using MFC. The code is,
void CPerspectiveDoc::OnFileSave()
{
if(CurrentPath == "Untitled.vps")
{
char acFilters[] = "VPS files (*.vps)|*.vps||";
CFileDialog filedialog(FALSE, "vps", CurrentPath, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
acFilters);
if(filedialog.DoModal() == IDOK)
{
CurrentPath = filedialog.GetPathName();
JustPath = CurrentPath.Left(CurrentPath.ReverseFind('\\')+1);
}
}
The Save as Type Combo Box contains only "VPS FILES(*.vps)" string. Now I want to add this string also to the Combo Box ("NIF FILES(*.nif)). How can I do this?
|
|
|
|
|
Just change your filter:
char acFilters[] = "NIF Files (*.nif)|*.nif|VPS Files (*.vps)|*.vps||"<div style="display:none;" class="CPhogPost"></div>
<div class="ForumSig"></div>
|
|
|
|
|
No. Changing the filter alone as u said is not working. What else can we do?
|
|
|
|
|
T.RATHA KRISHNAN wrote: Changing the filter alone as u said is not working.
Please elaborate me on what you mean by "not working"?
|
|
|
|
|
The string "NIF files (*.nif)" was not displayed in the Save as type Combo Box. What to do?
|
|
|
|
|
|
This is the code.
void CPerspectiveDoc::OnFileSave()
{
if(CurrentPath == "Untitled.vps")
{
char acFilters[] = "VPS files (*.vps)|*.vps||";
CFileDialog filedialog(FALSE, "vps", CurrentPath, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
acFilters);
if(filedialog.DoModal() == IDOK)
{
CurrentPath = filedialog.GetPathName();
JustPath = CurrentPath.Left(CurrentPath.ReverseFind('\\')+1);
}
}
|
|
|
|
|
T.RATHA KRISHNAN wrote: char acFilters[] = "VPS files (*.vps)|*.vps||";
What a waste of time! You haven't added the new extension to the filter! Indeed, this code will be "not working".
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Sorry.I undo the extension. Here is the new code. This also not working.
void CPerspectiveDoc::OnFileSaveAs()
{
char acFilters[] = "NIF files (*.nif)|*.nif|VPS files (*.vps)|*.vps||";
CFileDialog filedialog(FALSE, "vps", CurrentPath, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
acFilters);
if(filedialog.DoModal() == IDOK)
{
CurrentPath = filedialog.GetPathName();
JustPath = CurrentPath.Left(CurrentPath.ReverseFind('\\')+1);
}
CDocument::OnSaveDocument((LPCTSTR)CurrentPath);
SetTitle(CurrentPath);
}
|
|
|
|
|
T.RATHA KRISHNAN wrote: CFileDialog filedialog(FALSE, "vps", CurrentPath, OFN_
What is CurrentPath ? This works for me:
char acFilters[] = "NIF files (*.nif)|*.nif|VPS files (*.vps)|*.vps||";
CFileDialog filedialog(FALSE, "vps", "hello", OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,acFilters);
filedialog.DoModal();
|
|
|
|
|
It's working now. Thank u.
|
|
|
|
|
hi...
i was declared as
_variant_t vc;
FieldPtr fieldpointer;
but the error is
_variant_t undeclared identifier.
FieldPtr undeclared identifier.
should i add any header file?
i think this is a silly question.
but sorry... i don't know.
paulraj
|
|
|
|
|
gnanapaul wrote: i was declared as
_variant_t vc;
There lies the problem, you should have declared yourself as "real".
|
|
|
|
|
_variant_t is defined is comutil.h
and
You should import <msado.dll></msado.dll> before using FieldPtr
A Chinese VC++ programmer
|
|
|
|
|
thank you.
_varient error is cleared now.
am using mfc.
here how can import?
pls can you tell brief or pls can you send sample code?
paulraj
|
|
|
|
|
hi...
thank nyou for your guidance...
i got the output.
paulraj
|
|
|
|
|
Hello everyone,
Could anyone help to explain what does the two rules for unique pointer mean?
http://msdn2.microsoft.com/en-us/library/aa367294(VS.85).aspx
1.
Especially confused about "before the call"
Can use existing memory on the client without allocating new memory. When a unique pointer changes during a call from one non-NULL value to another, the pointer is assumed to point to a data object of the same type. Data returned from the server is written into existing storage specified by the value of the unique pointer before the call.
2.
Can orphan memory on the client. Memory referenced by a non-NULL unique pointer may never be freed if the unique pointer changes to NULL during a call and the client does not have another means of dereferencing the storage.
thanks in advance,
George
|
|
|
|
|
Now I want to display images in a list without text.
For example, I've several 80*80 images to show in the list, how to specify each item size to 80*80, no more no less.
Thanxxxxxxxxxxxxxxxx.
|
|
|
|
|
|
I don't want the text below the image.
|
|
|
|
|
Using CImageList's Create function, and specify width and height to the value you want.
A Chinese VC++ programmer
|
|
|
|
|
How to do if I don't want the text below the image.
modified on Thursday, February 14, 2008 2:15 AM
|
|
|
|