473,406 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to attach a tab control to a window (Visual C++)

Hello,

I have a short Visual C++ program which creates a window. My program is
as follows :

#include "stdafx.h"
#include <afxwin>

class COurApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};

class COurWnd : public CFrameWnd
{
public:
COurWnd()
{
Create(0, TEXT("My App"));
}
};

class myTab : public CTabCtrl
{
public:
myTab()
{
Create (TCS_TABS | TCS_FIXEDWIDTH | WS_CHILD | WS_VISIBLE,
CRect(20, 30, 180, 230), this, 0x1006);
}
};

BOOL COurApp::InitInstance(void)
{
m_pMainWnd = new COurWnd;

m_pMainWnd->ShowWindow(m_nCmdShow);

// At this point, I would like to create a tab and attach to the window.
// I tried :
//
// m_wndMyTabCtrl = new myTab;
//
// but got an "undeclared indentifier" compiler error message.

return TRUE;
}

COurApp AnApplication;
}

I wonder if someone could please show me how to create an object of type 'myTab' and attach it to the window? Your help is much appreciated!

Akino
Jul 8 '08 #1
1 2317
Banfa
9,065 Expert Mod 8TB
YYou are going to need to put it inside a CView, if you are using MFC then I seriously suggest you use the APP Wizard to create you initial framework rather than write it yourself like this otherwise you are likely to run into lots of problems with bits that MFC will assume are there that you wont have implemented.
Jul 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: WayneD | last post by:
Hi All, I'm writing a class that implements a COM interface. Unfortunately, one of the methods passes in an HWND and I'm supposed to create a control with that HWND as the parent. The idea is to...
4
by: Andy | last post by:
In visual studio, I have an asp.net project. When I debug, I have to manually attach to aspnet_wp.exe. My project used to automatically attach to this process. How do I get it to automatically...
5
by: erez | last post by:
Hello How can i attach an html file to TableRow in HtmlTable control that run at server, the code should be in server side. thanks
1
by: Jorge Ponte | last post by:
hi I have a Web User Control (ascx) - lets call it "My_WUC" - in a Web form. In that WUC I want have a textbox and a button. I want to click on the button and open a popup (I use javascript for...
26
by: johkar | last post by:
I need to cancel the link and execute a function onclick of all the links within the span tag which has a class of "container" assigned. There will be only one span tag with this class applied. ...
0
by: fds | last post by:
Hello! I have a very specific question and that is about how to inherit a control for example the control System.Windows.Forms.TextBox without causing the environment to delete the control when...
0
by: Tony Johansson | last post by:
Hello! I have a very specific question and that is about how to inherit a visual control for example the control System.Windows.Forms.TextBox without causing the environment to delete the...
4
by: Dave Calkins | last post by:
I have a native Win32 C++ app built with Visual Studio 2005. I'd like to make use of a property grid control in this app. For an example of this, in Visual Studio, see the properties control...
6
by: GaryDean | last post by:
I see some references on debugging by attaching to a process. There are MSDN articles that show how to attach to a process for debugging. However, I can find no info on how exactly to get the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.