|
Hi all;
I badly need a DialoogBar in my application. I have include the Dialog Bar included in "registered visual c++ components" to my project and it works just fine. The only problem is that i need to implement tab control on the DialogBar. In order to create, initialise and attach items to the tab control, i need to add a snippet. When i add the snippet in OnInitDialog for a modal dialog, it works fine. The problem is that the DialogBar is of style -> child (Not modal) and i really don't know which event to call to create the tabs on the DialogBar. Can somebody please help me on this thing. I really really need this very quick.
Thank you beforehand guys;
Krugger
|
|
|
|
|
In order to display a tab control, you must first construct a tab control object (CTabCtrl), then create the associated Windows tab control.
The easiest way to construct the object is to include it as a member variable into the CDialogBar-derived class you have made. As DialogBar's are pure child dialogs, you can use DialogDataExchange as well to bind a member variable to a control on the dialog layout resource.
Being dialogs (and dialogs being Windows windows), these toolbars implement the standard Windows window creation chain. For example, you could try writing a handler for WM_CREATE, then create and initialize the tab control in there. I'm pretty sure it should work ok.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
i have to splitter window in right spliter window their is CListview in taht view i need to create toolbar
Can anybody help me for that
thanx
|
|
|
|
|
My app can load lots of formats pictures, using IPicture. If I load two or three pictures, how can I print only specified rect in the clientrect. thanks!
I am a student from china.THX
|
|
|
|
|
i tried this code but it didn't work :
CWnd *pMain=AfxGetMainWnd();
CMenu * pMenu=pMain->GetMenu();
CMenu * pSubMenu=pMenu->GetSubMenu(3);
pSubMenu->EnableMenuItem( 1,MF_DISABLED|
MF_GRAYED | MF_BYPOSITION );
in spite of this the following code is working properlly:
CWnd *pMain=AfxGetMainWnd();
CMenu * pMenu=pMain->GetMenu();
pMenu->EnableMenuItem(3,MF_DISABLED|
MF_GRAYED | MF_BYPOSITION );
please any help, why this happen
Best Regards
|
|
|
|
|
Which menu item are trying to disable ???
P.R.A.K.A.S.H
|
|
|
|
|
hi
i try to disable an item like new in File->New
|
|
|
|
|
|
is it posible to catch some console input before drawing it on screen using some API functions?
thank u for help!
|
|
|
|
|
Certainly. Check here and here for details.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
How to get the size of CScrollView's scrollbar?
|
|
|
|
|
The scrollbars when visible has a computable size.
For the vertical:
Get the height of the client area
GetSystemMetrics(SM_CXVSCROLL); - width
For the horizontal
Get the width of the client area
GetSystemMetrics(SM_CYHSCROLL); - height
If both scroll bars are visible you have to adjust the width of horizontal and height of vertical by the height/width of the other.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
Hi,
I had 24 edit box which I want to group it together and set it as array. Can this be done?
Siew Hoon
|
|
|
|
|
for (int i=0;i<24;i++)
{
hwndRadioButtons[i] = CreateWindow(
"BUTTON", // predefined class
"", // button text
WS_VISIBLE | WS_CHILD | BS_BITMAP|BS_OWNERDRAW , // styles
//WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON|BS_BITMAP , // styles for radio button
// Size and position values are given explicitly, because
// the CW_USEDEFAULT constant gives zero values for buttons.
128+35*i, // starting x position
20, // starting y position
26+2, // button width
24+2, // button height
hDlg, // parent window
(HMENU)(IDC_RADIO_DIALOG1+i), // No menu
(HINSTANCE) GetWindowLong(hDlg, GWL_HINSTANCE),
NULL);
}
|
|
|
|
|
Hi,
There are 3 errors after I had in this code.
1) hwndRadioButtons - undeclared identifier
2) subscript requires array or pointer type
3) unexpected end of file in macro expansion
How to solve this?
|
|
|
|
|
hi, can someone tell me where to find the value of ATTACH_PARENT_PROCESS witch used in BOOL AttachConsole(DWORD dwProcessId);??
thanks!!!!
|
|
|
|
|
I found this in WINCON.h, which is included automatically when you #include WINDOWS.h:
#if(_WIN32_WINNT >= 0x0500)
WINBASEAPI
BOOL
WINAPI
AttachConsole(
IN DWORD dwProcessId
);
#define ATTACH_PARENT_PROCESS ((DWORD)-1)
#endif /* _WIN32_WINNT >= 0x0500 */ According to the MSDN, this is only available in Windows XP and later. Note that you must have _WIN32_WINNT defined to a value greater than 0x0500 for the declaration to be present.
Software Zen: delete this;
|
|
|
|
|
I am wondering whether we can use ConvertSidToStringSid in Visual Studio 6.0 just by copy the needed Sddl.h and Advapi32.lib from Visual Studio .NET?
After "#define _WIN32_WINNT 0x0500" and "#include "Sddl.h""
in my source file and change the project's settings to link with "Advapi32.lib". The project compiled and linked without error.
But after execute, I get an error "Unhandled exception in SID.exe(ADVAPI32.DLL):0xC0000005: Access Violation."
What can I do?
|
|
|
|
|
If the function wasn't available, you would have seen a link error, or at best a runtime error about not finding the requested import in the DLL.
The access violation implies that the SID you are supplying is poorly formed in some fashion.
Software Zen: delete this;
|
|
|
|
|
|
The following program is an attempt at the knights tour using backtracking/recursion. This was for an assignment in my class, which is now past due. The code below is what I turned in. This thing has been driving me nuts.
The problem is when it needs to backtrack, it seems to enter an infinite loop. I have commented out the problem area. When commented out, the knight will make moves, avoiding previously visited squares until it needs to back track... at that point, I need to replace the last square visited with 0 (make it blank) and decremet the total number of moves made, "k". Compiles w/ no errors or warnings.
//Begin Code
#include<iostream>
#include<iomanip>
#include<string>
#include "d_matrix.h"
using namespace std;
bool knight(matrix<int>& board, int k, int x, int y)
{
bool result;
int u, v, m=0;
int i = 0;
const int n = board.rows(); //n = rows
//all possible knight moves
static int dx[] = {2,1,-1,-2,-2,-1,1,2},
dy[] = {-1,-2,-2,-1,1,2,2,1};
board[x][y] = k; //k is initial position in x,y
if(k == n*n)
result = true;
else
{
result = false;
for(m=0; m <= 7; m++)
{
//while the tour has not been completed, and a valid move is available, continue
while((x + dx[m] <= 7) && (x + dx[m] >= 0)
&& (y + dy[m] <= 7) && (y + dy[m] >= 0) &&
(board[x + dx[m]][y + dy[m]] == 0))
{
//assign new position coordinates
u = x + dx[m];
v = y + dy[m];
k++; //move to next count
board[u][v] = k; //assign square iteration number
knight(board, k, u, v);
}
//board[u][v]=0; I THINK THE PROBLEM IS HERE!
//k--;
//result = false;
}
}
return result;
};
int main()
{
int n, x, y;
string str;
cout << "Enter the dimensions of the board with a single value: " << endl;
cin >> n;
cout << endl;
matrix<int> board(n,n,0);
while(str != "yes")
{
cout << "Enter the starting position for the knight in x y form: ";
cin >> x >> y;
cout << endl;
knight(board, 1, x, y);
//Draw Board *works*
int i,j, temp;
cout <<" 0 1 2 3 4 5 6 7" << endl;
for (i = 0; i < 8; i++)
{
cout << i << " ";
// draw the squares in current row
for (j = 0; j < 8; j++)
{
if (board[i][j])
{
temp = board[i][j];
if(temp < 10)
{
cout << " 0" << temp;
}
else
cout << " " << temp;
}
else if(board[i][j] == 0)
cout << " --";
else
cout << " xx";
}
cout << endl;
}
cout << "Quit? yes or no." << endl;
cin >> str;
cout << endl;
}
return 0;
}
//End Code
|
|
|
|
|
Hi there,
I addes tooltip to my CListCtrl derived class. This tooltip displays the item text for those that their column width is shorter than the item text length.
I have created an MDI application having each view displaying my CListCtrl derived class.
However, the tooltip works only for the last opened document.
Any idea how to make to work for the precede opened documents?
Thanks,
Dudi
|
|
|
|
|
I used Wave_Class_for_playing_and_recording for play and record wave files.
My program need to play and record wave files with a dialog box that creat with a key on file menu. I creat a dialog box like Wave_Class_for_playing_and_recording and creat a class for and add other wave classes but i have problem to build this program. Wave_Class_for_playing_and_recording only work when it is dialog based program not for case it uses as a dialog box in another MFC program.
How can i do this as dialog box?
How can i Record and Play wave files by dialog box?
Mehdi Hosseinpour
|
|
|
|
|
Hi..
i build an FTP application with VC++ 0.6 to upload files to ftp server in my company i test the project from my home computer it works correctly and it lists all directory in the server and perform the upload correctly ..
but in the company it can not list the ftp directory (No error message or warning) ...
i think it's because of the firewalls installed in my company network ..
How can i over come this problem?????
Note: i asked this Q before and i the answer was to change the setting for Firewalls but why we did not do that with regular FTP software which will be in the same case with my application!!!!
|
|
|
|
|
Dear All,
I am trying to make a GUI inferface for a plant system monitoring (Final year project). So, I tried to put (Blt) a pic in a screen and detect the mouse event (X,Y coordinate and Left click button).
My method is to make define a X,Y coordinates of the pic in the file header. afterward, checking the mouse event in windows callback function. My problem is that the vaules of clciking mouse coordinates and pic coordinates are not inconsistance. Is it possible ?
My script is
//***** Define the value of the pic
//-----------button1-----------------------
int button1StartX=250;
int button1EndX=250 + g_menuwidth;
int button1StartY=150;
int button1EndY=150 + g_menuHeight;
ScSurObj g_button1;
//********** Displayframe Function *********
g_pDisplay->Blt( button1StartX, button1StartY, g_button1, NULL);
// ******** Win Main Call back function*********
// To Operate Mouse Detection
case WM_LBUTTONDOWN: /* process left button */
MouseMovementDetection(hWnd,msg,wParam,lParam);
break;
// ******** MouseMovementDetection function*********
if ( XMouse > button1StartX && XMouse < button1EndX )
if ( YMouse > button1StartY && YMouse < button1EndY )
g_FrameDisplay = 2;
Regards,
Anson Tong
|
|
|
|
|