|
I have compiled a MFC dialog-based application. The GUI is organizedas follows:
The application window is dialog-based and has the following on it:
1) Main dialog window has on it i)CListCtrl-1, ii)CTabCtrl-1
2) CTabCtrl-1 has on it 2 property pages. One of the property pages has a CListCtrl-2. (The other property page is irrelevant here)
At the GUI-level, I want to achieve the following:
"When an item in CListCtrl-1 is selected, the CListCtrl-2 should get populated with some values"
What I am unable to do:
I have added a message handler for CListCtrl-1 on the NM_CLICK event, but don't know how to get a pointer to CListCtrl-2 from the Main Dialog.
I have sufficient experience with VC++ - any help even outlining a technique of doing this (although code is always welcome) will be highly appreciated.
Thank you very much for the time you will taking out to help me on this.
|
|
|
|
|
|
Thanks for the reply.
GetDlgItem is not of any help, directly, but yes it has some role to play.
Meanwhile, I have worked out the solution and it seems to work well. Here's what I did:
a) I am persisting the pointers to all dialogs that the TabCtrl-1 will hold. (Simply putting them in a "CDialog *m_tabPages[4];" variable)
b) Now I am simply doing the following
CListCtrl * ptrToCListCtrl-2=(CListCtrl * )(TabCtrl.m_tabPages[0]->GetDlgItem(CListCtrl-2));
Thanks for the initiative, once again.
|
|
|
|
|
richiehere wrote:
CListCtrl * ptrToCListCtrl-2=(CListCtrl * )(TabCtrl.m_tabPages[0]->GetDlgItem(CListCtrl-2));
ptrToCListCtrl-2 ???? what is this supposed to be ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Apologies for the confusion. I meant "pointer to the 2nd list control"!
|
|
|
|
|
Hallo everybody, I am developing in Visual C++ and i finish my application, but now i have a seious dudad because i want that my application start when Windows XP start too without i do double click in the exe file of my application.
Can somebody help me?
Tack.
|
|
|
|
|
Make Reg Entry in Registry containing path of your application which you want to run at startup.
// For all user
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
//for Current User
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
But i have a question, i understand that you told me but if my application is running in other user and i dont want that the other user (both in the same comuter) can stop the application like for example remove this entry in the register and the next time that the computer start, it will not start.
If it is possible?
Because i need a application that work in the computer but only one user can use it and it doen't matter who start the computer and who log in, i want that always start to work.
Than you very much.
|
|
|
|
|
You should add the following value to registry subkey :
value:
"AnythingYouWantAsName" = "YourProgramPath"
// for example "Appliction" = "c:\myprogram.exe"
to the registry subkeys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\
so your application runs every time windows starts.
m0n0
|
|
|
|
|
no need to post smthing that was already answered, especially when you don't say more...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
While this is a true statement, you can't assume that Giorgi knew that an answer had already been posted. A common method for me when replying to posts is to right-click on each of the posts that I want to reply to and select Open in New Window. At this point I go through each one, re-read it, type my response, and submit it. It may be 30-45 minutes before I get to the last one and several others might have replied in the meantime.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Yes David ,thats exactly how i posted my answer , i did not know that anybody had already answered it .
m0n0
|
|
|
|
|
Its Not your business what i post here and what not!
I simply had not viewed what "ThatsAlok" had posted..
m0n0
|
|
|
|
|
|
but you also dispose of a [delete] link for your posts...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
If you had written it as an NT Service, you could mark it startup type as AUTOMATIC. Then it could run without a user being logged in without much trouble.
If you already have an EXE that has a user interface, then it is better to use the RUN method, as suggested. Another option is to add a shortcut to the Start Menu | Programs | Startup item to cause your progrma to run when the user logs in. This is more 'apparent' to the user than some 'hidden ' registry value.
|
|
|
|
|
Hi, my application will not have a user interface, so i dont understan what is the "mark it starup type as automatic" and where i mark it.
And another cuestion is if for example i have 2 different users and in one user have running the application but i dont want that the other can't stop this application, it is possible, doing it like u say in the sartup?
|
|
|
|
|
If you have a Windows NT service, and its configuration is to run 'Automatic' it will start when Windows starts and will be running already for each user.
If you don't want a particular user to be able to stop a service, make sure he is not an administrator on the local machine, or else deny them the start/stop service security privilege.
|
|
|
|
|
Sorry but i dont understand the configuration in Automatic, can u explain me?
Thanks
|
|
|
|
|
Hi
I am used to check the internet connection through vc++(mfc)
and i have checked it through InternetGetConnectedState which shows only the network connection (LAN).I want to check the actual internet connection trough the mfc. If lan is not there and internet connection is there it shold check and show right result.
Waiting for the +ve reply as soon as possible
Best Regards
ganesh
|
|
|
|
|
Anonymous wrote:
InternetGetConnectedState which shows only the network connection (LAN).
Actually the first argument to InternetGetConnectedState() is a mask that can be used to check any of the following situations:- Local system has a valid connection to the Internet, but it might or might not be currently connected.
- Local system uses a local area network to connect to the Internet.
- Local system uses a modem to connect to the Internet.
- Local system is in offline mode.
- Local system uses a proxy server to connect to the Internet.
- Local system has RAS installed.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
See here.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
How to get the click time of one picture in the IE control?(tool: VC)
To collect the click time of one picture in the IE contral, but this picture hasn't new URL to connecte.
How to get it?
thanks!
no
|
|
|
|
|
Hi,
i'm reading an AVI using Video for Windows VfW. Using AVIFILEINFO structure, i'm able to obtain the height, width etc. But how do i obtain the frame bitdepth(8-bit, 14,32 bit?)?
|
|
|
|
|
I am having trouble with this code. This is giving output as mesgbox with 0, ie successful, but is not filling the image. Please look in to it. I want to replace all connected pixels of a particular color with another color. Normal function outruns stack memory.
Any suggestions will be appreciated.
void dlg::OnButton1()
{
CClientDC* hdc= new CClientDC(this);
CFileDialog fd(1,0,0,0,"Bit Map(*.bmp)|*.bmp||");
fd.m_ofn.lpstrTitle="Browse";
if(fd.DoModal()==IDOK)
{
str=fd.GetPathName();
HBITMAP hBmp = (HBITMAP)::LoadImage(NULL,str,
IMAGE_BITMAP,0,0, LR_LOADFROMFILE|LR_CREATEDIBSECTION);
bmp.Attach(hBmp); //bmp is member of the class dlg
CClientDC dc(this);
bmDC.CreateCompatibleDC(&dc);
pOldbmp = bmDC.SelectObject(&bmp);
BITMAP bi;
bmp.GetBitmap(&bi);
dc.BitBlt(0,0,bi.bmWidth,bi.bmHeight,&bmDC,0,0,SRCCOPY);
bmDC.SelectObject(pOldbmp);
}
}
void dlg::OnLButtonDown(UINT nFlags, CPoint point)
{
COLORREF rgb;
CClientDC dc(this);
CQuickFill qf;
int i;
rgb=RGB(255,10,10);
i=qf.QuickFill(&bmp,point.x,point.y,rgb,CLR_INVALID);
if(i==0)
MessageBox("0","0");
if(i==-1)
MessageBox("1","1");
if(i==-2)
MessageBox("2","2");
if(i==-3)
MessageBox("3","3");
CDialog::OnLButtonDown(nFlags, point);
}
Awasthy
Any work worth doing is worth doing well.
|
|
|
|