|
Hi...
how can i get autocad drawing properties?
for example i need to get circle's radius, diameter and x,y points...
If anyone knows please help me.
Thanks...
G.Paulraj
|
|
|
|
|
You can either use ObjectARx or VBA for getting the entities property.
|
|
|
|
|
I want to open a document from the MFC dll.
I am using the below function.
AfxGetApp()->OpenDocumentFile(szlstfile.GetBuffer(0)); ;
It is giving the assert message
But its neither opening the File main application .
szlstfile is the CString object holding the path of filename.
Anybody has idea how to open a Document from any MFC dll .
|
|
|
|
|
PrafullaShirke27 wrote: It is giving the assert message
What says the 'assert message'?
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]
|
|
|
|
|
.
BOOL CMDIChildWnd::Create(LPCTSTR lpszClassName,
LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CMDIFrameWnd* pParentWnd,
CCreateContext* pContext)
{
if (pParentWnd == NULL)
{
CWinThread *pThread = AfxGetThread();
ASSERT(pThread);
CWnd* pMainWnd = pThread->m_pMainWnd;
ASSERT(pMainWnd != NULL);
ASSERT_KINDOF(CMDIFrameWnd, pMainWnd);
pParentWnd = (CMDIFrameWnd*)pMainWnd;
}
|
|
|
|
|
This assert just says that the thread, where you called the function OpenDoc..., has no main wnd.
Is this a multi threaded app or is this your main thread?
Greetings
Covean
|
|
|
|
|
This call is not from MainThread.
|
|
|
|
|
Thats exactly your problem. The easiest way to solve this problem is, that you only
call gui functions from within your thread that created the gui.
In general calling gui functions from within a thread that didn't created the gui is not
a good practice and often causes such problems.
The are ways to do this, but its too long ago, that I developed C++. Maybe somebody
can you explain how to do such calls.
Greetings
Covean
|
|
|
|
|
|
ratprita wrote: An array based employee management system.
a.Should have classes like Manager, Engineer to exploit polymorphic features of C++.
b.Should keep information like name, salary etc. Designation should not be kept as a member. It should be printed polymorphically.
c.Should be a console application
d.Should display a list of options when starting the program. Options are Add, List, Search, Delete and Quit etc and implement those features.
Which one of that exactly are you having trouble with?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
|
ratprita wrote: i need a sample program, which satisfies these conditions.
In other words, you want your homework done? No, we don't do that here.
Point #2 from the guidelines[^]: Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
You may ask your teacher for...
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]
|
|
|
|
|
ratprita wrote: i need a sample program, which satisfies these conditions.
What about writing one, as you are supposed to do ?
|
|
|
|
|
ratprita wrote: a.Should have classes like Manager, Engineer to exploit polymorphic features of C++.
Here ya go:
class Employee
{
};
class Manager : public Employee
{
};
class Engineer : public Employee
{
}; I'll let you fill in the blanks!
"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
|
|
|
|
|
I one of my sample applcaiton,I hav changed the combobox in to Listbox,
After that i got in piece of code.
CAlarmCombo *pSysBox = (CAlarmCombo *)((CMainFrame *)AfxGetMainWnd())->m_SysWnd.GetDlgItem(IDC_SYSALARM);
if(pSysBox)
{
pSysBox->EnableWindow(TRUE);
if( pSysBox->GetCount() < 5 )
pSysBox->AddString((LPCTSTR)RGB(255,0,0));
}
The code is working fine with CComboBox.
The error comes in that bolded line as some USER32.dll unhandled exception.
Anu
|
|
|
|
|
What is the string you're trying to add?
RGB(255, 0, 0) is not a valid string.
pSysBox->AddString(_T("RED")); would be the correct way to do this.
|
|
|
|
|
You are trying to type cast RGB(255, 0, 0) to a string. This casting is wrong. What are you trying to display on the list?
|
|
|
|
|
Anu_Bala wrote: pSysBox->AddString((LPCTSTR)RGB(255,0,0));
What do you want to do?
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]
|
|
|
|
|
Actually it displaying kind of test like
BT001 BTcomments LL
Like this it will print in the COmboBOx.
What i did is..I want ListBox,so replaced the combobox with ListBox,and i use the ID of Combobox in to Listbox.
But with the ComBoBOx it works fine.
The string gets added in function
void CAlarmCombo::DrawItem(LPDRAWITEMSTRUCT lpDIS)
{
.
.
.
CString sAlrm = _T("");
sAlrm.Format("%-16s %-25s %-4s",pTagBase->GetTagName(),pTagBase->GetDescription(),pAlrmDisp->sStatus);
pDC->TextOut(25,lpDIS->rcItem.top + 1,sAlrm)
}
Even i couldnot understand what that AddString() doing.
But how it works perfect in using COmboBox.
Anu
|
|
|
|
|
In the expression
pSysBox->AddString((LPCTSTR)RGB(255,0,0));
You're casting to a const TCHAR * a temporary DWORD value, that plainly makes no sense...
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]
|
|
|
|
|
Anu_Bala wrote: pSysBox->AddString((LPCTSTR)RGB(255,0,0));
The RGB[^] macro returns a COLORREF[^]. You're forcing the compiler away from complaining about this by cleverly casting the COLORREF value to an LPCTSTR .
If you want to add the string as it is, then try
pSysBox->AddString(_T("RGB(255,0,0)"));
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Anu_Bala wrote: CAlarmCombo *pSysBox = (CAlarmCombo *)((CMainFrame *)AfxGetMainWnd())->m_SysWnd.GetDlgItem(IDC_SYSALARM);
What a mess!
Anu_Bala wrote: pSysBox->AddString((LPCTSTR)RGB(255,0,0));
Do you know what an RGB value is? Hint: it can't be converted to a LPCTSTR by casting it.
"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
|
|
|
|
|
How can I create a virtual desktop, where I can show icons of desktop folder and also show a web page as active desktop.
Thanks,
Amit
|
|
|
|
|
What do you mean by a Virtual Desktop?
You can create another desktop using CreateDesktop[^].
|
|
|
|