|
What's problem? Code is simple.
void addTail(element*&head, element* new, element*&tail)
{
new->next=NULL;
new->prev=tail;
if (tail!=NULL)
{
tail->prev=new;
new->idx=tail->idx+1;
}
else
{
head=new;
new->idx=0;
}
tail=new;
}
Do not trust a computer...
Always check what computer is doing
regards,
Divyang Mithaiwala
Software Engineer
|
|
|
|
|
Divyang Mithaiwala wrote: Do not trust a computer...
Always check what computer is doing
As well as don't trust your mental compiler: new , you know, is a C++ keyword hence, as it stands, your code won't compile.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi There.
I am using VS2008, and am facing above problem.
For details, below is what I am doing...
CString strSource = L"Hello";
TCHAR SourceFile[] = strSource;
Please suggest.
Thanks
PanB
|
|
|
|
|
Found a Solution: Above conversion can be done using _tcscpy function.
Eg:
CString strSource = L"Hello";
TCHAR SourceFile[100];
_tcscpy(SourceFile, strSource );
|
|
|
|
|
Your solution only works on UNICODE builds.
On the other hand, you may easily generalize it with
CString strSource = _T("Hello");
TCHAR SourceFile[100];
_tcscpy(SourceFile, strSource );
to work both in UNICODE and in ANSI builds.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Why do you need it?
Are you sure you need to convert a wide char string into a generic text mappings array?
If the answer to the second question is yes then you need something like:
HRESULT hr;
TCHAR SourceFile[0x100];
CString strSource = CString(L"Hello");
hr = StringCbCopy(SourceFile, sizeof(SourceFile), strSource);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
MFC, STUDIO 2008, MDI-project
advanced to forward, 2 errors became less:
#pragma once
class СAdderDialog; // after addition this line into file "modeldlg.h" eliminate (remove)only 2 errors
// CMainDlg
class CMainDlg : public CDialog
{
СAdderDialog* m_pModeless5;
CMainDlg::CMainDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMainDlg::IDD, pParent)
, m_pModeless5(NULL)
{
. . . . . . . . . . .
void CMainDlg::OnOK()
{
if (m_pModeless5 == NULL) // OK!
{
m_pModeless5 = new CAdderDialog(this); // error C2440: '=' : cannot convert from 'CAdderDialog *' to 'СAdderDialog *'
if (m_pModeless5->Create() == TRUE) // modeldlg.cpp(67) : error C2027: use of undefined type 'СAdderDialog'
// error C2227: left of '->Create' must point to class/struct/union/generic type
GetDlgItem(IDOK)->EnableWindow(FALSE);
}
else
m_pModeless5->SetActiveWindow(); // error C2027: use of undefined type 'СAdderDialog'
}
|
|
|
|
|
Have you considered including the header wherein CAdderDialog is declared?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
For language teaching a student hears a word and then repeats it.
That gives me two wave-files, the first is my own, the second the one recorded by the student.
That one will probably start end end with noise, of which I don't know the amplitude.
The noise may also contain peaks (dropping a pen on the desk).
I can't determine the exact start and end of the spoken word because of possible peaks
and because the word may start and end 'under' the noise level.
I must compare the two waves, which are in two short-int arrays, to see if the student
pronounced the word correctly, based on rhithm, pitch and stress.
So, 'rotor' in reply to 'motor' would be correct, but 'rotter' would not.
Comparing the content of the waves doesn't work, so now I am wondering if using FFT
might be the solution. I have tried WaveInFFT, processing the two arrays the same way and
dispaying them in the same way, but do not see a resemblance between the two graphs.
I hope someone can point me in the right direction.
Ronald Wilmink (Netherlands)
modified on Friday, April 10, 2009 9:32 AM
|
|
|
|
|
Hi All,
Can anyone tell me how to get model number, serial number,temperature and other S.M.A.R.T features of external hard disk drive using MFC.
Thanks
|
|
|
|
|
|
Dear All,
Thanks Hamid for your reply.But I have already tried it out.It doesnot show the serial number or model number.It only shows the type as USB.But i need the details of the hard disk as mentioned in my question.Please do reply if anyone finds any clue how to find it out.
Thanks
|
|
|
|
|
Abinash Mohanty wrote: It doesnot show the serial number or model number.
Which could mean that the mfg. did not provide such information. Do you have proof to the contrary?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Why is the second call mapped to the macro version?
void f() {
puts("func");
}
#define f() puts("macro")
void main()
{
f();
f ();
(f)();
}
Output messages:
macro
macro
func
Press any key to continue . . .
Maxwell Chen
|
|
|
|
|
Possibly because 'irrelevant' blanks are removed by the preprocessor before macro expansion happens?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Maxwell Chen
|
|
|
|
|
Hi All
I have a CListControl and i have use SetExtendedStyle.I have InsertColumn four Column but it's showing five column.Last column is blank.How can i remove last blank column.i use like this.
m_list.SetExtendedStyle(m_list.GetStyle()|LVS_EX_TRACKSELECT);
m_list.InsertColumn(0, _T("Name"),LVCFMT_LEFT, 175);
m_list.InsertColumn(1, _T("Age"),LVCFMT_LEFT, 150);
m_list.InsertColumn(2, _T("Sex"),LVCFMT_LEFT, 150);
m_list.InsertColumn(3, _T("Class"),LVCFMT_LEFT, 150);
Plz help me
|
|
|
|
|
I would change the m_list.GetStyle() to m_list.GetExtendedStyle()
Gr Ronald
|
|
|
|
|
Does it always show one more than is being added?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
No Alwayes show one extra.
|
|
|
|
|
Hi,
I have taken an MDI application and overriden the Childframe's OnCreateClient
if (!m_mdiSplitWnd.CreateStatic(this, 2, 2,WS_CHILD | WS_VISIBLE|AFX_WS_DEFAULT_VIEW ))
{
TRACE0("Failed to CreateStaticSplitter\n");
return FALSE;
}
m_mdiSplitWnd.CreateView(0,0,RUNTIME_CLASS(CMyEditView),CSize(100,100),pContext);
m_mdiSplitWnd.CreateView(0,1,RUNTIME_CLASS(CSpreadSheetview),CSize(100,100),pContext);
m_mdiSplitWnd.CreateView(1,0,RUNTIME_CLASS(CSpreadSheetview),CSize(100,100),pContext);
m_mdiSplitWnd.CreateView(1,1,RUNTIME_CLASS(CSpreadSheetview),CSize(100,100),pContext);
RecalcLayout();
After running the application I am unbale to find a splitter in the childwnd ,hovering my mouse on I could notice the Splitters panes and Spreadsheet Ax Control in one of the views are partially visible.Also I could notice the splitter window is not sized when my childframe is maximized.
What Should I do to make my splitter window clearly visible and also to be resized with respect to childframe?
Thanks
Satya
Today is a gift, that's why it is called the present.
|
|
|
|
|
Hi All,
Good Morning.I am doing one ATL Based VC++ Program. And i want to generate reports using crystal report.This i tried in normal VC++ MFC program but when i tried with ATL Program it is giving error and i created one more ATL program in that i got error like "you can not add ActiveX Control in your project".So i want to know that is it possible to add any activex control to ATL Program or not? If it is possible then how can i do it please give me some hints. Otherwise please tell me anyone how to do reporting in ATL Based program?
Please help me.
Thanks in Advance,
Savitri P
|
|
|
|
|
I'm trying to built a windows app that sits on the system tray and pops up notification messages based on a pre-determined interval. It will be similar to how Yahoo Messanger notifies when someone on the contact list goes online/offline. I've managed to get my app to sit on the system tray, but no idea on the notification messages. Is it a dialog, or is it something else?
|
|
|
|
|
I don't know about notification dialog but you may find some help from ShowBalloon & SetNotificationWnd api of CSystemTray .
Here[^] is one article related to this topic you may find useful.
Do not trust a computer...
Always check what computer is doing
regards,
Divyang Mithaiwala
Software Engineer
|
|
|
|
|
eight wrote: ...but no idea on the notification messages.
See about halfway down this article.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|