Click here to Skip to main content

Comments by JJMatthews (Top 19 by date)

JJMatthews at 30-Jul-14 15:12pm View
   
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;
JJMatthews at 29-Jul-14 11:31am View
   
... 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.
JJMatthews at 11-Jul-14 9:25am View
   
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
JJMatthews at 11-Jul-14 7:40am View
   
sounds interesting ... one last question: do you need to put the images into the resource table in at design time or run time?
JJMatthews at 11-Jul-14 3:47am View
   
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?
JJMatthews at 23-May-14 3:45am View
   
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=****;");
JJMatthews at 20-Nov-13 6:17am View
   
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).
JJMatthews at 19-Nov-13 3:02am View
   
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.
JJMatthews at 14-Nov-13 9:16am View
   
I know man, I searched for at least a day for an answer myself. Eventually just had to do it the hard way.
JJMatthews at 14-Nov-13 9:10am View
   
There it goes, if you need any help using it let me know.
JJMatthews at 14-Nov-13 5:45am View
   
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)
 
JJMatthews at 14-Nov-13 2:25am View
   
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.
JJMatthews at 13-Nov-13 7:24am View
   
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.
JJMatthews at 28-Oct-13 6:37am View
   
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.
JJMatthews at 28-Oct-13 6:13am View
   
Ahhh, OK. Then all you have to do is switch out your array class. Check out CPtrArray, CPtrList, CObjArray, or CObjList.
JJMatthews at 28-Oct-13 6:05am View
   
where is Create() being called?
JJMatthews at 28-Oct-13 6:04am View
   
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++);
 
good luck
JJMatthews at 12-Sep-12 8:26am View
   
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).
JJMatthews at 4-Sep-12 10:12am View
   
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.

Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid