Solved

Borland Button in Resource Workshop.

Posted on 2000-02-24
5
808 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
[X]
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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

724 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