Solved

ActiveX Problem

Posted on 2004-08-08
4
155 Views
Last Modified: 2013-11-20
I used ActiveX Microsoft Form button to create a button with picture.. will there be any problem with this method? or i should instead code the button with the coding below :

CString szFilename ("C:\Talla\yourimg.bmp");
HBITMAP hBmp = (HBITMAP)::LoadImage(
                NULL,
                szFilename,
                IMAGE_BITMAP,
                0,
                0,
                LR_LOADFROMFILE|LR_CREATEDIBSECTION
                );

Because i using ActiveX and found that it is easy to use.. but i'm afraid there might be some problem cos sometimes things easy does not mean good... Thanks
0
Comment
Question by:mwcmp
  • 3
4 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 11752717
The only problem I can see is that you should use double backslashes in your path names, e.g.

CString szFilename ("C:\\Talla\\yourimg.bmp");
HBITMAP hBmp = (HBITMAP)::LoadImage(
               NULL,
               szFilename,
               IMAGE_BITMAP,
               0,
               0,
               LR_LOADFROMFILE|LR_CREATEDIBSECTION
               );
0
 
LVL 86

Expert Comment

by:jkr
ID: 11752730
BTW, see also http://www.codeguru.com/Cpp/G-M/bitmap/article.php/c1681/ ("Creating a bitmap object from a BMP file") and http://www.codeguru.com/Cpp/G-M/bitmap/article.php/c1693/ ("Creating a DIB section from a BMP file")
0
 

Author Comment

by:mwcmp
ID: 11755822
but which method is better? using ActiveX or the coding method?
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 11755897
Well, 'LoadImage()' is an SDK/API method and has nothing to do with ActiveX. And, it's hard to tell which is better. Both are OK.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 108
Need to retreive data from .TFS file exported by DVR 8 222
Folder Comparison 12 55
FizzBuzz challenge 9 82
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question