|
-
April 16th, 1999, 01:26 PM
#1
VC++ Beginner
Could someone please explain more about owner drawn items. I have a dialog app that uses two edit boxes for the user to enter a starting/ending date. When the user presses the Create files button I am creating files from ODBC calls to an Oracle Database. I would like to add a owner drawn button with a butmap attached. My problem is that I see a lot of code on the subject, but am having a hard time implementing as I don't understand what needs to go where in my current source code! Some (for lack of a better word IDIOT) assistance would be Greatly Appreciated. I just want to add the button and hhave the bitmap drawn on it at that point I think I can get the rest! Thank you for your patience in advance! Charlie
Everything is Free Until You Have to Pay for it....
Platform is Windows 2000/XP Professional, Visual C++ 6.0
-
April 16th, 1999, 02:24 PM
#2
Re: VC++ Beginner
About the button, I don't know. I'm also kinda new to Visual C++ and I could take a guess, but that can be risky.
I have, however, done some Oracle Database programming with Visual C++. Are you familiar with Oracle OLE3.2 objects? Basically, they encapsulate and wrap the ODBC driver calls with some really nifty classes. We have had no problems with them and they work really really good.
You might really want to take a look at them and use them instead of ODBC drivers, if possible.
Good Luck
Shaun
-
April 16th, 1999, 05:28 PM
#3
Re: VC++ Beginner
Hello Shaun,
Haven't used OLE3.2 as yet. However, I will give it a look see since you have indicated that it is so nice! Thanks for the Info!
Charlie
Everything is Free Until You Have to Pay for it....
Platform is Windows 2000/XP Professional, Visual C++ 6.0
-
April 16th, 1999, 09:38 PM
#4
Re: VC++ Beginner
Hi,
Here is EXACTLY what to do to implement an owner-draw button.
1. In the dialog resource, create a button. Check the Owner Draw property. Give it a caption (yes, it does matter what the name is.) For this example, we'll make the button's caption MYBUTTON. The button ID is IDC_MYBUTTON.
2. Create 4 bitmap resources, all the same size, whose ID's are: "MYBUTTON-", where the - is U for the up state, D for the down state, X for the disabled state, and F for the focused state. Only the up (U) state is necessary. The quotation marks are a necessity.
3. In your dialog class's header file, declare a CBitmapButton object (eg. CBitmapButton m_btnMyButton).
4. In your dialog classes's OnInitDialog() function (over-ride the default if you haven't already), add the line: m_btnMyButton.AutoLoad(IDC_MYBUTTON,this);
5. Use Classwizard to handle the BN_CLICKED message.
That's about it. I hope that helps.
Daniel.
-
April 17th, 1999, 07:59 AM
#5
Re: VC++ Beginner
Daniel,
Thanks! That is exactly what I needed! Appreciated the detailed info!
Charlie
Everything is Free Until You Have to Pay for it....
Platform is Windows 2000/XP Professional, Visual C++ 6.0
-
January 6th, 2000, 03:56 PM
#6
Re: VC++ Beginner
Everything is Free Until You Have to Pay for it....
Platform is Windows 2000/XP Professional, Visual C++ 6.0
-
January 6th, 2000, 04:06 PM
#7
Re: VC++ Beginner
Could you please post your code so that we can share.
Appreciate in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|