|
hi man,
in fact, we uns pointers for many reasons. First, in C++, the existence of the pointers comes from the compatibility with the C, in which references don't exist.
We also use pointers instead of value copies in function calls because it become heavy and "memory hungry" if we transfer some big data structures... for that reason, we also have the const keyword to avoid writing on pointed datas.
The last reason i see wee use pointers for, it is because sometimes, we don't use variable names to refer to datas (tables, vectors, queues...). We so don't have other way to manipulate these addresses that with pointers...
TOXCCT alias Nicolas C.
|
|
|
|
|
Hi, I have two projects, one client and one server project. I would like to have both projects in one workspace, and when the user starts the application, he can choose to load either the client project or the server project. How do I do this?
THANKS!!
|
|
|
|
|
This is a complete answer but it will solve part of it.
What you do is on the workspace window, click on tabview, right click at the top of the treeview and say insert workspace, select the workspace either ther server or the cient depending on which workspace you are inserting to.
Now on the classview you will see 2 workspace, right click on the workspace and select 'Set active project'.
Now run the application , which ever is the active project will be executed.
Hope this solves ur problems.
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
Thanks. But any idea how to select which project to run during runtime? Is it possible to do it at all?
|
|
|
|
|
My dear, runtime of which application???
Like i said if you set the active project that perticular binary will execute.
|
|
|
|
|
how can i position a image(shrink or enlarge).Please help me with a source code.
thank you.
R.narasimma prasad
|
|
|
|
|
Can anyone please help? I know that I can modify the style and icons associated with the tabs in a CPropertySheet, but how can I handle tab control notifications. One (among many) of things I want to do is determine when the user has clicked on an active tab and toggle the icon for that tab.
Thanks in advance.
slysi
|
|
|
|
|
One way i can thinkof is create a class derived from tab control, then
in oninitdialog of the propertysheet get the pointer of the tabcontrol and subclass it, this way you will recevie all the notifications of the tabcontrol to your tabcontrol class.
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
Thanks Mr.Prakash.
Just to clarify.
1. Derive a class object from CTabCtrl (CMyTabCtrl) with message handlers for tab messages like (IsChanging, Click etc).
2. Include the new header in my CMyPropertySheet.
3. Maintain a protected member (CMyTabCtrl m_oTabs) in CMyPropertySheet
4. In CMyPropertySheet::OnInitDialog do m_oTabs = GetTabControl();
Is there anything else I need to do in order to subclass the tabcontrol?
Thanks again.
slysi
|
|
|
|
|
and
no 4th is wroung.
4. Get the tabcontrol pointer using GetTabControl()
CTabCtrl *pTabCtrl = GetTabControl();
5. subclass the window.
m_oTabs.SubclassWindow(pTabCtrl->m_hWnd);
This will direct all the messages and notifications of the tab control to your tabcontrol.
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
thanks a million !!! will give it a try.
slysi
|
|
|
|
|
Hi all,
I've created my own form. when it opens, and i am not changing anything, and try to close it, i get the message 'do you want to save your changes'....
i've look via outlook spy at the appointment item properties and saw a 'read only' property called 'Saved' which has the value false.
my guess is that is what causing the form to be closed with the saved question first....
my question is how to start the form with the saved as true? (as i mentioned before it is a read only property)
can this be done using MAPI?
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
I compiled my program and it works on my own pc but when i run it on a laptop, the error appeared: unable to link to the afxdao.lib or header file. Where can i get the lib file to install to the laptop?
|
|
|
|
|
Whene I show the print preview for my doc the layout is truncate at the end of line
How i can display one line of my document in more time?
|
|
|
|
|
I have an MDI application and many menu options.When i click on any menu option i must be able to see the exe of a separate application.How is that possible....?
|
|
|
|
|
hello,friends!
can we include wave files or sound files as resources in the
project just like toolbars and menus.If any one knows help me.
advance thanq.
|
|
|
|
|
|
|
g_hDlgWnd=CreateDialog(g_hInst,MAKEINTRESOURCE(IDD_DIALOG_TEST),hWnd,(DLGPROC)DlgTestProc);
ShowWindow(g_hDlgWnd, SW_SHOWNORMAL);
以function建立一個Dialog(IDD_DIALOG_TEST),在IDD_DIALOG_TEST加入一個IDC_EDIT_INPUTTEXT(Edit Control)
我想在IDC_EDIT_INPUTTEXT按下Return時Call其他的Function,
問題就是:如何攔截在Edit上按下的Return?(win32 project)
INT_PTR CALLBACK DlgTestProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
long rvalue = 0;
/*
int processed = CGM.WinProc(hDlg, message, wParam, lParam, &rvalue);
if (processed)
return rvalue;
*/
switch(message)
{
case WM_INITDIALOG:
return Test_OnInitialDialog(hDlg);
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_EDIT_INPUTTEXT:
{
switch (HIWORD (wParam))
{
//case VK_RETURN:
// TRACE("VK_RETURN\n");
// break;
case EN_CHANGE:
{
CHAR lpszPassword[MAX_TALK_WORD];
WORD cchPassword;
cchPassword = (WORD) SendDlgItemMessage(hDlg,
IDC_EDIT_INPUTTEXT,
EM_LINELENGTH,
(WPARAM) 0,
(LPARAM) 0);
*((LPWORD)lpszPassword) = cchPassword;
// Get the characters.
SendDlgItemMessage(hDlg,
IDC_EDIT_INPUTTEXT,
EM_GETLINE,
(WPARAM) 0, // line 0
(LPARAM) lpszPassword);
// Null-terminate the string.
lpszPassword[cchPassword] = 0;
TRACE(">>>> cchPassword=%d ,lpszPassword=%s \n",cchPassword,lpszPassword);
}
TRACE("IDC_EDIT_INPUTTEXT %d,%d\n",wParam,lParam);
break;
}
}
break;
|
|
|
|
|
and the question is ?
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
lol !!!
"如何攔截在Edit上按下的 " means what ?!?!
TOXCCT alias Nicolas C.
|
|
|
|
|
The question was posted (and encoded) in Traditional Chinese. In English, it can be translated as "How to capture the 'Enter key' hit on an Edit Control"
My suggested solution would be to use PreTransMessage() and do something like the following;
BOOL CMyDlg::PreTranslateMessage(MSG *pMsg)
{
int ctrlID;
if (pMsg->message == WM_KEYDOWN)
if (pMsg->wParam == VK_RETURN)
{
ctrlID = (GetFocus())->GetDlgCtrlID();
if (ctrlID == IDC_MYEDIT)
return true;
}
return CDialog::PreTranslateMessage(pMsg);
}
Hope it helps
|
|
|
|
|
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?????
|
|
|
|
|
Talk nicely to your IT guys, and see if it's possible for them to change the settings. Think about it. If you could software bypass a firewall, how much use would the firewall actually be...?
Steve S
|
|
|
|
|
then can u explain to me why regular FTP software wore in the same case that can be helpful for me!!
|
|
|
|