|
Thanks Judy,
Previously, I think the differences between debug and release version is whether the macro DEBUG and _DEBUG are defined. I think I am wrong. There should be more differences -- i.e. simply adding DEBUG and _DEBUG macros to release version project can not produce debug version project.
Do you have any experiences and knowledge to share what is the settings (e.g. compile options, linker options, etc.) which makes debug and relase version different please?
regards,
George
|
|
|
|
|
George_George wrote: Previously, I think the differences between debug and release version is whether the macro DEBUG and _DEBUG are defined. I think I am wrong
Yes, you are wrong. The differences have always been more than just that define. Things like optimizations (/O), information to include in the output file (/Z), which runtime to include (/MT /MD /L) and more.
George_George wrote: Do you have any experiences and knowledge to share what is the settings (e.g. compile options, linker options, etc.) which makes debug and relase version different please?
I've never memorized them. Whenever I've wanted to compare, I create a dummy project and then open it in two different instances of VS, one showing release and the other showing debug and compare them. Or just open up the .dsp file in text mode and compare the two sets of options directly. There are too many to know them all. Take my approach and compare them yourself then look them up in the help and see what each one does to really understand why a given setting is appropriate for which mode.
Judy
|
|
|
|
|
Hi Judy,
Great reply. I think all the configurations which matter is stored in .vcproj file, right (so I only need to compare with two .vcproj file to see any differences)? The .dsp file you mentioned should be some redundancy information of .vcproj file? Right?
I asked this question is because I am wondering if I only compare the two .vcproj files, whether I will miss some important settings which matter.
regards,
George
|
|
|
|
|
.dsp is the project file for VS6 and .vcproj is used for VS2005. I thought you were using 6, my mistake. You're not comparing two different vcproj files, you're comparing two different sections of the same vcproj from your sample project. If you look inside it, you'll find multiple "configuration" sections and within each section, all the different settings.
Judy
|
|
|
|
|
Thanks Judy!
regards,
George
|
|
|
|
|
I put some CEdit to the dialog, use the same function OnChangeEdit1, when the context of edit box is changed,
such as,
ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
ON_EN_CHANGE(IDC_EDIT2, OnChangeEdit1)
ON_EN_CHANGE(IDC_EDIT3, OnChangeEdit1)
the problem is, I can not decide which edit box has called the function, How can I get the ID for it?
|
|
|
|
|
Does this code helpful?
void CdddDlg::OnEnChangeEdit1()
{
if(GetFocus()==GetDlgItem(IDC_EDIT1))
MessageBox(_T("editbox1"));
if(GetFocus()==GetDlgItem(IDC_EDIT2))
MessageBox(_T("editbox2"));
}
|
|
|
|
|
...and for a syntactical point of view, you should always put curved braces for if statements, even it then contains only one instruction...
|
|
|
|
|
toxcct wrote: ...and for a syntactical point of view, you should always put curved braces for if statements, even it then contains only one instruction...
I always put curly braces for if statements, even if it would only be a one-liner. About a month ago, however, I started doing one-liners without the braces. I ran into so many problems from doing this. It took me quite a while to get re-accustomed to my old ways. It's funny, you would think it wouldn't cause any problems, but it did for me.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Thank you for your advice.;)
|
|
|
|
|
Step 1. Ensure that IDC_EDIT1,IDC_EDIT2,IDC_EDIT3 are consecutive ID's ie 1001,1002,1003
Step 2. instead of 3 separate ON_EN_CHANGE's inside the ClassWizard part of the MESSAGE_MAP use on ON_CONTROL_RANGE outside of the ClassWizard part of the MESSAGE_MAP
ON_CONTROL_RANGE(EN_CHANGE, IDC_EDIT1, IDC_EDIT3, OnChangeEdit1)
Step 3. change the declaration of OnChangeEdit1 to
void YourClass::OnChangeEdit1(UINT nIDCtl)
see ON_CONTROL_RANGE[^]
|
|
|
|
|
<br />
SqlCmd.Format("SELECT TOP %u * FROM \<br />
(SELECT TOP %u * FROM %s ORDER BY time DESC) as t1 \<br />
WHERE time not in (SELECT TOP %u time FROM %s ORDER BY time DESC) as t2 \<br />
ORDER BY time", \<br />
m_RcPerGrp,m_CntDispRc,m_TableName,tmp,m_TableName);<br />
If I take off
<br />
WHERE time not in (SELECT TOP %u time FROM %s ORDER BY time DESC) as t2<br />
there is no runtime error.
What's wrong?
|
|
|
|
|
the problem is not the SQL command but how you build the string...
you cannot write like you did, but change to this:
SqlCmd.Format("SELECT TOP %u * FROM <code>"</code>
<code>"</code>(SELECT TOP %u * FROM %s ORDER BY time DESC) as t1 <code>"</code>
<code>"</code>WHERE time not in (SELECT TOP %u time FROM %s ORDER BY time DESC) as <code>"</code>
<code>"</code>ORDER BY time",
m_RcPerGrp, m_CntDispRc, m_TableName, tmp, m_TableName);
moreover, you should use parametrized query objects to add some parameters to your query, rather than build a CString yourself...
for your query, i suggest you this optimization:
SELECT TOP :1 *
FROM
(SELECT TOP :2 * FROM :3 ORDER BY time DESC) as t1
WHERE
t1.time NOT IN
(SELECT TOP :4 time FROM :5 ORDER BY time DESC)
ORDER BY t1.time
-- modified at 11:08 Sunday 11th November, 2007
|
|
|
|
|
Thanks very much.
I've never used parametrized query objects.
If it is not difficult, I should follow you suggestion.
Maybe I should find some sample code.
|
|
|
|
|
followait wrote: there is no runtime error.
From the compiler, linker, or your program?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I create a CTreeCtrl control,but i cannot recieve the "TVN_ITEMEXPANDED" message.
the code:
m_pTreeCtrl=new CTreeCtrl();
m_pTreeCtrl->Create(TVS_HASBUTTONS |
TVS_HASLINES | TVS_LINESATROOT | TVS_FULLROWSELECT |
WS_TABSTOP|WS_CHILD|WS_VISIBLE|TVS_SINGLEEXPAND ,
CRect(0,0,20,20),
this,IDC_DROP_TREE);
ON_NOTIFY(TVN_ITEMEXPANDING, IDC_DROP_TREE, OnItemexpandingTreeDocuments);
Thanks!
|
|
|
|
|
If your using a CView derived class to host this in, you would want to make your code look something like the following...
//////////////////////////////////////////////////
// Generated message map functions
protected:
CTreeCtrl* m_pTreeCtrl;
//{{AFX_MSG(CTest234View)
//}}AFX_MSG
afx_msg void OnItemexpandingTreeDocuments(NMHDR* pNMHDR, LRESULT* pResult);
DECLARE_MESSAGE_MAP()
/////////////////////////////////////////////////////////
BEGIN_MESSAGE_MAP(CTest234View, CView)
//{{AFX_MSG_MAP(CTest234View)
//}}AFX_MSG_MAP
ON_NOTIFY(TVN_ITEMEXPANDING, IDC_DROP_TREE, OnItemexpandingTreeDocuments)
END_MESSAGE_MAP()
////////////////////////////////////////////////////
void CTest234View::OnInitialUpdate()
{
CView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
m_pTreeCtrl=new CTreeCtrl();
if (m_pTreeCtrl) {
m_pTreeCtrl->Create(TVS_HASBUTTONS |
TVS_HASLINES | TVS_LINESATROOT | TVS_FULLROWSELECT |
WS_TABSTOP|WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_SINGLEEXPAND ,
CRect(0,0,200,200),
this,IDC_DROP_TREE);
HTREEITEM hFirst=m_pTreeCtrl->InsertItem("First",NULL,NULL,NULL,TVI_SORT);
if (hFirst) {
HTREEITEM hSecond=m_pTreeCtrl->InsertItem("Second",NULL,NULL,hFirst,TVI_LAST);
}
}
}
void CTest234View::OnItemexpandingTreeDocuments(NMHDR* pNMHDR, LRESULT* pResult)
{
TRACE("Got here\n");
}
|
|
|
|
|
Well, CTreeCtrl derives from CObject so it'll probably throw a CMemoryException if it fails on "new" so my pointer check will probably never get reached on an error so it would be better located in a try/catch and I forgot to check the BOOL result from "Create" but you get the general idea.
|
|
|
|
|
thanks bob16792!
I create a tree control in my CDialog class, not CView class. well, I check my pointer is valid on "new" and the tree control I create appears on my dialog interface, so "Create" is successful.
If I drag a tree control on my dialog interface from the control box in the vc++, it can recieve the message,"VN_ITEMEXPANDED".
I don't know why the tree control that I create cannot recieve the message "VN_ITEMEXPANDED",but it can recieve the message "NM_CLICK".
|
|
|
|
|
|
Enviroment:
VC 6.0
SqlServer 2000
Demand:
For example,
<br />
_Recordset m_pRS;
...
<br />
<br />
Thanks very much, a little urgent.
-- modified at 3:54 Sunday 11th November, 2007
|
|
|
|
|
i created many dialog box's..
While i run the pgm the first one i created appears first...
how can i change so that when i run it, some other dialog box appears first(except the first one i created)
|
|
|
|
|
|
Change the order that they are created/shown?!?
I guess we need to see some code pertinent to what you are describing to understand what you are doing so that we might be able to offer a better suggestion but with what data you've provided in your post, we are limited to offering vague and general descriptions that really help no one.
Please offer more details.
|
|
|
|
|
i created many dialog box's..
While i run the pgm the first one i created appears first...
how can i change so that when i run it, some other dialog box appears first(except the
first one i created)
|
|
|
|
|