|
Thanks!I am grateful for people that answers my stupid newbee questions
|
|
|
|
|
Hey mate. We all started out where you are. Don't even worry about it.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
By the way, I'm assuming that m_nNumber is a DDX variable already associated with the control in your DoDataExchange function.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
I'm e-mailing using SMTP, and in most cases there's no problem, but many e-mails get bounced back with an error "Domain of sender address xxx@yyy.com does not exist" where the e-mail address it says is my sender address and is a valid e-mail address.
I'd really appreciate it if anyone can shed any light on this problem and how to fix this.
Thanks,
Mark
|
|
|
|
|
I´m creating an application that has a control bar. This control bar is dockable and has a combobox inside of it. I´ve created the resource dialog bar and added the combobox to it. When my app loads, my control bar doesn´t have the default control bar layout (with the border and that dragging grip on the left). I´ve readed MFC docs and it says that to a control bar use the default layout you need to define the dialog resource id with an id between AFX_IDW_CONTROLBAR_FIRST (59392) and AFX_IDW_CONTROLBAR_LAST (59647). I´ve defined an ID with AFX_IDW_CONTROLBAR_FIRST + 32 and after the resource editor goes completly nuts, stating that I can only define resourceID between 1 and 32767. Anyone know how to solve this ? Do I need to create this dialog bar in a different way ?
Mauricio Ritter - Brazil
Sonorking now: 100.13560 Trank
I´ll take your brain to another dimension, I´ll take your brain to another dimension, I´ll take your brain to another dimension... Pay close attention...
|
|
|
|
|
Mauricio Ritter wrote:
Do I need to create this dialog bar in a different way ?
How are you creating it now? There are a few styles that control borders (CBRS_GRIPPER , etc.) that need to be present during creation.
--------
all the modern things
have always existed
they've just been waiting
to come out
and multiply
and take over Björk, The Modern Things
|
|
|
|
|
The resource doesn't have the ID in this range, the control bar does. In the call to Create() for the control bar, you need to specify the ID of the bar. This is usually the last parameter. Set this in the AFX_IDW range.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Hello!
Everytime I try to run my program on an other machine, where MS Visual C++ is not installed, I got an error message: Debug Assertion Failed! … File: winocc.cpp - Line 189…
My program basis – class is CRichEditView. I also used the ADO – interface, CRichEditCtrl, CTreeCtrl.
I don’t know which files I have to add in the InstallShield DLL - links – or is it an other mistake????
|
|
|
|
|
Well what does line 189 in winocc.cpp say? That will help you track down the problem.
It isn't a missing DLL problem unless the DLL is delay loaded. Otherwise, the program wouldn't even start.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Is there any tutorial where they make more than one dialog box for begginers... I haven't found any.
|
|
|
|
|
Assuming Visual C++.NET (since you didn't specify):
1) Open the Resource View (via the View menu)
2) Expand the items in the Resource View until you see the Dialog folder
3) Right-click the Dialog folder and select the Insert Dialog menu item
4) Drag and drop the desired controls to the dialog
5) Double-click the dialog background to invoke the Add Class dialog
6) Name the class and select CDialog as the base class. Note the header file name
7) Include the header in the file that will display the dialog
8) Use the dialog's DoModal function to display the dialog
These are very general instructions. For any more help, you need to be more specific about what you're trying to do.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
The key to having more than one dialog is to make sure that they are modeless dialogs. When you use the DoModal function to create dialogs, it creates a Modal dialog. This locks everything down in your application until the user exits from the modal dialog.
A modeless dialog allows the user to switch from window to window, even the dialog box that you have created. In order to create a modeless dialog, allocate a dialog object, call Create in order to create the actual window, then call ShowWindow You can do this as many times as you want to with modeless dialogs.
If you are simply using the Win32 SDK, you can use DialogBox to create modal dialogs, or CreateDialog to create modeless dialogs.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I want to use a QueryDef in my database application. I used a parameter query (Find Words: "PARAMETERS WordParam Text ( 255 ); SELECT * FROM EN_Words WHERE Word LIKE [WordParam];" ) but it doesn't work, m_pSet->GetRecordCount returns 0. When I pass a SQL string ( "SELECT * FROM EN_Words WHERE Word LIKE 'connect*' ". ("connect*" is the default value of m_strWord) ) to CDaoRecordset::Open() function instead of m_pQD, it works and m_pSet->GetRecordCount returns 5. How can I do this?
Note: I'm using VC++ 6.0 SP3
m_pDB = new CDaoDatabase;
m_pDB->Open( "data/db3.mdb" );
m_pQD = new CDaoQueryDef( m_pDB );
m_pQD->Open( "Find Words" );
COleVariant varParam( m_strWord );
m_pQD->SetParamValue( "WordParam", varParam );
m_pSet = new CDaoRecordset( m_pDB );
try
{
m_pSet->Open( m_pQD );
}
catch( CDaoException* e )
{
AfxMessageBox( e->m_pErrorInfo->m_strDescription );
e->Delete( );
return FALSE;
}
kozlu
|
|
|
|
|
Hi, friends,
I create more than one windows (different instance but belongs to the same
window class) on desktop, and want to manage them by "Cascade", "Tile
Horizontally" and "Tile Vertically" commands.
Of course the first idea is using window SDK functions: CascadeWindows(...),
TileWindows(...). The problem arise however, The two functions will restore all
other windows on desktop, which is not a good design of course.
The solution is to write my own CascadeWindows and TileWindows subroutines.
But I don't know how to do it. any idea? Thanks!
wuwu
|
|
|
|
|
If you look at the definition for CascadeWindows:
WORD CascadeWindows(
HWND hwndParent,
UINT wHow,
CONST RECT *lpRect,
UINT cKids,
const HWND *lpKids
);
lpKids is an array that allows you to specify only the windows that you want to cascade. Therefore if you use GetWindow to enumerate and find only the window handles that you are interested in, you will be able to cascade the set of windows that you want.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi,
Finally were you able to find the solution.
If yes please do post the same.
Priya Sundar
|
|
|
|
|
Hi,
i have got classes(actually GUI controls in IDD_CFormView Dialog) derived from CFormView,need to be displayed like a popup window(MDI child window) whenever the menu is choosen,this is an MDI application.
HELP!!
mohan
|
|
|
|
|
What do you mean the form needs to be displayed like a popup window? Do you mean as an mdi child window?
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
Archer,
Yeah the form should be displayed like a mdi child window
mohan
|
|
|
|
|
This is not the easiest thing on the planet and does involve a few steps. I have a demo app I can send you if you want.
- Create the app (mine is called MDIFormViewTest).
- Create the dialog template resource. (I created two, IDD_DIALOG1 and IDD_DIALOG2).
- Change template's Style property to Child
- Create a CFormView derived class based on the template. Mine are CFormView1 and CFormView2.
- Create the menu option (using the MDI menu)
- Define a CMultiDocTemplate member variable in the document for each form view. For the two form views in my demo, here are their document template pointers.
class CMDIFormViewTestDoc : public CDocument
{
...
CMultiDocTemplate* m_pFormView1Template;
CMultiDocTemplate* m_pFormView2Template;
...
}
- Add the following include directive to the document's file for the childfrme.h and your formviews
#include "ChildFrm.h"
#include "FormView1.h"
#include "FormView2.h"
- Create and add the template to the application's doc manager in the document's constructor
CMDIFormViewTestDoc::CMDIFormViewTestDoc()
{
CWinApp* pApp = AfxGetApp();
ASSERT(pApp);
if (pApp)
{
m_pFormView1Template = new CMultiDocTemplate(IDR_MDIFormViewTestTYPE,
RUNTIME_CLASS(CMDIFormViewTestDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CFormView1));
pApp->AddDocTemplate(m_pFormView1Template);
m_pFormView2Template = new CMultiDocTemplate(IDR_MDIFormViewTestTYPE,
RUNTIME_CLASS(CMDIFormViewTestDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CFormView2));
pApp->AddDocTemplate(m_pFormView2Template);
}
}
- Define the following function in your document class. This function will either create the view if not present or activate it (bring it to the foreground).
void CMDIFormViewTestDoc ::CreateOrActivateFrame(CDocTemplate* pTemplate, CRuntimeClass* pViewClass)
{
CView* pView;
POSITION pos = GetFirstViewPosition();
while (pos != NULL)
{
pView = GetNextView(pos);
if (pView->IsKindOf(pViewClass))
{
pView->GetParentFrame()->ActivateFrame(SW_RESTORE);
return;
}
}
CFrameWnd* pFrame = pTemplate->CreateNewFrame(this, NULL);
ASSERT(pFrame);
pTemplate->InitialUpdateFrame(pFrame, this);
}
- Add an event handler to the document for each form view menu entries and call the CreateOrActiveFrame function. Here are the two for my demo.
void CMDIFormViewTestDoc::OnFormviewsView1()
{
CreateOrActivateFrame(m_pFormView1Template, RUNTIME_CLASS(CFormView1));
}
void CMDIFormViewTestDoc::OnFormviewsView2()
{
CreateOrActivateFrame(m_pFormView2Template, RUNTIME_CLASS(CFormView2));
}
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
It's 5:30am so I'm headed off to bed in next few. Let me know if this is working for you or if you want me to send you the demo.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
Archer,
Thanx,can u send me the demo, so,it would be helpfull to me.
Thanks very much for ur help.
mohan
|
|
|
|
|
You're very welcome. Demo is on the way.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
Archer,
Very much thanks for the Demo, is that the code same even for if the dialog resource is IDD_FORMVIEW(now what u have done is IDD_DIALOG1).
By the way i've already develped number of of applicatons(15,every application is a single window) in MDI,now i have to integerate all the applicaton into an single MDI application, can u give me a idea.
Hope u understand my question.
THanking you
mohan
|
|
|
|
|
mohanrajh wrote:
Very much thanks for the Demo, is that the code same even for if the dialog resource is IDD_FORMVIEW(now what u have done is IDD_DIALOG1
The resource id doesn't matter as it's abstracted from my code via your CFormView-derived class.
mohanrajh wrote:
By the way i've already develped number of of applicatons(15,every application is a single window) in MDI,now i have to integerate all the applicaton into an single MDI application, can u give me a idea.
Sure. Shouldn't be too hard. I haven't actualy done the following steps, but something like this should be really close to what you need to do.
1) Open the MDI project where everything will end up
2) One by one, open the resource file of each MDI project that has only one view. Copy the needed dialog to the clipboard and then paste it into the main MDI project's resource view.
3) Copy each view's cpp and h file to the main project's folder and add it to the project.
4) If you've kept your code mainly in the view classes, you should be set at this point.
5) Now just follow the original instructions from the point at which you have your formview classes.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|