Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Borland Button in Resource Workshop.

Posted on 2000-02-24
5
795 Views
Last Modified: 2010-05-18
Will somebody explain to me why when I create the 'borland button' with using Resource Workshop, After compiled. The Dialog Box which contains this kind of Borland Button cannot appear when I run the project's .exe application. It is only can appear when after I start my Borland 4.5.
0
Comment
Question by:b_k_cheah
  • 3
  • 2
5 Comments
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2557711
Do you want use Bitmap Button? See Borland Doc about using BWCC controls: you must make 3 state bitmaps(usual, pressed, choused ) and write code for
displaying Bitmap. See in you
bc45\doc bwcc.txt(if i remember right).
I can send you it(and example of using ,
if you add PTS),but only in sandy:it is in office.

 
0
 

Author Comment

by:b_k_cheah
ID: 2560552
send it to me please.. I will really appreciate it. I am writing my source code in Win API form. I wonder whether I need to change to Borland Object-Oriented Programming format or not. Please advise.
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2560699
Ok, but write you EMail!
0
 

Author Comment

by:b_k_cheah
ID: 2562157
My email is b_k_cheah@telebot.com
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 100 total points
ID: 2565386
Hi, i send you bwcc.zip with doc about BWCC, but in you
BC5\help must be BWCC.hlp with same thing.
Next is snippet of working code:
in you RC file:
IDD_DIALOGORDER DIALOG 20, 0, 195, 112
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CLASS "bordlg"
CAPTION "test"
FONT 11, "Courier New (Hebrew)"
{
 ...
 CONTROL "", IDC_BITMAP1, "BorBtn", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_BORDER, 95, 90, 40,20
 CONTROL "", IDC_BITMAP2, "BorBtn", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_BORDER, 95, 90, 40,20
 ...
}
In you InitMainWindow()
....
#include <bwcc.h>
....
void app::InitMainWindow()
{
  ...
   // Borland Windows custom controls.
  //
  EnableBWCC();
  HINSTANCE hInst = GetMainWindow()->GetModule()->GetInstance();
  BWCCRegister(hInst);
  ...
}
In you Dialog Class:
....
#include <bwcc.h>
....
DEFINE_RESPONSE_TABLE1(DisplayArea, TDialog)
  ...
   EV_COMMAND(IDC_BITMAP1, EvOk),            //Press enter
   ....
END_RESPONSE_TABLE;

void DisplayArea::SetupWindow()
{
  TDialog::SetupWindow();
  ....
  HBITMAP hBits[3];

  HWND  hWndButton = ::GetDlgItem( this->HWindow, IDC_BITMAP1);

  HINSTANCE hInst = GetApplication()->GetMainWindow()->GetModule()->GetInstance();
  hBits[0] = ::LoadBitmap(hInst, MAKEINTRESOURCE( IDB_VBOK0)); //not pressed
  hBits[1] = ::LoadBitmap(hInst, MAKEINTRESOURCE( IDB_VBOK1)); //pressed
  hBits[2] = ::LoadBitmap(hInst, MAKEINTRESOURCE( IDB_VBOK2)); //choused

  ::SendMessage( hWndButton, BBM_SETBITS, 0, (LONG) (LPSTR) hBits);
 ...
 //of course, Bitmaps VBOK0, .. must be in you RC file
}
And don't forget make you Apps with BWCC enable(in TargetExpert)
I hope, it helps. Alex
I wll be happy, if you increase some PTS:
only retype this text ~ 1/2 hour!

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

828 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