Forgot your password?
Sign in using
Chapters and Sections
Article Help Forum
Submit an article or tip
Post your Blog
Ask a Question
View Unanswered Questions
View All Questions...
All Message Boards...
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work & Training Issues
Design and Architecture
C / C++ / MFC
ATL / WTL / STL
Ruby On Rails
Hardware & Devices
Hosting and Servers
Silverlight / WPF
Site Bugs / Suggestions
The Insider Newsletter
The Daily Build Newsletter
The Insider News
The Weird & The Wonderful
Most Valuable Professionals
General Indian Topics
General Chinese Topics
What is 'CodeProject'?
Ask a Question
Bugs and Suggestions
Article Help Forum
Advertise with us
Comments by JJMatthews (Top 19 by date)
In my 15 years writing C++ code professionally I thankfully have never had the pleasure of working with this level of nitpicking. I hold myself to much higher coding standards than has ever been required by any of my employers. Please don't discourage this young man into thinking this will be the way it is for him in his career because it is not.
let me make this simple for you:
warning != error;
warning != "problem";
warning == warning;
... just giving the learning individual 2 other possible solutions (which I use every day). I'm not saying it's the best solution but why not be aware of the available options. There is absolutely nothing wrong with type casting, throwing words around like "ignorance" is ridiculous. If a person had a requirement to hold 2 billion items in an array (which hardly ever happens) than they would code accordingly.
oh .. thats easy. Since VS2010 (maybe 2008, cant remember) png is handled by Visual Studio, the same way as a bitmap or icon ..etc. First switch to your "Resource View". Right-Click on the name of your project and select "Add -> Resource..." and a dialog will pop up. Click the "Import.." button and then just select you file.
Now the question of how you will load and compare the images ... I recommend GDI+, I use it allot and it is very nice.
Good luck man
sounds interesting ... one last question: do you need to put the images into the resource table in at design time or run time?
what type of image are you trying to use (png, jpg, bmp)? why do you want this image in your project, what do you want to do with it after you add it to your resources ... display it on a dialog? what version of visual studio do you have?
I talk to Oracle with ADO, heres an example of my connection string, hope it helps:
m_cstrDBCon = _T("Provider=OraOLEDB.Oracle;");
m_cstrDBCon += _T("dbq=127.0.0.1:1521/XE;Database=DBNAME;");
m_cstrDBCon += _T("User Id=Admin;Password=****;");
I wouldnt call it "baby sitting", objects are released/destroyed in class destructors. As a minimalist, if my handle and GDI object count does not increase in the task manager then that is good enough for me.
The purpose of the post was to demonstrate a method for drawing the inner portion (text) of an edit control. If someone wishes to use this method I would recommend that they format the code to fit the rest of their code (programming style).
I can post a function I wrote a while ago that enumerates all usb hubs on a system if you would like? You will just have to change it a little to look for your card readers.
I know man, I searched for at least a day for an answer myself. Eventually just had to do it the hard way.
There it goes, if you need any help using it let me know.
I can post my list control class if you would like. hahaha I was hoping there was a way to do this that I didn't find but nobody has posted .. (I did spend at least a day on it)
Ive always thought that the MFC GDI classes did that for you. I always watch my programs with the task manager to see if the Memory, Handles, and GDI objects increase. The classes seem to clean up all the handles. I will look into it more.
Hello, I just had the exact same issue a couple months ago and your not going to like my solution. I tried everything and nothing worked, eventually I manually drew the whole thing. It wasnt really as much work as it sounded and it ended up being worth it in the end.
Read up on CPtrArray and CPtrList in MSDN. I avoid CArray (and all templates) if I can. Also, make the array a member variable, you will not need CStaticEx member variables (m_pStatiEx1). Don't forget to clean up your memory in an OnDestroy() handler.
Ahhh, OK. Then all you have to do is switch out your array class. Check out CPtrArray, CPtrList, CObjArray, or CObjList.
where is Create() being called?
Then I believe this should help. Like I said, I dont have the source code to the CStaticEx class but you shouldnt have to change much to get it running. Oh yeah, you will need a solution for your control IDs. One way to do it would be to declare a variable in your class header:
static UINT m_nNextID;
then in your cpp file at the top somewhere:
UINT CDialogOrWndClass::m_nNextID = 2050;
make sure this number is greater than the last control value in your resource.h file.
Then call Create() like this:
pStaticCtrl->Create(_T(""), WS_CHILD|WS_VISIBLE, rect, this, m_nNextID++);
It was a thread class I wrote for monitoring. I was trying to give you an example of how to use the ReadDirectoryChangesW API (if thats the way you want to do it).
Thats good, it sounds like your getting it. That what it takes for things like this, trying different things until everything is working. I seem to learn the most from projects like yours. If you have any other questions in the future I will try my best to help. Good luck.
Web02 | 2.8.140821.2 | Last Updated 1 Jan 1900
All Rights Reserved.
Terms of Service