|
hi virol
pls solve my problem
as i made a dialog button on which i made button
so now i want when press one button the value on this button appears on edit box
and values on edit box storesin order 12344...manner
thanks
Ashish Dogra
MCA
Noida
|
|
|
|
|
how can you change the back color of a dialog after its been open?
i know how to do it before it open.
|
|
|
|
|
u can change it using
afx_msg BOOL OnEraseBkgnd( CDC* pDC );
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
OnInitDialog()
you GetDC and Change Background
CBrush brush_background(RGB(255,0,0));
CDC* pDC = GetDC();
// Get rect
and use pDC->FillRec(rect, &brush_background);
Huynhnb
.: Your success is also me :.
|
|
|
|
|
Dear Huynhng,
I am able to Show the CFormView from CDialog but i am seeing the CFormView with in CDialog. I want to show the CFormView as a Separate Window/Frame.
here is the code as you told.
//==================================================================
CFrameWnd *pMainFrame = (CFrameWnd*)RUNTIME_CLASS(kiranfrm)->CreateObject();
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(IDI_ICON1,
RUNTIME_CLASS(kirandoc),
RUNTIME_CLASS(kiranfrm),
RUNTIME_CLASS(kiran));
CCreateContext sContext;
sContext.m_pCurrentDoc = (CDocument*) RUNTIME_CLASS(kirandoc)->CreateObject();
sContext.m_pCurrentFrame = NULL;
sContext.m_pLastView = NULL;
sContext.m_pNewDocTemplate = pDocTemplate;
sContext.m_pNewViewClass = RUNTIME_CLASS(kiran);
CString strClass= AfxRegisterWndClass(CS_VREDRAW|CS_HREDRAW, ::LoadCursor(NULL, IDC_ARROW), (HBRUSH)::GetStockObject(WHITE_BRUSH), ::LoadIcon(NULL, IDI_APPLICATION));
pMainFrame ->Create(strClass, _T(""), WS_CHILD, CRect(0,0,1,1), this, NULL, 0, &sContext);
pMainFrame ->MoveWindow(200,100,300,300);
pMainFrame ->ShowWindow(SW_SHOW);
//===========================================================================
Please help me Out. It is very Urgent.
uday.
|
|
|
|
|
Ok! i think you want to show Frame contains view is Formview. Yes/No?
You can folow step to show fromview form Button Click
You can use LoadFrame to show frame contain CFormView.
void CShowFrameDlg::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here
CFrmView *pFrame = new CFrmView();
pFrame->LoadFrame(IDR_MENU1, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE | WS_VISIBLE, NULL, NULL);
}
View of CFrmView is CFormView.
Dialog of CFormView set as Child.
---
Good luck
Huynhnb
.: Your success is also me :.
|
|
|
|
|
hi Huynhnb,
you are really genius. You have solved the Problem and i Got It.
thanks a lot for the solution.
uday.
|
|
|
|
|
You can WM_ERASEBKGND Or WM_PAINT or WM_CTLCOLOR
whitesky
|
|
|
|
|
Hello!
I think I have a problem with socket communication!
Sometimes I get an error message: 'An unknown error occured while accessing an unnamed file'. After I confirm this message I sometimes get following message: 'Server connection closed unexpected' (German: Serverbindung unerwartet beendet), and after confirming this message my program crashes.
This program is runnung on Win2000 and Win2003 server. It uses CSocket to communicate with a client. The CSocket is created with default parameter. The communication runs with CSocketFile and serializes CObjects.
First I thought this message occurres, if I start a remote control session with VNC. But I am not sure now.
Has anybody experience with this error, or can help me how to locate it.
Thank you!
|
|
|
|
|
Hi ,
I have a dialog based win32 application .In that dialog i need one read only edit box without border with printing the text in blue color(some other color)in that edit box.How to do this....
can we do it in edit control or should i use rich edit control ...
Manjunath S
GESL
Bangalore
|
|
|
|
|
|
Try to Over ride OnCtlColor
OnCtlColor( CDC* pDC, CWnd* pWnd, UINT nCtlColor )
"Dream bigger...Do bigger...Expect smaller"
aji
|
|
|
|
|
See WM_CTLCOLOREDIT
whitesky
|
|
|
|
|
Create a New class, derive it from CEdit and over-ride OnCtlColor member function. Here u can change the color.
Once u put a control in the dialog, link the dialog with this class...
|
|
|
|
|
Does anyone here have decent programming knowledge about zip files?
I'm trying to programatically add a file to an existing zip file, but can only overwrite the first file that is already in the archive. I can't find a decent search term that gives me a result that will give me a hint how to do it. I'm using the original classes from the article at http://www.codeproject.com/cpp/zip.asp[^] if that is any help, but I'm "not allowed" to use the newer classes from artpol software
Any help would be appreciated.
(Sorry if this is in the wrong forum - couldn't see a totally appropriate one and since I am using VC++...)
|
|
|
|
|
Leovinus wrote:
I'm trying to programatically add a file to an existing zip file, but can only overwrite the first file that is already in the archive
Is CZipArchive::AddNewFile has any problem?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
There is no CZipArchive in the older version.
|
|
|
|
|
Hi,
I have 3 dialogs and these are already made one.Now i have the plan to have these 3 dialogs in same place like property sheet.So, I insert one CPropertySheet class and i add this 3 dialogs in that by using AddPage.
But error is coming that AddPage cannot convert CGraphconfig in to CPropertySheet.
Why?Whats the reason?
|
|
|
|
|
Are you sure that these dialogs are derived from CPropertyPage?
- NS -
|
|
|
|
|
void CConnect::OnGroupTrend()
{
CConfigurator oConfig("Configurator");
CGraphviewConfig oGrphconf;
CGrpTrnConf oGrpConfig;
oConfig.AddPage(&oGrphconf);
oConfig.AddPage(&oGrpConfig);
oConfig.DoModal();
}
This is my PropertySheet function.The two dialogs are derived from PropertyPage.(i.e) i replaced CDialog in the code in to CPropertyPage.
Configurator class is derived from CPropertySheet.
Assertion error occurs in DoModal() line.I dont why yhe error occurs.
|
|
|
|
|
Tell me the details of assertion message.
- NS -
|
|
|
|
|
Today's goal is to guess the assertion's location simply by looking at irrelevent code snippets.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
If all you changed was the derivation from CDialog to CPropertyPage, you didn't quite make it. Create a new class using the Wizard and derive that class from CPropertyPage. Then make sure your base class calls for your classes match the generated ones.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hi all,
I'm trying to restore a window state to SW_RESTORE using the method ShowWindow. But as easy as this sounds I'm trying it in a dll. And for some reason i'm not getting it right.
I'm trying the following:
HANDLE ps = OpenProcess(SYNCHRONIZE|PROCESS_ALL_ACCESS,FALSE,pe_sen.th32ProcessID);
SetForegroundWindow(ps);
ShowWindow(hWnd, SW_RESTORE);
But one thing I must add is that I'm not creating a process, I'm just checking if a certain process is already running on the PC.
So I have seached all over the web and can't get anything that can help me, so if anyone has some info of a site or .... anything. It would make my day.
Thanx in Advance
Regards
Programm3r
|
|
|
|
|
You are passing a process handle into a function that expects a window handle. A process can have more than one window.
http://msdn.microsoft.com/msdnmag/issues/02/07/CQA/[^]
SetForegroundWindow() on Windows XP will just cause the app to flash in the taskbar if the window doesn't belong to the calling thread. You can use AttachThreadInput to get around this.
|
|
|
|