|
create three different custom window-class and create those window on the main window when required
|
|
|
|
|
Unless you absolutely have to have ONLY 3 views why don't you use standard CSplitter CreateStatic and create CSplitter frame with 4 views?
Than let the MFC do the dirty work. No need to customize anything.
|
|
|
|
|
Thanks. I managed to do the 3 views splitter windows.
|
|
|
|
|
Great, can you share the basic idea / code?
I was thinking 1 column / 3 rows would also work if it is acceptable.
|
|
|
|
|
I just got the idea from this article:
http://www.codeproject.com/Articles/190/A-Visual-Framework-Views-Tabs-and-Splitters
Basically I just wrote this in the MainFrame:
m_wndSplitterHor.CreateStatic(this, 2, 1)
m_wndSplitterHor.CreateView(0, 0, RUNTIME_CLASS(CSampleCollectList), CSize(280,300), pContext) m_wndSplitterHor.SetColumnInfo(0, 200, 0);
m_wndSplitterVer.CreateStatic(&m_wndSplitterHor, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitterHor.IdFromRowCol(1, 0))
m_wndSplitterVer.CreateView(0, 0, RUNTIME_CLASS(CSampleTree), CSize(250,0), pContext) m_wndSplitterVer.CreateView(0, 1, RUNTIME_CLASS(CSampleCollectList), CSize(250,0), pContext)
But now im stuck with tab control in View 3. Any idea?
|
|
|
|
|
Inherit your application view class from CFormView. This enables you to have controls on the view just like you would have on a dialog. For your usage I think this is suitable and it saves time. Check for online samples too...
Sunil
|
|
|
|
|
Dear all,
I have a question about how to hook HW interrupt in flat memory mode...Maybe you can give me some directions...
@ about my application...
- created by combining Watcom C and DOS32/A.
- written for running on DOS mode( not on OS mode )
- with DOS32/A now I can access >1M memory and allocate large memory to use...(running in flat memory mode !!!)
@ current issue...
- I want to write an ISR(interrupt service routine) for one PCI card. Thus I need to "hook" the HW interrupt to test...
- For example, the PCI card's interrupt line(0x3C) = 0xE in DOS mode. That means this device will issue interrupt via 8259's IRQ 14.
But... I did not how to achieve my goal to hook this interrupt in "flat mode" ?
@ reference I found...
- in watcom C's library doc, there is one sample using _dos_getvect, _dos_setvect, and _chain_intr to hook INT 0x1C...I tested this code and found OK.
But when I apply it to my case: INT76 ( where IRQ 14 is "INT 0x76" due to (14-8) + 0x70 )then nothing happened...
* I have checked HW interrupt is truly generated but my own ISR did NOT invoked...
Do I lose something ? or are there any functions I can use (in DOS32/A) to achieve my goal ?
|
|
|
|
|
Wow - there's a blast from the past.
With your sample app that hooks INT 0x1C, was that also running in flat-mode?
That is to say - the 80x86 family run in two modes - one that has a flat address-space and the other that has segmented memory space.
When in segmented mode (DOS) there's a table that holds the address of all of the ISRs. To hook an interrupt, you simply grab the table entry you want then overwrite it with the address of your own routine. Inside your routine you do what you need, calling the original routine before, after your code or not at all. When you want to remove the hook, you simply re-write the table entry.
While in protected mode (win,linux,dos4gw/dos32a) memory is arranged quite differently. You don't have a globally accessable place that you can just read and write in quite the same way. You have the beasts known as Interrupt Descriptor Table.
I spent a long time 15 years ago trying to roll-my-own code that would enter protected mode. I've got vague memories of having trouble wrapping my head around the IDT & GDT.
What I'm getting at, is that I can't be sure that the functions you're calling are intended for flat-mode. If the ISR is running in flat-mode, you can't even address it in the 4 bytes that each entry has in a real-mode IDT.
I also don't quite follow the formula you've used to come up with int 0x76
Anyway, here's a page on IDTs and the differences between real/protected mode.
http://en.wikipedia.org/wiki/Interrupt_descriptor_table[^]
You know what I'd probably be doing? Downloading the source-code for some old games that used the dos4g/w extended and looking there for some hints. You should find something in either the timing or the sound code. The one that immediately comes to mind is Doom. Don't remember if Duke Nukem 3d was too I beleive Rise Of The Triad - ROTT used the watcom compiler. A lot of games by iD, Apogee & 3dRealms of the era used the extender.
Good luck & thanks for the read & memories.
|
|
|
|
|
My app runs at "flat memory mode" in DOS(by DOS extender -DOS/32A). I added the sample code to hook INT 0x1C in my app then found OK ! Thus that code should be running in flat mode ^_^
Another example demonstrating if app is in flat mode maybe: if allocating memory on this mode, get the offset address of this pointer then I got 4-byte address ! ( If in real mode, the offset address will be 2byte because real mode is SEG:OFF format...)
As you said memory is arranged quite differently with dos extender BUT I think there must be handy APIs provided by DOS/32A to achieve this goal because it is a common demand...
And 0x76 comes in below statement:
"DOS/32 Advanced will install real mode IRQ callbacks for all 16 hardware interrupts (IRQ 0-7, IRQ 8-15 = INT 08-0Fh, INT 70-77h)"
Because my device use IRQ14 thus (14-8)+0x70 = 0x76 and it is the interrupt number CPU got to calculate the entry of ISR !
|
|
|
|
|
|
Thanks in advance... I will try it !
But...does it work ?
Does anybody successfully use these 2 to hook HW interrupt ?
|
|
|
|
|
Here's some wonderful reading.
[Interrupt Service Routines]
[he WATCOM C/C++ Programmer's FAQ]
[finding a device on the PCI bus]
[PCI Device access under 32-Bit PM DOS]
there are 2 ways of finding a PCI device on the bus. You can either use the PCI BIOS interface call, or direct hardware I/O.
Here's the BIOS way:
INTEL_VENDOR_ID EQU 8086h ; intel's unique sig #
INTEL_EXP_NIC EQU 1227h ; sample PCI device etherexpress 10/100 NIC
.386
mov ax, 0b102h ; interrupt 1a function b102
mov dx, INTEL_VENDOR_ID
mov cx, INTEL_EXP_NIC
xor si, si ; 0=1st device, 1=2nd etc.
int 1ah
jc nope
; once returned from this call, BH=bus number, BL=device/function #
nope:
|
|
|
|
|
Thanks for your information first...
But what I want is to "replace" the ISR for specific HW interrupt in flat mode, not retrieving PCI device in protected mode !
|
|
|
|
|
How to spacify the width of a string in 'scanf_s' ?
I feel hard, since the width of the string in the input file is not fixed varying from 50 character to 120, so how to specify the buffer size.
I used 'scanf' to read input, I do not need to specify the length of the string.
Please advise.
Thanks
|
|
|
|
|
mrby123 wrote: How to spacify the width of a string in 'scanf_s' ?
Like this[^]...
mrby123 wrote: I feel hard, since the width of the string in the input file is not fixed varying from 50 character to 120, so how to specify the buffer size.
If the size varies, you have to specify the maximum size, the smaller string will fit just fine in the larger strings array.
mrby123 wrote: I used 'scanf' to read input, I do not need to specify the length of the string.
Yes, but this was a frequent cause of crashes due to buffer overflows, you don't HAVE to use scanf_s, if the previous version worked just fine for you, you can disable the warning with a pragma comment.
|
|
|
|
|
mrby123 wrote: I feel hard, since the width of the string in the input file is not fixed varying from 50 character to 120, so how to specify the buffer size.
You have to use a buffer at least equal to the maximum string length of the input file (hence at least 120 characters long) and specify the size of your buffer (that is 120 ) in the scanf_s call.
Veni, vidi, vici.
|
|
|
|
|
Hi,
i am stuck with a problem while working with Windows CE 5.0 on handheld device.I am using Embedded VC++(eVC++) with programming in C++(MFC).
i want to set the value "Never" to a Switch state to Suspend dropdown programmatically.
This dropdown is located in settings>>Power properties.
modified 24-Jul-12 1:19am.
|
|
|
|
|
I do not think you can modify system options in this way.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
okk...i am also trying to find some other way
bt while i was searching i found that i need to set ACSuspend value to 0 in registry
i found that from msdn link
http://msdn.microsoft.com/en-us/library/aa447563[^]
now i have to search how to programmatically edit the registry value(ie ACSuspend value)
btw thnx for your precious time....
if u find something instresting plz do keep me posted
|
|
|
|
|
You will need to use the Registry functions[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
yep....Cool
now i think my search ends here and coding starts
thnx once agn...
|
|
|
|
|
Hi,everyone,Can i use vc++6.0 with aforge(from aforgenet.com)? i see there are framework in aforget,so i am not sure if it is possible to use vc6.0 and aforge together?looking forwards to reply,thanks.
|
|
|
|
|
frank23231534 wrote: ,Can i use vc++6.0 with aforge Judging by the first sentence here[^] it would appear that you cannot. Can you upgrade to a later version that supports C++/CLI?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi All
I implemented a multi touch application. I follow MSDN tutorial using manipulation interface, here:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd371408(v=vs.85).aspx[^]
But I have many problems when panning or zooming, is not redrawing and glitches in scrren. I need to limit my CView and do panning when screen is bigger than CFrameWnd, because CFramewnd does not redraw. I don't know how to get frame size and limit CView to don't pass CFrameWnd size. I tried an anchor or dock window but did not work.
Please, I need any help.
Thank you.
|
|
|
|
|
Dansveen wrote: I don't know how to get frame size The GetClientRect() [^] and GetWindowRect() [^] functions may be what you need.
One of these days I'm going to think of a really clever signature.
|
|
|
|