|
In any books you might find on www.amazon.com that have the words 'design pattern' in them. I don't know of any websites really. safari.oreilly.com has some, and a 14 day free trial.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Microsoft Press has a book on Design Pattern of Visual Basic programming call Microsoft Visual Basic Design Patterns. I remember they also have one for software developement, but I can't remember the name of it.
If you want a very high level overview of the software life cycle, many university uses R S Pressman, Software Engineering: A Practioner's Approach, 5th edition, McGraw-Hill, 2000 It's a pretty good book, but it won't tell you in technical details what is good code pratice and what is not. If you find a good book with good code examples in a large enough project, let me know!
http://LessExpense.tripod.com
|
|
|
|
|
Ward Cunningham's WIKI site at : http://www.wiki.org[^]
has design pattern info. Or you could invest in the book written by the 'Gang of Four', Eric Gamma et al, mentioned somewhere within the Wiki - do a wiki search and you should find more details
Cheers, Garth
|
|
|
|
|
Hello,
I'm writing a program that displays a list of tasks on a CListView report. The report view will have varying text color/font & item background colors depending on the context of each specific task (list item).
Where should I put the functions to determine these GUI parameters? In the document class or the CListView derived class? Should the document have functions that return the color of each specific list item? Or should the ListView make the determination based on gathering information about the Document tasks/items?
I suppose I could throw out the idea of modularity and just treat the GUI and the document as mutually dependent, but I believe that this would be poor design.
Does anyone have any pertinent wisdom about how to lay this out?
thanks!
JennyP
|
|
|
|
|
I would place the functions in the listview class since they alter listview behavior. If you place them in the document, you'll have to redesign (or replicate code) if you find you need additional document types in the future. Even if you don't need additional documents, you're more likely to find listview code samples on CodeProject, and that may save you some coding time.
|
|
|
|
|
Are there circumstances when calling Enable3DControls is necessary? I run Win2000 and it makes no difference whether this function is called during InitInstance. The MS doc says 3D controls are automatic on newer versions of Windows. Does that include Win95 and Up? The reason I ask is because adding this line of code adds 10-20 KB to your app (everything counts...lol)
Henry P.
|
|
|
|
|
That call is only required if you plan on running on NT 3.51
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
WinNT 3.51 still exists?? lol...I think I'll get rid of that line. Thanks.
Henry P.
|
|
|
|
|
I am building an SDI app with the CFormView Base Class. With in this program I have an array (CObArray m_aParts). I have added a dialog to the project with a CListBox control for display a list of items that are found in the array. I have included the dialog header file in the Doc class and vice versa. For some reason I cannot get my dialog class to retrieve information from the Doc (so it can populate the list box).
I am new to programming and have experimente by trying...
// Get pointer to currnet doc.
CProject4Doc* pDoc = GetDocument();
if (pDoc)
This only returns an error. I've tried assembling a CObArray object in the dialog and found out that it's impossible.
Than k you for any guidance.
Garry
|
|
|
|
|
GetDocument only works from the View class. You need to do this:
CProject4Doc * pDoc = (CProject4Doc *) (CMainFrame*)AfxGetMainWnd())->GetActiveDocument();
Something like that. GetMainWnd needs to be cast to your mainframe class, then it has a method which returns the document, which also needs casting.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Thanks a lot Christian. I haven't been able to get it to work yet, but feel as though I am on the right track. I appreciate your assistance.
Garry
|
|
|
|
|
error C2039: 'GetActiveDocument' : is not a member of 'CHpcComDoc'
why?? Can you help me??
|
|
|
|
|
Where do you code CProject4Doc* pDoc = GetDocument()?
You cannot get access to the document class inside of a dialog box class. There are several solution to getting access to data in a document class from a dialog box. A good solution depends on several factors include when you declare the dialog box. For example, if you delared the dialog box in a view class, then you could send a message to main frame and route the message to the view class. You could then pass data to the dialog box via public function.
Kuphryn
|
|
|
|
|
Try reading this article, it might help you get by.
http://cui.unige.ch/OSG/people/Past/fuentes/Mfc/HowTo_8.html
http://LessExpense.tripod.com
|
|
|
|
|
Hey! Thanks, this looks exactly like what I need!
Garry
|
|
|
|
|
Hi everybody
I am developing a windows project that will have as front-end devices instead of pcs , windows terminals. As a result the amount of resources will be limited. The server where the executebles will be located is a Citrix-XP server. Imagine that I plan to have a menu from where other executables will be called. As a result many time it will be necessary to pass data from the menu to the other executable and the opposite. So I am loooking for the most efficient way to achieve this data transfer. So far I have tried Name Pipes and it seems ok. Is TCP/IP another choice or in that case the need of resources will be bigger?
I will appreciate any suggestion from you guys.
Regards
Spiros Prantalos
|
|
|
|
|
|
In all honesty, I think that named pipes are implemented with TCP/IP underneath if you are remoting to a separate machine and memory mapped files if it is a local machine.
So I would say what ever you are more comfortable with.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I believe all data transfer over processes in Windows make use of file-mapping.
Another solution is the message queue. You could send a message to the corresponding process with a special data structure Microsoft designed specifically for data transfer across processes.
Kuphryn
|
|
|
|
|
Hi.
I am working on a print feature for a simple text program. The print algorithm should print data seen on a CEditView. The data is saved in a CString object.
I implemented the exact same printing algorithm Jeff Prosise shows in his book. However, I encounted two problems.
First, the program crashes under debug mode. The error is this line in viewedit.h.
ASSERT (nPageSize > 1);
Secondly, although the print algorithm does not crash under release mode, the program does not print. The program does send data to the print because the queue system that runs the print list the size of the data sent and the size is valid. However, the printer printed blanks.
Again, I implemented the exact same algorithm Prosise shows. Does anyone know if there are bugs in that printing algorithm?
Last, please post if you have any idea what the bugs mentioned above.
Thanks,
Kuphryn
|
|
|
|
|
I'd say the reason it is ASSERTing is that your pagesize is 0 or negative. The ASSERT statement checks that you supply a valid pagesize (> 1), and you apparently are not. Put a breakpoint on the line above ASSERT and check your actual nPageSize value.
|
|
|
|
|
You could take a look at my example application in the printing section which does just this:
http://www.codeproject.com/printing/PrintLongText.asp[^]
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Okay. Thanks.
I looked over your source code. I believe there is a bug in Jeff Prosise code. Maybe the bug has something to do with the dimension of the page. I am not sure yet. I will modify his code via your code and try different combinations.
Kuphryn
|
|
|
|
|
Hi all,
I am using a Crecordset class to retrieve rows from an access database table. I am constructing the WHERE statement at runtime and pass it to CRecordset using m_strFilter. The problem is the following:
I need to query a date field in the database (rem_date) based on a date provided by the user (m_date). I am using the following code (v_filter is the where statement):
v_filter+="(rem_date=";
v_filter+="{d'";
v_filter+=m_date.Format("%Y-%m-%d");
v_filter+="'}";
v_filter+=" )";
The problem is that the above statement returns TRUE only when both the date and the (hidden) time is the same. I only need to compare the date portion. Do you know how can I do this?
I thank yuo in advance,
Christos P.
|
|
|
|
|
Do not exactly remember the function that will get you parts of the date in Access but you need to do something like:
Where DatePart( date_field, "mm-dd-yy") = DatePart( userDate, "mm-dd-yy" )
Try writing the query in Access it self first. Once you have it working you can can move it to your code by replacing the UserDate with the appropriate variable in your code.
|
|
|
|