|
Hi
I succesfully added new storage into MSWord compound file (and new stream inside this new storage), but the problem is that when I open this doc in MSWord, made some change and save doc, my storage and stream dissapears. I saw application that adds stream(in root storage) which is "word saving proof" but I don't know how to do this. I also encountered strange thing: when I have word doc with stream added by this application, storage and stream added by me doesn't dissapear. I don't know why this happens. Anyone have some idea how to prevent new streams and storages from deleting by Word? Thanks in advance for any hints.
Greetings
Mariusz Popiolek
|
|
|
|
|
How do I extract file/path name from the HDROP passed from WM_DROPFILES??? Couldn't find anything here or MSDN
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
MSDN:
Drag-and-Drop Operations
To support a drag-and-drop operation in a rich edit control, an application must first set an event mask by using the EM_SETEVENTMASK message to allow the EN_DROPFILES notification to be sent to the control's parent window. In the RICHED sample, when the parent window receives this notification, the DragQueryFile function is called to determine how many files have been dropped in the rich edit control. This sample allows the user to drop only one file at a time, so if more than one file has been dropped, the action is disallowed. If the user has dropped only one file, the application queries for the filename, opens the file, and reads it into the rich edit control. As you can see in the following code, the sample allows the user to drop only a TXT or an RTF file:
case WM_NOTIFY:
§
// Is the notification a drop notification?
else if (((LPNMHDR)lParam)->code == EN_DROPFILES)
{
WORD cFiles;
char lpszFile [80];
HANDLE hDrop;
// Get the handle to the drop object.
hDrop = ((ENDROPFILES *)lParam)->hDrop;
// Determine how many objects have been dropped.
cFiles = DragQueryFile (hDrop, 0xFFFF, (LPSTR)NULL, 0);
// If more than one object has been dropped, don't bother.
if (cFiles > 1)
return 0;
// Get the name of the file dropped.
DragQueryFile (hDrop, 0, lpszFile, sizeof (lpszFile));
// Open the file (TXT or RTF).
if (strstr (lpszFile, "TXT"))
OpenTheFile (hWndRichEdit, SF_TEXT, lpszFile);
else if (strstr (lpszFile, "RTF"))
OpenTheFile (hWndRichEdit, SF_RTF, lpszFile);
DragFinish (hDrop);
return 1;
}
return 0L;
break;
This code demonstrates one way that an application can handle a drop operation. Rich edit controls also support OLE drag and drop through the IRichEditOle and IRichEditOleCallback interfaces, which allow objects to be embedded in the control. The subject of embedding objects is beyond the scope of this book, however, so I will not cover it here.
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
Nitron wrote:
Couldn't find anything here or MSDN
Hmm, my MSDN (April 2000) says this:
hDrop
Handle to an internal structure describing the dropped files. Pass this handle DragFinish , DragQueryFile , or DragQueryPoint to retrieve information about the dropped files.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I guess I was just looking for something like
hDrop.lpzFileName
Didn't relize I had to read...
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
I want to use CListCtrl's SortItem function. MSDN says there needs to be a comparison function which has to be:
The comparison function must be either a static member of a class or a stand alone function that is not a member of any class.
1. How do I make a static function of a class?
2. If it were a standalone function, I'd declare it in the .h file before the class definition (correct?). Would that be sufficient? Or do I have to specify the prototype in the cpp file before I use it?
Appreciate your help,
ns
|
|
|
|
|
in a .h
class MyClass
{
public:
static int MyFunction(whatever);
};
and then in a .cpp, you implement the function. this function cannot access any non-static member variables of the class.
-c
No matter how fast light travels it finds the darkness has always got there first, and is waiting for it.
-- Terry Pratchett,
|
|
|
|
|
Where is this line supposed to be, from MSDN. In which file is it supposed to be? In the cpp file? If so, in the constructor?
<code>float SavingsAccount::currentRate = 0.00154;</code>
currentRate is a static member variable(declared in the .h file).
Appreciate your help,
ns
|
|
|
|
|
ns wrote:
Where is this line supposed to be,
In the class's .cpp file (theoretically it could be in any .cpp file but the obvious place is that of the class), outside the constructor. It's just a variable initialization.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
I'm trying to automated power point 2002... I have my own activeX, it Power Point 2002, I can activate it just by pressing double click ( then my ActiveX is up and running...).
BUT... in Power Point 2002, I have to go to Slide Show Mode to do that !!!!, is there anyway to activate it in the normal view ?
Thanks, so long
Braulio
|
|
|
|
|
http://www.codeproject.com/com/OLE_Automation.asp
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
Sorry but..
Ms Word and Excel models for automation are not that bad, but things like Power Point, or Outlook, are hell !, just give try to detect when really Power Point has been closed ( yeah you will found a sink, but that sink is just executed right before the message that ask you to cancel or save, so...)...
So long
Braulio
|
|
|
|
|
Hi,all,
About the animal's simulation project, i have another problem to
ask. That is,Whether there is any one who can provide a source code, which can be used for generating a specail terrai manually. Of cause 3D is best, but at first step if a 2D contour map can be displayed, that is enough.
thanks a lot!!!
wang
|
|
|
|
|
|
This is a so very good shameless plug, your product looks very cool indeed !!!
Max.
|
|
|
|
|
Thank you very much, you just made my day.
Chris Richardson
|
|
|
|
|
One might also display that Free Software alternatives exists.
Also, googling for "free terrain generator GPL" might turn up some more interesting code (replace GPL with whatever license you fancy).
|
|
|
|
|
Yes, I could display that free software alternatives exist, but (A) I didn't feel like searching for it, and (B) my link was put inside < shameless plug > tags. Plus, most free software doesn't come with support, a lot of it can't be used for commercial work, etc.
Chris Richardson
|
|
|
|
|
The derived class has a deleteAllItems, so does the parent class (CListCtrl). I want to invoke the base function directly with a control variable of the derived class. Instead of
m_list1.DeleteAllItems() which is the derived class definition,
I want to call the listctrls base function: Is it possible to do that?
Appreciate your help,
ns
|
|
|
|
|
You could Cast into a base-Object:
CListCtrl* pListC = &MyDerivedListCtrl;
pListC->DeleteAllItems();
|
|
|
|
|
Thanks!
Appreciate your help,
ns
|
|
|
|
|
That would not work, if DeleteAllItems() is a virtual function. The syntax for explicitly calling a base member function is:
MyDerivedListControl.CListCtrl::DeleteAllItems();
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
hi all
how can we load a bitmap image in to a button control ,
which can change the background with the color of dialog/button control (changing the schemes through properties>>appearance tag)..
any idea..??
Regards
Renjith
A Programmer Never Dies...
|
|
|
|
|
no answer..??????????????????
A Programmer Never Dies...
|
|
|
|