Solved

Borland Button in Resource Workshop.

Posted on 2000-02-24
5
780 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now