|
Think of an object as a person, place, or thing that represents what a system needs to know and do about an actual person, place, or thing. Think of an object in first-person form. Instead of saying "How can it do ____ to that object?", say "I am a ____. I know hot to ____ myself." instead. When you can look at an object in this fashion, the laying out of objects and the relationship(s) between objects becomes clearer. Something that I learned in undergraduate school was that of "strong cohesion, weak coupling." While it was not discussed in the context of OOP, it still applies.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi all, im sure this will be an easy question for some of you but i have failed to find an answer after searching through previous posts.
When i open a CFileDialog in my app the directory it starts in is different to the return value of GetCurrentDirectory() (and _getcwd). How do i get the directory that a CFileDialog would point to if i were to open it?
Cheers for any help,
Andy.
|
|
|
|
|
Does this help?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Cheers for the reply but no. I dont want to set the initial directory of the CFileDialog. I want to get the directory that a filedialog will point to if i were to use it. This directory may be different to the current working directory. MFC must be storing this somewhere in the registry based on the app name but i'll be buggered if i know where.
Cheers anyway.
Andy.
|
|
|
|
|
Have you looked at the documentation for the lpstrInitialDir member of the OPENFILENAME structure? I'm pretty sure that it details what Windows will use as the directory when one is (not) specified.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
One solution is CFileDialog's GetPathName() member function.
Kuphryn
|
|
|
|
|
Cheers for the reply.
I tried that but i dont want to have to store this value anywhere and i cant guarantee a file open dialog being used before displaying my folder open dialog (which is the thing i want to point to the same location).
Any other ideas?
|
|
|
|
|
Okay.
Your original question was not very clear. Do you want to get the full path of the file that a user had selected via CFileDialog? Do you want to set the directory where CFileDialog first starts out?
Kuphryn
|
|
|
|
|
I want to get the directory that a CFileDialog choses as its initial directory if the lpstrInitialDir of the OPENFILENAME structure is left empty.
There is an algorithm it uses to choose this directory (as explained in the OPENFILENAME documentation) but i want to be able to call a function (on something) to get me this directory without having to replicate this algorithm myself.
So i dont want to do either of what you suggested.
Cheers for your help.
Andy.
|
|
|
|
|
It is random. I have seen it initialize to the document directory. Other times it initializes to the system drive, C.
Kuphryn
|
|
|
|
|
I'm program a music program. How i can use winamp's visualization with my program. Where i can find some information? Thank you very much
Nothing
|
|
|
|
|
|
Can you tell me more exactly. thanks
Nothing
|
|
|
|
|
Are there products that contain gauge and dial widgets for use with Visual C++? I have use xDesigner (Linux) and the gauge, needle, scale, range widgets are handy to use.
|
|
|
|
|
There are a number of these libraries around for Windows. I think National Instruments is one company that does this. You will also find code here and on Codeguru for individual controls like guage etc. A Google search should help you find the main players in this space.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I have this situation:
I have a CDialog and in it some ctrl's. I Enumerate all the ctrl's in it to let another window take over (a CTabCtrl derived class) the ctrl's for itself - working as a delegate for the "real" other window (called Wr here) - the dialog. This I do in order to let pages of the tab-ctrl work with the ctrl-sets to mimic that the dialog is embedded into the tab. So on tab shown I go SetWindowPos(...) on all the child's etc.
I use ::SetParent(hWndNewParent, hWndChild) for taking over the ownership - all works just fine!
Now my problem: How do I STILL let the messages from all kinds of ctrls go to the Wr (dialogs in this case and later on CView's)? Say I press a btn. on tab 0 - now the BN_CLICKED generated as a result of this press go to hWndNewParent (the CTabCtrl derived) and I want to route it to the Wr. This wish is because we already have all msg-handlers installed in lots of Wr's and would like to have'm stay their - otherwise it's mixed into a CTabCtrl derived and - well; no good!
My sugestion is still to catch "all interesting" messages on the new object and then go in the direction of (pseudo): pTabDlg->PostMessage(msg)...
So in other words my CTabCtrl derived class is a delegate only. Can I do that? I can use any help I can possible get – thanks in advance!
Regards,
Michael Mogensen, mm it-consult dk.
><((((º> ·.¸¸.· ><((((º> ·.¸¸.· ><((((º>
|
|
|
|
|
Hi, I have a custom CTreeCtrl, the problem is that the HScrollbar is not more working correctly, because the rect of the item insert in the tree is different than the rect that i use paint. So i tried to implement my own HScrollfunction, i know the item length, and can set the Scrollbar with SetScrollInfo, that works perfectly i can also calculate the offset to scroll. I use the customdraw function to scroll the screen with setWindowOrg(xOffset,yOffset). As next i can catch nearly all mouse events and also set an offset, i have only one problem with the TVS_HASBUTTONS that is not working correctly (The offset i calculate has no influence), any idea why? Or is there another way to scroll, a custom treectrl? Is it not possible just to change the item length somehow? So the windows standard behavier of the treectrl would do the scrolling for me?
I would be happy for any help or ideas...
|
|
|
|
|
In VC,why I cannot open the project of CDex downloaded from "http://sourceforge.net/" ? Thank you first.
Rap off for you,for me,for our human.
|
|
|
|
|
maybe u have the wrong version of vc?
i can't open it either with .net 2002.
Don't try it, just do it!
|
|
|
|
|
I am using the VC6.0.
Is the reason the version???
If so,which version of VC can open it???
Rap off for you,for me,for our human.
|
|
|
|
|
How to capture the status that's getting displayed in command window(local system only) from another windows application..... any ideas????
thanks in advance
adi
|
|
|
|
|
Make the output text of that console app into a disk file instead of printing to the command window, and then read the contents of the file into a memory buffer and parse that buffer for your needs...
But how to do this in your program? here's a solution:
Dynamically generate a .BAT batch file in your program, the contents of this batch file is like this:
consoleApp.exe >> c:\output.txt
Here, consoleApp.exe is the filename of that console app you want to capture its output, and then launch this batch file via CreateProcess win32 API. After the end of console app, what its outputs are placed into the output.txt file...
Hope this helps.
|
|
|
|
|
I have post this Q on some message boards and I didd not get a god answer yet.
I'm writing a game server that has the incoming data on tcp and outgoing on UDP muticast. My questiisn is.
Is UDP muticast rerouted on the WAN (internet) or not.
Thanks.
|
|
|
|
|
internet does not support multicast!
Don't try it, just do it!
|
|
|
|
|
Every application (windows) has .rc file and corresponding resource.h file is there any way we can give the resource.h a different name and the classwizard will do any further modifcations of the resource to new .h file?
Thanx in advance.
Prakash.
My God is more powerfull Than Your God.
|
|
|
|