|
What you want is to create TWO CFormview Classes and then switch one form with another at runtime
here is an article that might help you
http://www.codeproject.com/docview/switchingviews.asp[^]
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Thanks, I know it, seems no other solution, I have already implemented this in my application. I just thinking can I just change form(dialog), not change View, like dialog base application, show new dialog, hide old dialog. Seems no other solution, only change view can solve my problem.
Thank you very much ...
Vistac
|
|
|
|
|
There is another way in which you do not need to switch view in SDI
simple steps
Create a dialog with no title bar in FormView
m_pDlg = new CMyDlg;
m_pDlg->Create(...,this);
m_pDlg->MoveWindow(....);
m_pDlg->ShowWindow(SW_SHOW);
delete m_pDlg;
m_pDlg = new CAnotherDialog;
m_pDlg->Create(...,this);
m_pDlg->MoveWindow(....);
m_pDlg->ShowWindow(SW_SHOW );
//just remember dialogs created should be modeless and should have no title bars (to stop user from moving it)
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
How to make RichEdit background can be one image in VC?
Lots of application has this effect,
but I can't find any way to realize it,
who can tell me?
Great thanks!
|
|
|
|
|
Have you tried to derive a class from CRichEditCtrl and Handle its OnEraseBackground event (paint a bmp in this handler)
Hope it Helps
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
my name is gunjju. for my current project i want one printer spooler which do this type of activity.
if i send print command from any application then my this program should activate and it read all data form that application and then my program print create one .bmp file at some where and and print all data in that .bmp file.
it is somthimg like "acrobat distrill" if any one have some idea then plz help me .
thanking u,
gunjju
gunjju
|
|
|
|
|
Hi,
I am writing a COM server with MFC support, Is it any way necessary to develop a com server with unicode support, Till now the design does not demand the unicode feature as it is a backgroud operation and not going to do anything with the UI.
Thanx in advance.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
If your COM server is not going to be used on Windows 9x/ME, then I would go ahead and make it UNICODE. On Windows NT/2000/XP, there are generally two versions of each function that takes string arguments, named FunctionA for the ANSI version, and FunctionW for the UNICODE version. Typically, the Windows headers #define a 'common' version called Function which evaluates to FunctionA or FunctionW based on whether your project is being compiled for ANSI or UNICODE, respectively. The ANSI versions convert string arguments to/from UNICODE as required. The ANSI versions therefore suffer a performance hit compared to the UNICODE versions.
Even if these considerations aren't important, if you are passing any user-supplied strings to the server (such as filenames), those values should be UNICODE.
Software Zen: delete this;
|
|
|
|
|
Thanx for replying, Yes this service is going be to used under Windows 9x and ME, and like i Said the design of the service does not demand for UNICODE support....
Regards,
Prakash.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
hi people,
i have built and compiled an EXE file, this program is about to open a SFX file(Tomb Raider SOUNDs) and put in a listbox all the sounds in it and then play them as WAV FILE(extract the sound to memory). But the PROBLEM is that in SOME PC around the world, when the users want to play a sound in the list, appears a critical message saying: Error in "fseekio64.c" Str = NULL, etc, but this only happen in some machines,mmmm, i guess im compiling my tool not as Standalone 100%, and im not including this routine in the exe, so that some people can play and other cant play the sounds
please man, what do you think about, im very sad with this, many weeks looking for help¡¡¡¡
Thank you
|
|
|
|
|
I drawed a graph using draw rectangle and draw lines. How can I zoom in the graph when clicked? What tools should I use?
|
|
|
|
|
No tools. Simply respond to the mouse click message, re-calculate your graph boundaries as desired, and draw the re-defined graph.
|
|
|
|
|
I'm trying to use messages to communicate within a program (I'm following the article "Interprocess communication tutorial By Alex Farber") but am running into a problem. I've followed the first few steps of his little tutorial, and run into the following error when i try to build the application:
error C2065: 'OnMessageTextChanged' : undeclared identifier
with regards to this line in programDlg.cpp :
ON_REGISTERED_MESSAGE(wm_Message, OnMessageTextChanged)
I thought that:
afx_msg LRESULT OnMessageTextChanged(WPARAM wParam, LPARAM lParam);
in programDlg.h was the proper way to declare this. Any ideas on what I may be doing wrong?
Thanks
greg
|
|
|
|
|
briefcase wrote:
Any ideas on what I may be doing wrong?
Have you #include d your header file in your cpp file?
Have you double checked the spelling and letter case?
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
I have a mdi aplication with 4 different views. I need a code sample where I can see how can I switch beetwen views and to see which view is the active view.
Thanks
|
|
|
|
|
I have an table in MS 2003 Access database. The tabel has a Ole object field where are stored some bitmaps. I use dao for accessing the database. The problem is that I don't know how to take out the bitmap from the dao variable that was crated by dao wizard . The variable is CLongBinary.
I need a function or sample code to see how to convert the bitmap from CLongBinary to CBitmap.
Thanks
|
|
|
|
|
When I was stepping thru this code to see why it was not working I found that the pInfo->m_nCurPage was not being updated. Any idea why?
I did not over ride OnBeginPrinting() or OnEndPrinting()
CMyView is derived from CEditView
BOOL CMyView::OnPreparePrinting(CPrintInfo* pInfo)
{
CString string;
int index=0;
int pages=0;
m_pbIndex.SetAt(pages, index);
GetWindowText(string);
while(index >= 0)
{
index = string.Find("\f", index+1);
pages++;
m_pbIndex.SetAt(pages, index);
}
pInfo->SetMinPage(1);
pInfo->SetMaxPage(pages - 1);
return DoPreparePrinting(pInfo);
}
void CMyView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
m_nPageHeight = pDC->GetDeviceCaps(VERTRES);
pInfo->m_rectDraw.SetRect(0, 0, pDC->GetDeviceCaps(HORZRES), m_nPageHeight);
double LeftOffset = 0.6;
double TopOffset = 0.5;
double RightOffset = 0.5 ;
double BottomOffset = 0.5 ;
pInfo->m_rectDraw.DeflateRect((int)(pDC->GetDeviceCaps(LOGPIXELSX) * LeftOffset),
(int)(pDC->GetDeviceCaps(LOGPIXELSY) * TopOffset),
(int)(pDC->GetDeviceCaps(LOGPIXELSX) * RightOffset),
(int)(pDC->GetDeviceCaps(LOGPIXELSY) * BottomOffset));
pDC->SetViewportOrg(0, (pInfo->m_nCurPage-1)*m_nPageHeight);
CMyDoc* pDoc = GetDocument();
PrintPage(pDoc, pDC, pInfo);
}
void CMyView::PrintPage(CJulieDoc* pDoc, CDC* pDC, CPrintInfo* pInfo)
{
int beg;
int end;
CString string;
GetWindowText(string);
beg = pbIndex.GetAt(pInfo->m_nCurPage-1);
end = pbIndex.GetAt(pInfo->m_nCurPage);
string = string.Mid(beg, end);
pDC->DrawText(string, pInfo->m_rectDraw,
DT_EXTERNALLEADING &&
DT_LEFT &&
DT_NOCLIP);
}
As always, Thank You
|
|
|
|
|
I figured out how to make it work.
Stay tuned for my first article.
Kevin
|
|
|
|
|
Dear friend,
I need some helps on my programming. I try to associate with the database (Access) to check the login process.When I compile the program . 3 error is appeared and I cannot solve. these errors are
1)nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
2) nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
3)Debug/PlantMonSys.exe : fatal error LNK1120: 2 unresolved externals
Regards,
Anson Tong
|
|
|
|
|
Check this article[^] for clues. If you don't find anything there that works, try posting the code segment that appears to be causing this error.
[EDIT]
This article[^] is even better - you need to set your project settings to Multithreaded.
[/EDIT]
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
Roger,
Thanks you for help and I has solved my problem
Regards
anson
Regards,
Anson Tong
|
|
|
|
|
Joshua Heyer has a fine article showing how to add drop shadows (CD_DROPSHADOW) to tool tip ballons. I have a bunch of existing code using MFC 7.0 that I don't want to rewrite if I don't have to.
I am looking for an easy way to modify the existing class (inherited from CToolTipControl) to include the drop shadows (and some other features in Joshua's code) into my application.
Anyone have some ideas or can you point me to an article that I can adapt from?
Thanks,
Barry
Barry
|
|
|
|
|
Please, tell me, how can I create a simple Dialog Window and the upon pressing the button change the form's and button's font and colour? If possible, write a code or give me a link with sources.
|
|
|
|
|
When I use sproxy.exe (version 7.00.9466), I get an error message: SDL1000 : Not enough storage is available to complete this operation. If I remove the fault element from the operation element, the header is generated. See wsdl below. Any ideas?
Thanks,
Rick
<?xml version = '1.0'?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns2="http://xmlns.catch.com/ws/types"
xmlns:tns="http://xmlns.catch.com/ws"
name="RemoteAccess"
targetNamespace="http://xmlns.catch.com/ws">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://xmlns.catch.com/ws/types"
targetNamespace="http://xmlns.catch.com/ws/types">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="WebServiceException">
<sequence>
<element name="errorCode" type="int"/>
<element name="message" type="string"/></sequence></complexType>
</schema></types>
<message name="RemoteAccessProvider_endSession"/>
<message name="RemoteAccessProvider_endSessionResponse"/>
<portType name="RemoteAccessProvider">
<operation name="endSession" parameterOrder="">
<input message="tns:RemoteAccessProvider_endSession"/>
<output message="tns:RemoteAccessProvider_endSessionResponse"/>
<fault name="WebServiceException" message="tns:WebServiceException"/></operation>
</portType>
<binding name="RemoteAccessProviderBinding" type="tns:RemoteAccessProvider">
<operation name="endSession">
<input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://xmlns.catch.com/ws"/></input>
<output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://xmlns.catch.com/ws"/></output>
<!-- Offending Code, remove and sproxy.exe works.-->
<fault name="WebServiceException">
<soap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://xmlns.catch.com/ws/"/></fault>
<!-- Offending Code End -->
<soap:operation soapAction=""/></operation>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/></binding>
<service name="RemoteAccess">
<port name="RemoteAccessProviderPort" binding="tns:RemoteAccessProviderBinding">
<soap:address xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" location="http://localhost/ws"/></port></service></definitions>
|
|
|
|
|
hi....the problem is
1)how to connect with dataBase (oracle) by ADO and execute Query for the table 'ALL_DEPENDENCIES'.
2)how to sort the refered object so that they come in hierarchal ,so that when creating the Object creation script (.Sql) the Master detail flow will be correct and the refered object will be in order i.e. same as the forward refe'g.
thanks....
utkarsh sharma
"Not everything that counts can be counted, and not everything that can be counted counts."
|
|
|
|