|
A GUI which will do the following
1) Take input from the screen and conver lowercase to uppercase letters
2) Sort characters with user selection for ascending or descending
I will use the code to learn more
Thank you in advance
|
|
|
|
|
Read up on CDialog and CEdit for entering data in a GUI
Have a look at CString::MakeUpper for converting lower case to upper case.
Not sure about your sort question, is the data in a list control?
A good place to start is
< a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_dialog_box_topics.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_dialog_box_topics.asp
Michael
Communication is the first step towards enlightenment.
|
|
|
|
|
My program shuts down at the same point always and when I debug it takes me to this statement in my program:
vectorB = sqrt(xcoord1[n][layer]*xcoord1[n][layer]
+ ycoord1[n][layer]*ycoord1[n][layer]);
in the variables window I see that vector B is 1.#INF000000000
so I'm trying to look at the values for my 2 dimensional arrays with the watch window. How can I look at the entire array...I know I can look at individual elements by typing xcoord1[34][3] or something like that? But I need to see all the elements. What do I type for this?
|
|
|
|
|
Try to type xcoord1,10 instaed of xcoord1[34][3] in the watch window, then you can see the first 10 values of xcoord.
Not exactly what you wanted, but it might help...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I find the easiest way is to use the TRACE macro and loop through the values in the array. Its a little bit of an old fashioned debugging technique but I've always found trying to view arrays in the debugger as rather hard work.
Michael
Communication is the first step towards enlightenment.
|
|
|
|
|
hi,
I use the WinExec command to run files fine but a cant get the following to work & I have no ideas why. Please help me with my final year BSc own Project.
WinExec("copy "+m_Logo+" logo.*", SW_HIDE);
note: m_Logo is a CString that contains: c:\test\test.jpg or such
thanks again
An Expert is somone who has previously made ALL the Mistakes, I dream of this day. - Lucky
|
|
|
|
|
I will answer myself as knowone else has!!
WinExec unlike system only executes files (*.bat, *.exe, etc). copy is not a file it is part of the command.com file (win32) or cmd.exe file (winNT). The command i needed was:
command.com /c eg:
WinExec("command.com /c copy "+m_Logo+" logo.*", SW_HIDE);
note: m_Logo is a CString that contains: c:\test\test.jpg or such
Im gettin there!!
An Expert is somone who has previously made ALL the Mistakes, I dream of this day. - Lucky
|
|
|
|
|
Er. Pardon me for asking. But what's wrong with using CopyFile ?
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
Thanx, i will try that. that would be a lot more tidy. Do you know how to preview a jpg or gif in open dialog? I use GetOpenFileNamePreview for showing avi files but havent found a way for images. is there a way or do i need to create some kinda shell around the standard box? - im askin you cos u seem to always have correct & clear answers!!
Thanx again
An Expert is somone who has previously made ALL the Mistakes, I dream of this day. - Lucky
|
|
|
|
|
Hi,
I have an SDI project, the view of this project is derived from CFormView, this View contains a Bitmap control I wish to move this control from a coordinate (x1, y1) to (x2, y2), in a manner that his "railroad" resembles to a half of circle.
Which functions should i use ?
Can you help me with some tips ?
thank's.
|
|
|
|
|
I use CxImage to display a picture,but I can't get a transparent background color.The parameters of SetTransColor()and SetTransIndex() are always invalid.how to use these functions???
help!!!!!!!!!!
|
|
|
|
|
Hi ,all
when i use CRecordset pointer m_pSet to do:
m_pSet->AddNew();
m_pSet->*=???;
...
try
{
m_pSet->Update();
}
catch(CDBException *e1)
{
CString error=e1->m_strError;
AfxMessageBox(error);
}
the strange thing happens:
if the Records is empty , it can update the Records,but it result in Memory leak,in other cases it works.
thanks in advance!
|
|
|
|
|
I think it should be the other way round - if it fails, you should leak because you should call e1->Delete() in the catch handler.
MS does something a little odd in AfxThrowDBException - it creates the exception on the heap then throws a pointer to it.
|
|
|
|
|
Hi all,
In old windows versions exist an activex which called Kodak imaging ...
That contains some controls on image - scanner and ...
Could you tell me where i can download it from ?
yes, i want to download the Kodak activex ...
other question, can you tell me good activex about working with scanners ???
Thanks.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I am working on an NT service. One of my classes is used mostly for read-only lookups into a stl map. Probably 70% of the calls made to this class are read-only requests and change no data members. The other 30% add or remove members from the intenal map object.
This class is called by as many as 200 threads and is used quite a bit. Currently I have it coded so that it locks the entire class during each function call regardless of whether or not that function does an update.
Anyway, I have spent a couple of hours searching the web for an open-source implementation of a read many, write once locking mechinism. I have developed a class to facilitate this and its almost done, but I thought before I bothered to finish it I would check here.
the question:
Does anyone know where I can get a pre-packaged Read/write locking class?
Thanks,
Matt Gullett
PS. If I have to finish my class I will post it to Code Project.
|
|
|
|
|
Matt Gullett wrote:
Does anyone know where I can get a pre-packaged Read/write locking class?
I just saw one whilst flipping through Richter's Advanced Windows. I'm not near the CD now, but search MSDN, the code might be up there. He called it SWMRG (single writer multiple reader guard).
--Mike--
Buy me stuff!
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
Thanks for the reply.
So far, no luck with MSDN but I am trying google now.
|
|
|
|
|
I'm afraid you won't find anything useful on google (at least I didn't).
The only good (non writer-starving) solution for Windows is the one given in the 4th edition of the Richter's book. Of course, with pthreads and condition variables it is much easier to implement RW locks; maybe you can look for a pthreads library for Windows.
I vote pro drink
|
|
|
|
|
We use the very cool open source library ACE (see http://deuce.doc.wustl.edu/) for this kind of thing. If all you need is a read/write lock, it is overkill, but you might get some ideas from the source. I am sure that you can find one on the net somewhere, take a look at the links section on the C/C++ users journal web site (www.cuj.com) or cetus-links (http://www.cetus-links.com/).
Since you have such a large percentage of writers, a better approach would be to use multiple maps and distribute the data evenly across the maps. For example, if your key is a string you can hash it and mod by the number of maps to figure out which one the data belongs to. Each map would have its own critical section structure which you would lock before you read or write to that map.
If your data set is predictable, you can build a function that results in even distribution of the data across the maps. If your data set is not predictable, use a large number of maps and a good hash function to minimize contention.
Chris Hafey
|
|
|
|
|
There was an article about this in the May 2002 issue of C/C++ User's Journal. www.cuj.com.
|
|
|
|
|
ok... "doesnt matter by opinion of what is over my head" i am wondering if there is any really good books that go over the following info:
~How to represent data
~data abstraction
~programming concepts
~Algerithms
~Searching, sorting - abstract data types
Titles of the books are great, links are cool, opinions are best "with titles "
Thanks for the help "and opinions"
~SilverShalkin
|
|
|
|
|
There are a lot of good books out there... i hope to read them someday
A couple that i feel helped me quite a bit:
The C Programming Language Brian
W. Kernighan and Dennis M. Ritchie
Starting Forth Leo Brodie
No the last one has nothing to do with C or C++. It is still a very good book.
--------
And we die young.
Faster we run. Alice in Chains, We Die Young
|
|
|
|
|
SilverShalkin wrote:
How to represent data
Surely the current trendy answer to that is XML
SilverShalkin wrote:
programming concepts
What do you mean ?
SilverShalkin wrote:
Algerithms
For both algorithms and data representation, you probably should start with a book on the STL, rather than reinvent the whell. I have an O'Reilly book called Mastering Algorithms in C that I am glad I read, but I won't do any of it, because the STL does it for me. The C++ Programming Language by Bjarne Stroustrup has a good intro to STL, otherwise, STL Tutorial and Reference from Addison Wesley is a good place to start.
SilverShalkin wrote:
Searching, sorting - abstract data types
Again, you should be using the STL, but Mastering algorithms in C is a good book to help you understand what it is doing for you.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
introduction to algorithms by thomas cormen et al is a seminal work imho
code complete by steve mcconnell is a must have as well
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
Thanks,... ill go and check them out...
Mastering Algorithms in c
Introduction to Algorithms
Code Complete
And read up on STL.
Thanks!
~SilverShalkin
|
|
|
|