|
Is there any resource on how to write document on MDI?
|
|
|
|
|
Plenty. A good starting point would be to search for CMultiDocTemplate .
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hello Sir,
I have a application need get image from IE,
I want to implement drag/drop in this file,
for example, I visit a website, got a webpage,
there are some images in this page,
If I need this image, I drag this image to my application,
then my application will show this image.
I have some question about this list at below:
1.what kind of DROPEFFECT I need to return in OnDropOver(...), DROPEFFECT_LINK or DROPEFFECT_COPY?
2.how to show this image in OnDrop()?
Thanks
Vistac
|
|
|
|
|
Hi All,
Does anyone else notice that the Visual Studio .NET "Add Member Function" and "Add Member Variable" wizards insist on adding an extra #include line to the .cpp file? Every time I delete it, but every time I use the wizard it just keeps putting it back.
Example:
Before I use the wizard, these are the only includes:
#include "stdafx.h"
#include "OtherDlg.h"
After I use the wizard, it places the extra one like this:
#include "stdafx.h"
#include "OtherDlg.h"
#include ".\otherdlg.h"
Notice that I already have OtherDlg.h included, but in a different case. I'm wondering if anyone else experiences this, because it does it for me *every* time! Does anyone know what's going on and how to fix it?
Thanks!
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
|
Hi!
Can anyone tell me why in all old functions like my GetYrkeKategoriPtr() the tooltip 'CDatabase *CRecordset::m_pDatabase' are shown when cursor is over the variable m_pDatabase, but in all my newly added function like GetSystemPtr() it is not shown?
CRSAYrkeKategori* CSysDoc::GetYrkeKategoriPtr()
{
m_YrkeKatSet.m_pDatabase = GetDeDUDB();
return &m_YrkeKatSet;
}
CRSASystem* CSysDoc::GetSystemPtr()
{
m_SystemSet.m_pDatabase = GetDeDUDB();
return &m_SystemSet;
}
MSc Bertil Morefält
|
|
|
|
|
I need to convert delta time to SMTPE offset time. How can i calculate it?
The TimeSignature is:
Numerator = 2;
Denominator = 4;
MidiClocksPerClick = 24;
NumberOfNotated32nds = 8;
I have delta-time for every message but i only can runnnig the segment in a time based generator, this of course, cause some slow and fast play notes in a random sequence (i compare the elapsed time with the delta time in every callback )
I search over all inet but i wasn't be able to find what im looking for.
|
|
|
|
|
when i call the following macro
ListView_DeleteAllItems(HWND hwnd);
all the items are delete, fine with that.
now i have allocated some memory in lparam in LVITEM
i want to release that.
How do i do that, I know there is an event that is called when similar things is done with tree view.
what is that event for Listview. I could not find it.
this is a cause for major memory leak as this operaion is done several times
Thanx in advance.
Last time I was sober, man I felt bad
Worst hangover that I ever had
It took six hamburgers and scotch all night
Nicotine for breakfast just to put me right.... Dire Straits
|
|
|
|
|
You have to iterate through each item, call GetItemData() , and delete the pointer. After that, you can call ListView_DeleteAllItems() .
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
For individual items, the List View's parent can also handle WM_NOTIFY with LVN_DELETEITEM.
For DeleteAllItems, you get sent LVN_DELETEALLITEMS, and if you return FALSE, you'll get an LVN_DELETEITEM for each item as it's deleted. If you return TRUE, that suppresses the individual delete notifications. (This is only for the batch that will be deleted).
If you adopt David's approach (which works perfectly well), you can improve performance by suppressing the individual delete notifications, as you no longer need them.
Steve S
|
|
|
|
|
Steve S wrote:
If you adopt David's approach (which works perfectly well), you can improve performance by suppressing the individual delete notifications, as you no longer need them.
But if the LVN_DELETEITEM notification is suppressed, won't that still result in a memory leak?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Perhaps you need to read your own post (but then, it is Friday)
If you've already iterated over and deleted, then the additional notifications are a waste of time, so you should suppress them, but you don't have to.
However, if you don't iterate, then catching the individual notifications is the best way to do it, and delete a bit at a time.
Alternatively, you could have all the items (and only the items!) in a private heap, catch the message for delete all, and just destroy the heap for the ultimate performance improvement
Steve S
|
|
|
|
|
Is there an event which fires when a checkbox (CListCtrl) has been clicked? I don't want to check each item iteratively and check for it's checkbox being checked...but it looks like I am oging to have to
Also is there a way I can replace the checkbox with a custom icon checkbox?
Thanks again
Cheers
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
One solution is to handle the LVN_ITEMCHANGED message.
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
// No change
if (pNMListView->uOldState == 0 && pNMListView->uNewState == 0)
...
BOOL bOldState = (((pNMListView->uOldState &
LVIS_STATEIMAGEMASK) >> 12) - 1);
// Initial startup - dialog window initialization
if (bOldState < 0)
...
// New checkbox state
BOOL bStatus = (((pNMListView->uNewState & LVIS_STATEIMAGEMASK) >> 12) - 1);
// Unchecked
if (bStatus < 0)
...
// No change
if (bOldState == bStatus)
...
You got the idea?
Kuphryn
|
|
|
|
|
Very clever
Thanks, I never would have thought of using that approach
Cheers
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
Handle the item changed message and call CListCtrl::GetCheck()
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi !
Sorry, this is not really a C++ question, but, for my application, I need to create a batch file which would perform something on all cpp files in my current directory.
I would have to do something like this :
DoSomething filename.cpp filename.usf
Where DoSomething is a command which will take the given cpp file and generate a usf file with the same name as the cpp file (only the extension will change).
How can I do a batch to automatically do this on all cpp files (*.cpp) ?
Thank you for your help !
Jerome
|
|
|
|
|
FILE1.BAT:
for %%x in (*.cpp) do FILE2.BAT %%x
FILE2.BAT
DoSomething %1
Or if you just want one file:
FILE1.BAT:
for %%x in (*.cpp) do call :DO_IT %%x
exit
:DO_IT
DoSomething %1
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
For batch files that need to manipulate filenames like that, I use 4DOS/4NT[^] - writing batch files with it is way easier.
cdd "%1"<br />
for /a:-d %a in (*.cpp) DoSomething "%a" "%@name[%a].usf"
Run it with the directory name as the parameter
--Mike--
Personal stuff:: Ericahist Updated Feb 6! | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Michael Dunn wrote:
--Mike--
Personal stuff:: Ericahist Updated Feb 6! | Homepage
who is the woman in the link ericahist????sure she is pretty
is she ur wife/gf???? Hope you dont mind asking that question.
Last time I was sober, man I felt bad
Worst hangover that I ever had
It took six hamburgers and scotch all night
Nicotine for breakfast just to put me right.... Dire Straits
|
|
|
|
|
|
Oh ok. I dont get .NET show here in India.
Last time I was sober, man I felt bad
Worst hangover that I ever had
It took six hamburgers and scotch all night
Nicotine for breakfast just to put me right.... Dire Straits
|
|
|
|
|
You know the ones used for tree controls???
Are they just 16x16 icons? Can I get those icons from the system tray or do I have to add my own icons?
thanks
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
They are 16x16 bitmaps. Windows does not provide a standard set that you can use from memory so you need to supply your own. On XP you may be able to use the Theme functions to get it to draw them for you.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Hi,
I am trying some code similar to what I have posted below, but it is not being compiled on the VC++ 7.0 and on VC++ 6.0 it gives a INTERNAL_COMPILER_ERROR :
#include <list>
...
template <class clDataType>
class CMyData
{
clDataType myObj;
unsigned long myObjSize;
public:
...
};
template <class clDataType>
class CMyManager
{
unsigned int nIndex;
clDataType myData;
list<CMyData<clDataType>> myList;
public:
...
};
What I am trying is to have a STL list of CMyData<clDataType>!
Is it possible or am I doing some mistake?!
Thanks,
Rgds,
Nirav
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
Your problem is this line:
list<CMyData<clDataType>> myList;
due to the lexical analysis of C++ it has to be written as this:
list<CMyData<clDataType> > myList;
as such the space is crucial. The >> is parsed as right-shift, even though it makes little sense in that context (also is why it causes an error).
Hope that helps.
--
Henrik Stuart (http://www.unprompted.com/hstuart/)
|
|
|
|