[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Borland Button in Resource Workshop.

Posted on 2000-02-24
5
Medium Priority
?
825 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 200 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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
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 video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

834 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