|
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"
|
|
|
|
|
First think about the logic and what your requirement really is and then ask specific questions that relate to some problem...
It's already mentioned in Forum rules:
2. 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.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Do you wan to show autocad files?
|
|
|
|
|
hoa_nguyen wrote: how to write program "Auto View CD"
Very carefully.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: > how to write program "Auto View CD"
Very carefully.
Bah! I say extreme programming! Type what springs to your mind and then refactor!
"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.
|
|
|
|
|
|
are you talking about "autorun" ?
|
|
|
|
|
Hello,
i like to set my own cursor during selection in grid, something like hourglass or other,
what i have to do?
For that i make my own as "mycursor.gif" file and included it in my project as resource!
What function is to use, LoadCursorFromFile() or something else?
thanks
break;
|
|
|
|
|
See SetCursor():
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|