|
Hi !!!
In my application,I have created one dialog box which showing preview of the symbol.Now i want to insert this symbol in my Application( Autocad).How can i insert this??
Ie if I will click OK button from Dialog box then symbol (preview)should be insert in the Autocad.??
Thanking you
Shah
|
|
|
|
|
AutoCad[^]? Your application?
Shah Satish wrote: How can i insert this?
Really hard to tell.
I assume that the preview is not the actual object that is to be inserted, but rather a small bitmap or similar just to show the user how it looks.
You have to describe the "symbol". What is it? An OLE object, picture or what?
You have to describe the target as well.
What kind of application is it? What does it mean to "insert" a "symbol"?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Symol is from my file..Like C:\\Symbol\\Exchangers\\Exchanger_1_i.dwg
(here Exchanger_1_i.dwg is the symbol and its Autocad drawing)
This is the preview of the dialog box.
|
|
|
|
|
Ok... This is how I understood you so far:
It is the actual commercial CAD application AutoCad and the "symbol" you want to insert is an AutoCad drawing.
So the question is really about "how do I insert an AutoCad symbol in an AutoCad drawing"?
Man, you really picked the wrong forum for this question... Try AutoCad support.
Actually I don't think this is the case, but if I only read the things you're writing, that would be the only conclusion.
The questions in my previous post was meant to narrow the problem down and trying to understand what you're trying to do and how you're trying to do it. At least try to answer those questions if you still want some help.
Perhaps I cannot help you, I don't know that yet since you haven't described your problem in an understandable way, but there might be someone else that can. They would ask you similar questions however.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Yeh..You got my question correctly..
See my code..
BOOL CDwgPvDLG::OnInitDialog()
{
CDialog::OnInitDialog();
m_mytext.AddString(_T("Exchanger-Double end"));
m_mytext.AddString(_T("Exchanger-Single end"));
m_mytext.AddString(_T("Exchanger-Double end kettle"));
m_mytext.AddString(_T("Exchanger-Single end kettle"));
m_mytext.AddString(_T("Exchanger-Super"));
m_mytext.AddString(_T("Exchanger-Process Flow"));
if (str == _T("")) {
m_mytext.SetCurSel(0);
mydwg = _T("C:\\Symbol\\Exchangers\\Exchanger_1_i.dwg");
}
else{
m_mytext.SelectString(-1,str);
}
this->Invalidate(FALSE);
return TRUE;
}
void CDwgPvDLG::OnPaint()
{
CDwgPreview ::ShowInDialog (mydwg,this,IDC_PVTYP);
CPaintDC dc(this);
}
void CDwgPvDLG::OnselectionchangeList()
{
int nEntry = m_mytext.GetCurSel();
const IndexEntry *pEntry = m_pPermutedIndex->GetIndexTableEntry(nEntry);
this->Invalidate(FALSE);
}
void CDwgPvDLG ::OnOK()
{
CDialog::OnOK();
m_mytext.GetText(m_mytext.GetCurSel(),str);
}
Shah
|
|
|
|
|
In your code, you can probably call your class roughly like this:
CDwgPvDLG m_DwgPv;
if( IDOK == m_DwgPv.DoModal()) {
CString DWGItem = m_DwgPv.str;
//do whatever you want with the string the user did select in the dialog
}
Hope this helps?
Feel free to ask more.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Thanks for reply..But this is code for Calling dialog box..I have alreday call dialog box through command..only step is how to insert file ( for exmple this is my string n now i want to insert ..("C:\\Symbol\\Exchangers\\Exchanger_1_i.dwg")
every thing should be in On ok().. like..
void CDwgPvDLG ::OnOK()
{
CDialog::OnOK();
m_mytext.GetText(m_mytext.GetCurSel(),str);
ads_point point;
acedGetPoint(NULL,(_T("\nPick position : ")),point);
}
|
|
|
|
|
Shah Satish wrote: every thing should be in On ok().. like..
That is bad style. Have the Dialog do one thing (i.e. get a selection from the user) and do the work from where the dialg had been called.
Possibly by opening other dialogs to get the user to answer more specific questions.
Or are you doing a dialog-based application and this is your main dialog?
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Yeh..This is MFC dialog based application and this is only one and main dialog box..
Your method is also good but main thing is How to insert ??
|
|
|
|
|
Shah Satish wrote: Your method is also good but main thing is How to insert ??
I have not the faintest idea of how to handle a dwg-file.
You would need to know the format, read it, parse it, build an internal representation of it and draw that.
Sorry, but I don't think I can help you with that specific problem.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
I am trying to use a well-documented method to subclass across processes in windows (See the following
http://www.codeproject.com/dll/subhook.asp[^]
Specifically, I'm trying to subclass the taskbar so I can grab WM_PAINT messages and control how my app's taskbar button is drawn. Actually, this is cross-platform development, and in modern window systems the windows taskbar is a ToolbarWindow32 in Win98 its a SysTabControl32.
But anyway, the method to subclass is to do a SetWindowsHookEx to the thread of the desktop control using a dll hook procedure (to get into its process address space) and then immediately subclass the control windproc and unhook.
What I encounter is the following:
I can callSetWindowsHookEx for a specific thread, and windows returns OK, but when I try to send a message to the control (in this case SysTabControl32) my hook proc doesn't pick up the message. (I'm using a WH_WNDPROC hook).
Or, I can call SetWindowsHookEx and specify 0 for the thread (thus making it system-wide) and then my hookproc picks up the init msg, but when I try to subclass, SetWindowLong(...GWL_WNDPROC...) returns 0, so the system-wide hook isn't getting me into the desktop control address space.
In any case, the thread-specific hook SHOULD work, and according to windows, the hook is created, but it never picks up my init msg.
Incidentally, this problem I'm encountering is currently under Win98 (don't ask why). But the specific method of subclassing I'm using is supposed to be the most reliable, and valid across all versions of Windows, past and present.
There's some crucial detail I'm forgetting that would enable me to subclass the windows taskbar. Does anybody know what it is?
|
|
|
|
|
K this is really frusterating. All i need to do is place the exact string representation of an int into the edit control. But the problem is that int is not only thing i need to print to the edit control. So what i need help on is how do get the index of a target line from the edit control, and how do i place a char or int in the target line? I read the win32 api at microsofts website, but did not find what i was looking for. Please please help!
|
|
|
|
|
Can you post some example of what exactly do you want to achieve.
Alternatively, you can store the data from the edit control into a char* and then make changes to the string. Later when you are done with this you can update the edit control to show the new string. I hope that I understood you.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I think the following message will help u
EM_SETSEL and EM_REPLACESEL
Select the string that u want to replace using EM_SETSEL. Now replace that with the new text using the EM_REPLACESEL message.
-- modified at 6:43 Tuesday 30th January, 2007
nave
|
|
|
|
|
asp.netProgrammer wrote: All i need to do is place the exact string representation of an int into the edit control.
See this class for that part Convert Integers to Their Textual Description[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Wow, thnkx guys. This really helps. And also, the first response was right, I could also just convert my int to string representation using itoa( int, char*, int radix ). Seriously, u guys saved me from late project, thnkx!
|
|
|
|
|
There's also SetDlgItemInt()
|
|
|
|
|
Hi guys,
I am currently trying to get a MFC-application underway. The whole system is compilable and runs smoothly on any computer with VS2005 Pro and Intel Visual Fortran 9.1.
I am having some trouble debugging, though. The app contains several data structures (see below).
<br />
struct one{<br />
double d11, double d12, double d13, ...};<br />
struct two{<br />
double d21, double d22, double d23, ...};<br />
...<br />
struct main{<br />
one onearray[FIRST_CONSTANT],<br />
two twoarray[SECOND_CONSTANT]...<br />
}<br />
Whenever I try to debug, I can get anything from the onearray, but instead of display twoarray, I get an error CXX0033.
I tried everything that came into my mind, from disabling PCH (a very old cause of this error that should be fixed) to cleaning all intermediate files automatically/by hand and rebuilding the application.
Any suggestions?
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Quick feedback:
Visual Studio with integrated VF seems to be sharing debugging information between the two systems. I found out that there were some fortran records with the same names. As soon as I changed the names of the C-structs from name to name_c, debugging started to work.
Additionally, this only seems to be a problem with structures that are passed along as pointers (e.g. a parameter to a function).
So:
void func(main* myP) is a problem (unable to view myP contents), but void func(main myP) seems to work as expected.
GNARGH!
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Hello all,
My application consists of a few processes spawned at startup using CreateProcess . Each of these processes reads a substantial portion of binary data from disk at startup. The CPU and memory are not very much stressed during that operation, but the hard disk is working very intensely (and loud), and I noticed that a loading time is perhaps even longer than a sum of individual startup times for all processes when they are run standalone.
Would it be reasonable to use a mutex to assure that multiple processes do not load data simulateneously? Or, might you have some other suggestions?
|
|
|
|
|
Bartosz Bien wrote: hard disk is working very intensely (and loud),
Change your hard disk.
|
|
|
|
|
Hi,
Nibu babu thomas wrote: Change your hard disk.
I knew someone would say that!
My question was more coding-oriented, but OK - I was thinking about updating the hardware too. I currently own this disk[^]. It is generally loud, but working well and usually quite fast. What would you suggest as a noticeably faster replacement?
|
|
|
|
|
Bartosz Bien wrote: Would it be reasonable to use a mutex to assure that multiple processes do not load data simulateneously?
I gather that the processes aren't reading the same parts of the file. If that's true, then it's likely that the disk is thrashing because the file isn't in cache, so none of the processes' reads can be satisfied from the cache. Try the mutex and redo your measurements, and see if that helps.
|
|
|
|
|
I would guess that the load times are increased because the drive is having to jump back and forth on the disk to find un-cached data.
Depending on the size of the data, if it is the same data or different data for each process, and the type of reading going on (sequential vs. random), some of the following might work:
1: Use a memory mapped file (MMF) - this eliminates the secondary memory buffer (and possibly "chunking") normally used to read data from disk. Internally, file data is also paged-in in the most efficient manner. Multiple processes can even use the same memory mapped object (if it is named), reducing the overhead of creating and destroying the file object within each object.
2: You can also use a MMF to create a private cache for the file data. You can create a pagefile-based MMF, which is basically a shared memory implementation, copy the file-based data into the MMF's memory, and then share it across all of the processes. While there will be some paging taking place, it should still be much less than that involved for hitting the disk for the pagefile and the on-disk data each time.
3: Regardless of going the MMF route or not, if reading sequentially use the appropriate flags when calling ::CreateFile(...) to improve read performance.
4: If not using a MMF solution, having each process read that file one-at-a-time sequentially from beginning to end, should offer a performance benefit as well.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
how to write program "Auto View CD"
|
|
|
|
|