|
If you mean an MFC SDI application, you can't.
The SDI architecture has only one document, and it never closes. However, when you choose "File->New" (or in your case on a button click) the CDocument::ResetContent function is called.
You could handle that function in your document class as reset all your variables to their initial state, release any memory that you have allocated and such, essentially ending up with a new, empty document.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
meaning i can only make it that when i click on a button, the whole layout can be changed but not pop up a new document?
|
|
|
|
|
Not sure what you mean "pop up a new document". The document is a behind the scenes container for your data - it is not visible. You see the data in the document in your View - that's the visible part.
In SDI you can only have one document, but you can have more than one view of the document. You can search for how to create different views and switch between them - that may be what you're looking for.
Good luck.
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I am woking on Real Time Data Acquisition and have to use Direct Memory Access, but have no idea how to do this in VC++/MFC. pliz guide me.
Girish
|
|
|
|
|
If you're using a data acquisition board, see if the manufacturer has a SDK...
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
It is almost certain that the manufacturer-provided drivers will implement DMA (assuming the board is capable of DMA of course.) The manufacturer wants his board to be as fast as possible.
So if you use the drivers to tell the board to get a few thousand samples into memory, the board's DMA controller will probably be used.
|
|
|
|
|
Hi,
I have a static library which is linked with a DLL, and I want to export the symbols from the DLL as well as the symbols in the static library so that the user of the library sees it as just a DLL with exported symbols.
Need for such a case:
I have to build a project in VC7 i.e VS .NET 2003. The target of the project is a DLL. The code is organized in small modules. Thus I want that these small modules get built separately and then when the main project builds, then all the modules get linked in and symbols properly exported in one .lib file and thus one single dll rather then having multiple lib files and multiple dlls.
I don't know how to do that in VS .NET
Thanks in advance,
any comments and suggestions are welcome,
Divick
|
|
|
|
|
Are there any limitations for using bitmaps on toolbar buttons?
On my main dialog window I have a toolbar with maybe 10 buttons, the bitmaps are loaded from a normal bitmap strip, each button 15x16, 4-bit color. This is displayed with no problems.
I have now added a toolbar to a child window, this time with bigger button (21x21), I have created it exactly the same way as the first. But the bitmaps are not being displayed correctly. White pixels are displayed as black, Black is displayed as gray, Green is transparent....
It's showing all the characteristics of picking the wrong color from the bitmaps color table. I first thought it was monochrome, but editing the bitmap proved me wrong. The only correctly displayed color is Blue, and I don't even want blue!!!
Any ideas????
|
|
|
|
|
|
Thaks for the reply, however I managed to fix it myself.
I was loading the bitmap from a resource file by passing the ID to the CreateToolbarEx() function. For some reason it wasn't being loaded correctly. Loading it myself with CreateMappedBitmap() solved the problem.
|
|
|
|
|
Hi waldermort,
This is a suggestion.
You can to make the function that create a bitmap file
then you can draw your bitmap on the created file.
Example:
I have 5 bitmapfile in the resource or disk
for 1 to n
BmpFile is CBitmap
BmpFile.Load-->From Resource
else
or you can create bitmap and return hBitmap that BmpFile.Attach(hBitmap)
then
img->Add(&BmpFile2,RGB(155,155,155));
m_wndToolBar.GetToolBarCtrl().SetImageList(img);
BmpFile.Detach
|
|
|
|
|
Hello,
Mine is an MDI application in MFC, in which I want to get all the child windows in which I have kept documents open, their sizes, positions etc. How can I get them?
Thank you,
warm regards,
Software Developer
Sanjay Khapre
|
|
|
|
|
yes,by
CWinApp::GetFirstDocTemplatePosition()
and
CWinApp::GetNextDocTemplate()
to enum all of them
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
I use a CListCtrl object that, by default, should display Item No. 0 as selected. The Item ist displayed with a light grey background, when I click on an item is is displayed with a much darker background. How can I change the light grey to dark grey ?
m_Companies.SetItemState( 0, LVIS_SELECTED, <br />
LVIS_SELECTED | LVIS_FOCUSED);<br />
m_Companies.EnsureVisible( 0, FALSE);
|
|
|
|
|
if the item gets light gray but not dark gray, it means CListCtrl doesn't get focus.
use:
myList.SetFocus() to set focus on the CListCtrl.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Hi,
I'm writing apps on Handheld PCs and Pocket PC systems ...
In eVC++ 4.0 I was abale to write apps for all platform of WinCE ..
But it seems that VC++ 2005 only can compile for PPC 2003 !
Is it right ?!
I've already installed WinCE Standard SDK 4.0, 4.2, PPC 2003 SDK on my system ..
But VS 2005 just can me project for PPC 2003 SDK ! What's problem ?!
( anyway, i need to write app for WinCE 4.0 HandHeld PC, should i back to eVC++ 4.0 ?! )
Regards,
Hadi
|
|
|
|
|
Hello friends
I have developed a dialog based MFC application in which I did not show any dialog. My application show an icon in system tray only. Also my application runs on Windows 2000 Professional.
But when I open Task Manager it shows my application in process list as "myapp.exe"
I want to hide that from Task Manager.
Also I don't want to use any extra DLL file to do it.
How to do that?
Thankx in advance
Mahesh
|
|
|
|
|
Under windows 98 or earlier, a service will not be shown in Taskmanager by default. But under Windows 2000 or Above it is not possible to hide your process from taskmanager. It will be shown.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
I need to find applications installed on Windows XP. Using HKEY_LOCAL_MACHINE\...\Uninstall does not work for the Office software (Word, Excel, Access...), unfortunately.
Does anybody know how to get such a list of applications like to be seen in the "Installed Apps Enumerator" Dialogbox of XP ?
I'd appreciate any code snippet in C/C++ which could help
Best regards
Gerhard
-- modified at 6:19 Tuesday 21st March, 2006
|
|
|
|
|
windows keeps the list of installed application in that uninstall key that you mentioned and also in the MSI database.
You will have to query the MSI database for installed applications
look here[^] for more info
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
HKCR\Applications
Nibu thomas
Software Developer
|
|
|
|
|
Not correct.
what if i install a toolbar or bho which only has a dll file? Then there will be no entry in HKCR\Aplications, correct way is to query the msi database.
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Hi all,
I am new to Windows Programming. i need some help regarding the listview control.
Can anyone tell me how to make subitems of list view editable using ATL/WTL?
i have seen some MFC articles,but found it hard to make use of them
|
|
|
|
|
Hi comunity,
With the VS2003 C++ compiler option /RTC1 writing:
char sz [ 5 ];
strcpy ( sz, "Hello World" );
I can produce the following error messagebox
Debug Error!
Program: c:\DbgTest\debug\DbgTest.exe
Module: c:\DbgTest\debug\DbgTest.exe
File: c:\DbgTest\DbgTest.cpp
Line: 92
Run-Time Check Failure #2 - Stack around variable 'sz' was corrupted.
On my developing machine it works fine. On other machines, VS2003 not installed,
Filename and Linenumber are missing. I use C:\DbgTest with relative subdir.
Everything is copied, pdb, idb, etc.. Help would be great.
Mattens
|
|
|
|
|
hey mattens, what is your question ??
the only thing i see is that the code is obviously wrong because you write a 12 chars wide string in a 5 chars array, but it seems that you already know that. so, what is your question ?
|
|
|
|