|
At first, i would like to Thank you so much! Dear *Dreamz. You're so kind!
as you said, i checked the DoDataExchange funtion in Dialog' cpp,here it is:
--------------------------------------------------------------
void CStepbystepView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CStepbystepView)
//}}AFX_DATA_MAP
}
--------------------------------------------------------------
i think no "datagrid" or something else related i don't know how to do,,, could you tell me the next step? Thanks!
Best Wishes,
---------------------------
You will when you believe!
------------------------
|
|
|
|
|
When you create a member variable the declaration will come in the Class' .h File and a reference ( like this .. DDX_Control(pDX, IDC_DATAGRID1, m_datagrid1) ) will be there in the DoDataExchange function.
Still i couln't get what can be the problem..
Can you try to delete the varible by the "Delete Variable" button in the "Add Member Variable Dialog"...
|
|
|
|
|
At first,Thanks again!
when i now create a new project and do as following steps:
1. Insert ActiveX control: Microsoft DataGrid Control, Version 6.0(OLEDB);
2. Use classwizard bind the IDC_DATAGRID1,and a dialog come out:
"The ActiveX Control "Microsoft DataGrid Control, Version 6.0(OLEDB)" has not been inserted into the project. Developer Studio will do this now and generate a C++ wrapper class for it."
and then i can find :
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CStepbystepView)
DDX_Control(pDX, IDC_DATAGRID1, m_datagridctrl);
//}}AFX_DATA_MAP
in DoDataExchange function.
but i don't know the project now i'm running, i Insert ActiveX control but that dialog ""The ActiveX Control "Microsoft DataGrid Control, Version 6.0(OLEDB)" has not been inserted into the project. Developer Studio will do this now and generate a C++ wrapper class for it." didn't come out
maybe because i have added CDataGrid1 class manually before? but now i searched DataGrid in files,i find nothing, i don't known
Thank you again for your help! this question has puzzled me for a long time!
hope to hear good news!
Best Wishes,
---------------------------
You will when you believe!
------------------------
|
|
|
|
|
I think in your new application its works fine
Dick.lee Solucky wrote:
but i don't know the project now i'm running, i Insert ActiveX control but that dialog ""The ActiveX Control "Microsoft DataGrid Control, Version 6.0(OLEDB)" has not been inserted into the project. Developer Studio will do this now and generate a C++ wrapper class for it." didn't come out
Once you have added the classes this messagebox wont come again...
|
|
|
|
|
*Dreamz wrote:
Once you have added the classes this messagebox wont come again...
what i want now is just it come out again... and this time i want to do it right.
-------------------------
Best Wishes sehsiW tseB
-------------------------
You will when you believe!
-------------------------
|
|
|
|
|
|
yes,i have tried to delete the varible by the "Delete Variable" button, that can be done, and i double click Add Varible the Variable type is CDataGrid1, but i don't have CDataGrid1 class in classview at all
hope you can understand...
Best wishes,
---------------------------
You will when you believe!
------------------------
|
|
|
|
|
Dick.lee Solucky wrote:
Add Varible the Variable type is CDataGrid1, but i don't have CDataGrid1 class in classview at all
By default wizard will give you the class name as CDataGrid.Did you change that?
Dick.lee Solucky wrote:
but i don't have CDataGrid1 class in classview at all
Please check whether all the files are added to your workspace.Else you can add them from the working folder...
Could you add the member variable...??
|
|
|
|
|
*Dreamz wrote:
By default wizard will give you the class name as CDataGrid.Did you change that?
yes!exactly!that's my problem! i didn't known at that time so i added CDataGrid class myself(so stupid! ) and i added twice,so now i got CDataGrid1
*Dreamz wrote:
Please check whether all the files are added to your workspace.Else you can add them from the working folder...
now what i want is just that very beginning's dialog: like just i'm beginning a new project.
Thanks again for your help!!!!! You're so kind!!!!!!!!!!!
wait for you...
-------------------------
Best Wishes sehsiW tseB
-------------------------
You will when you believe!
-------------------------
|
|
|
|
|
Ok........
Now i got what you want to do...
You have to remove all that reference to the DataGrid control....
I also dont know how to remove the control once it is added...
I'll check it and get back to you .....
Good Luck....
|
|
|
|
|
*Dreamz wrote:
Now i got what you want to do...
it's so sweet...
*Dreamz wrote:
I'll check it and get back to you .....
you're my hero! ^.^ Thanks!
Have a good day! and wish everything goes well!
" remove all that reference to the DataGrid control...."
and i also learn how to ask questions ! Thanks!
-------------------------
Best Wishes sehsiW tseB
-------------------------
You will when you believe!
-------------------------
|
|
|
|
|
Thanks a lot
|
|
|
|
|
It's me should say thanks! wish everything goes well!
-------------------------
Best Wishes sehsiW tseB
-------------------------
You will when you believe!
-------------------------
|
|
|
|
|
Delete all the newly added files for the DataGrid from your workspace and from the current working folder...
Delete the include for datagrid.h and Rebuild all...
Open the Project' .dsp file in a notepad.Towards the end of the file there will be some entries for the newly added files for the DataGrid.
eg:
# Section CPTest : {CDE57A43-8B86-11D0-B3C6-00A0C90AEA82}
# 2:21:DefaultSinkHeaderFile:datagrid.h
# 2:16:DefaultSinkClass:CDataGrid
# End Section
Delete all those sections for the classes that we deleted..
Rebuild All...Now do what you want..You will get "Your Message" dialog..
Note:
Dear Dick.lee Solucky...
This is what i tried by created an application like yours...
I am not sure that this is a right way or not...
So if you use this,please make a copy of your application and proceed...please..
I could build the application without any error....
Good Luck
|
|
|
|
|
Oh,my God! How can i express my thanks!!! my dear *Dreamz!
now i'm following your method and open Project' .dsp in UltraEdit, i find:
# Section stepbystep : {CDE57A43-8B86-11D0-B3C6-00A0C90AEA82}
# 2:21:DefaultSinkHeaderFile:datagrid1.h
# 2:16:DefaultSinkClass:CDataGrid1
# End Section
Thank God! i finally find it! with your help! dear *Dreamz! how can i express my thanks!!!!!!!
actually not only one,i also got:
# Section stepbystep : {CDE57A43-8B86-11D0-B3C6-00A0C90AEA82}
# 2:21:DefaultSinkHeaderFile:datagrid1.h
# 2:16:DefaultSinkClass:CDataGrid1
# End Section
# Section stepbystep : {BEF6E003-A874-101A-8BBA-00AA00300CAB}
# 2:5:Class:COleFont
# 2:10:HeaderFile:font.h
# 2:8:ImplFile:font.cpp
# End Section
# Section stepbystep : {00028C02-0000-0000-0000-000000000046}
# 2:5:Class:CDataGrid
# 2:10:HeaderFile:datagrid.h
# 2:8:ImplFile:datagrid.cpp
# End Section
# Section stepbystep : {7BF80981-BF32-101A-8BBB-00AA00300CAB}
# 2:5:Class:CPicture
# 2:10:HeaderFile:picture.h
# 2:8:ImplFile:picture.cpp
# End Section
# Section stepbystep : {CDE57A41-8B86-11D0-B3C6-00A0C90AEA82}
# 2:5:Class:CDataGrid1
# 2:10:HeaderFile:datagrid1.h
# 2:8:ImplFile:datagrid1.cpp
# End Section
# Section stepbystep : {00028C00-0000-0000-0000-000000000046}
# 2:21:DefaultSinkHeaderFile:datagrid.h
# 2:16:DefaultSinkClass:CDataGrid
# End Section
all these things! i've been searching for month!
*Dreamz wrote:
Rebuild All...Now do what you want..You will get "Your Message" dialog..
Oh,my God!!!!!!! You're my Angel,*Dreamz!(hope you don't mind i call you that! )
You know, i've been really disappointed before, when every time i met questions of vc and i could't solve, i rebuilt a new project!
You show me that's not the right way! there are solutions! i will try not to escape from the problem,and face it bravely! because of you!
This is really a wonderful place! so nice to meet you! Keep in touch!
-------------------------
Best Wishes sehsiW tseB
-------------------------
You will when you believe!
-------------------------
|
|
|
|
|
Dick.lee Solucky wrote:
CDE57A43-8B86-11D0-B3C6-00A0C90AEA82
i felt dazzle when i saw these before,,, but today, i find it's so lovely! VC is really huge!!
Dick.lee Solucky wrote:
2:21:
and what does this mean for.... there are so many questions in my head! but i'm so excited!!!
*Dreamz,Thanks again!
wish everything goes well!
Merry Christmas,and so nice to meet you !!!!!!!
Wish everyone at CP have a great Christmas and next year we can have more and more people here in CP ,cos it's really great place !
-------------------------
Best Wishes sehsiW tseB
-------------------------
You will when you believe!
-------------------------
|
|
|
|
|
Happy to hear that you have got it working
Dick.lee Solucky wrote:
Oh,my God!!!!!!! You're my Angel,*Dreamz!(hope you don't mind i call you that! )
I don't mind ....
Good Luck
|
|
|
|
|
hi dreamz, was reading the thread, was very educational for me too.
and glad that you are an angel now...
-prakash
|
|
|
|
|
Mr.Prakash wrote:
and glad that you are an angel now...
Me too....
Thanks Mr.Prakash..Nice to know that it was useful for you....
|
|
|
|
|
this is tougher time:
my project is using Carlos's ado class,
http://www.codeproject.com/database/caaadoclass1.asp[^]
and now my problem is: i can't find my problem!
Hi, *Dreamz, you know it's you give me strength to ask a question again! i really wanted to give up again(i'm ashamed of that! ), but recalling all your efforts! i think i should continue to battle!
but this time i really don't know where the problem is!
last time, i thought it's because i added datagrid class in a wrong way, so it din't work, but following your way,i have that dialog and added the class in the right way, but i still can't use this ActiveX control properly.
all things go well when i created a new project,
i just want to share ,,, Thanks! i even didn't know how to ask a question
do u have any suggestions? or i leave my msn, and we talk there?
dick_ltj@hotmail.com
Thank you again!
-------------------------
Best Wishes sehsiW tseB
-------------------------
You will when you believe!
-------------------------
|
|
|
|
|
I am sorry to say but i am not able to access messenger from my office now...
Post it here,or you can mail me as well..
Will try to reply you as soon as possible....
So what is the problem?
Dick.lee Solucky wrote:
but following your way,i have that dialog and added the class in the right way, but i still can't use this ActiveX control properly
What happend??
|
|
|
|
|
You must be the man God send you to help me!
Now I can describe what happened: I hope maybe can help you to find the problem out:
When I delete the Microsoft DataGrid Control, Version 6.0(OLEDB) from my dialog CDataBindDlg, and select in the menu,
//////////////////////////////////
CDataBindDlg databinddlg;
databinddlg.DoModal();
//////////////////////////////////
And the dialog can come out, and if I insert BreakPoint here :
//////////////////////////////////
BOOL CDataBindDlg::OnInitDialog()
{
CDialog::OnInitDialog();
<-- BreakPoint
…
//////////////////////////////////
It can run here.
--------------------------------------------------------------------------
But when I added the Microsoft DataGrid Control, Version 6.0(OLEDB), then I select in the menu, nothing happened, dialog didn't come out,
And also program didn't stop at my breakpoint,
I don't know where the problem is
following code can run properly in my new build project,it's the code to bind Recordset to DataGrid
////////////////////////////////////////////
CString strConnection = _T("Driver={Microsoft ODBC for Oracle};Server=tzcenter;Uid=voice_call;Pwd=voice_call;");
//strConnection = _T("Driver={SQL Server};Server=sysdevpdc;Trusted_Connection=Yes;Database=sysDev;uid=sa;pdw=");
if(m_pDb.Open(strConnection))
{
m_pRs = CADORecordset(&m_pDb);
if(m_pRs.Open("t_ywdm_576", CADORecordset::openTable))
//if(m_pRs.Open("sysTable01", CADORecordset::openTable))
{
m_datagridctrl.SetCaption("Clients");
m_datagridctrl.SetRefDataSource(NULL);
m_datagridctrl.SetRefDataSource((LPUNKNOWN)m_pRs.GetRecordset());
m_datagridctrl.Refresh();
}
}
else
{
AfxMessageBox(m_pDb.GetLastErrorString());
DWORD dwError = m_pDb.GetLastError();
//
return FALSE;
}
//
return TRUE; // return TRUE unless you set the focus to a control
-------------------------
Best Wishes sehsiW tseB
-------------------------
You will when you believe!
-------------------------
|
|
|
|
|
Dick.lee Solucky wrote:
When I delete the Microsoft DataGrid Control, Version 6.0(OLEDB) from my dialog CDataBindDlg, and select in the menu,
just mean i created a dialog and do nothing, of course it will show when i use "databinddlg.DoModal()"
But when i added the Microsoft DataGrid Control, Version 6.0(OLEDB), dialog didn't come out, and the program also didn't run to -> CDialog::OnInitDialog(); i don't know where it stopped ...
i guess there are some problems of the initialization of Microsoft DataGrid Control, Version 6.0(OLEDB)
-------------------------
Best Wishes sehsiW tseB
-------------------------
You will when you believe!
-------------------------
|
|
|
|
|
- - - - - - - - - - - - - -
Many nights we prayed with no proof anyone could hear, we were moving moutains long before we knew we could !
Yet now i'm standing here, although we know there's much to fear, hope seems like summer bird too swiftly flown away ...
There can be miracles! When you believe, though hope is frail, it's hard to kill!
Who knows what miracles, you can achieve! When you believe, somehow you will ...
YOU WILL WHEN YOU BELIEVE
|
|
|
|
|
when i insert the control in my main form, a MessageBox will appear:
"failed to create new document" (my VC6 is Chinese Edition,i don't know whether it's the right translation)
i trace and find the information is coming from these code:
-----------------------------------------------------------
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1998 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#include "stdafx.h"
#ifdef AFX_CORE3_SEG
#pragma code_seg(AFX_CORE3_SEG)
#endif
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
....
int nResult =
::MessageBox(hWnd, lpszPrompt, pszAppName, nType);
-----------------------------------------------------------
i don't know whether it can help you to figure it out.
Thanks!!!!!!!!!!!!!!!!!!!!!
Best wishes!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Many nights we prayed with no proof anyone could hear, we were moving moutains long before we knew we could !
Yet now i'm standing here, although we know there's much to fear, hope seems like summer bird too swiftly flown away ...
There can be miracles! When you believe, though hope is frail, it's hard to kill !
Who knows what miracles, you can achieve! When you believe, somehow you will ...
YOU WILL WHEN YOU BELIEVE
|
|
|
|
|