|
i've read that, in general, this is a mathematically "non-trivial" algorithm.
i was looking for code to do this a few months ago. i didn't find anything... again.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Woh, that was a fast reply
i've read that, in general, this is a mathematically "non-trivial" algorithm.
Yes, that's right, but I hope there are some theoretical computer scientists hanging around at this forum, who have written their dissertation about this topic
Best regards,
Thomas
I am a signature virus!
Help me spread and copy me to your sig!
|
|
|
|
|
Hi Thomas,
This is an area of some interest to me as well. I have spent quite a bit of time looking for packages to do this with limited success.
See my post in the Lounge: "Flowchart/Diagram libraries" 25 Dec 00
I've found a few other packages since then. Let me know if you would like the details.
Please let me know if you find anything.
Neville Franks, Author of ED for Windows
www.getsoft.com
|
|
|
|
|
I am looking for any helpful source code on how to implement Docking windows, Splitter-windows and an Explorer-like tree view in plain C, not C++ and not MFC.
I think we can figure out how to display an Explorer-like view of a drive using plain C, but I don't have a clue where to even begin with Docking windows and Splitter windows.
Thank you.
Ted Green
ted@vedit.com
|
|
|
|
|
I don't have any code but I can tell you were to start.
Explorer's tree view uses the treeview common control which does not use MFC and can be used from C. Lookup the API function FindFirstFile for information on how to traverse directories.
Docking windows and splitter windows use the same type of system. The main window controls the child windows size and location. One of the child windows, the view, is where the data is drawn.
When docking windows are used the view window's size and location is changed by the main frame to allow other child windows to be positioned around it. When the docked window is clicked on and the cursor is dragged and released it tells its parent window that it needs space at its new position. The parent window resizes the view. (See Illus. 2.)
When a splitter window is used one parent window controls the position of two or more view windows. In Windows Explorer the parent window is the main frame. (See Illus. 3.) When the parent window detects when the cursor pass over it the parent window changes the cursor to the splitter cursor. When the button is pressed and the cursor moved the parent window resizes its child windows (views) based on the cursor's new location. A way to see this behavior is to use the spy tool on Windows Explorer.
Illustrations
1) Application window without toolbars.
+---------------------+ <-- Main frame
|Title |
+---------------------+
|File Edit Help |
|+-------------------+| <-- View window takes
|| || up the Main frame's
|| || GetClientRect().
|| ||
|| ||
|| ||
|+-------------------+|
+---------------------+
2) Notice how the view window size has been
decreased by the toolbar.
+---------------------+ <-- Main frame
|Title |
+---------------------+
|File Edit Help |
|+--------+ | <-- Docking window
|| | | (toolbar)
|+--------+ |
|+-------------------+| <-- View window
|| ||
|| ||
|+-------------------+|
+---------------------+
3) Like Windows Explorer, the main frame will
act as the splitter. For more complex
designs a child window can handle the
splitter logic.
+---------------------+ <-- Main frame
|Title |
+---------------------+
|File Edit Help |
|+----+ +------------+| <-- Two view windows
|| | | || Explorer uses a
|| | | || treeview and
|| | | || listview control.
|| | | ||
|| | | ||
|+----+ +------------+|
+---------------------+
^
|
The main frame detects mouse movement over
the space between the views.
Hope that helps.
|
|
|
|
|
Thank you for the prompt reply.
I understand the basics and have programmed windows such as toolbars (before the common control in Win32), rulers, MDI, etc. Its all the "details" that are so time consuming.
1. Explorer tree view - I'm sure that I am not the first person writing an "explorer" in plain C. Its all the details of determining which drives are available, etc. that take time. However, I don't see any stumbling blocks; just would be nice if I could find complete sample code. The "chicoapp" example on MSDN and the FileTree example on codeproject.com are very useful.
2. Docking Windows - Details include the subtle ways that the mainframe's window borders are drawn/shaded when there is a docked window, the algorithm for outlining where the window can be docked. The slider for resizing the docked window in non-trivial.
3. MDI splitter windows. This also looks very difficult. It appears that you may have to sub-class the drawing of the MDI border and scroll bars in order to display the scrollbar "splitter", etc. Perhaps no one has attempted this in plain C.
Any references to sample code will be appreciated.
Thank you.
Ted Green
ted@vedit.com
|
|
|
|
|
I'm looking for code that allows me to download files/pages of the internet. I'm currently using the MFC CInternetSession, etc, but that supports only HTTP/1.0 IIRC.
Because I'm downloading large amounts of small pages, the connection re-use via keep-alive and pipelining should really improve performance.
|
|
|
|
|
Hi there!!
I have got quite a big problem and I wonder if you could help me out!! ! The problem is as follows:
I declared a Class in C++ called Messenger, offering some methods (Which are passed from my GUI). Its purpose
is to handle this methods through to a CORBA Server, which passes it to someone else (should be some kind
of video-conference....).
So the constructor of the class Messenger should include the initialisation of a CORBA-Orb Client. But I absolutely
don't have any idea how this works. I have looked at several examples, but they are all main programs
and no seperated classes like I have.
The code as it is suggested in the main programms is:
main(int argc, char * argv[])
{
try
{
// Initialize the ORB
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
// Convert the contents of the file to an object reference.
CORBA::Object_var obj = orb->string_to_object("file://Messenger.ior");
if (CORBA::is_nil(obj.in()))
{
cerr << "Nil Messenger reference" << endl;
throw 0;
}
// Narrow the object reference to a Messenger object reference.
Messenger_var messenger = Messenger::_narrow(obj.in());
if (CORBA::is_nil(messenger.in ()))
{
cerr << "Not a Messenger object reference" << endl;
throw 0;
}
// Create a message and send it to the Messenger.
CORBA::String_var message = CORBA::string_dup("Howdy!");
messenger->send_message ("rick", "Test", message.inout());
// Release resources.
orb->destroy();
}
catch (const CORBA::Exception & ex)
{
cerr << "Caught a CORBA exception: " << ex << endl;
return 1;
}
catch (...)
{
return 1;
}
cout << "Message was sent" << endl;
return 0;
}
exception handling included. I don't see the point of the following code line:
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
What are the parameters for, given the init-method??
I hope you understand what I am asking. Sorry for my bad English I'm going to learn it better (At least I
hope so...)
Thank you very much for your help!
Charly
|
|
|
|
|
May I recommend you try a corba related newsgroup instead, with emphasis on "newsgroup"?
|
|
|
|
|
I want my application to interface to the user's email client application.
I've currently got this working using MAPI, but, of course, not all email clients use MAPI. On my computer it calls MS Outlook, but my real email application is Netscape.
I've tried PJ Naughters' SMTP class but you have to know what the user's SMTP service is called (e.g. smtp.ozemail.com.au, or whatever) and this actually bypasses their email application.
I've also tried his CMC class, but CMC seems to be an ancient concept that has not continued existence.
My requirement is simply to call the user's email application, supplying the "to" address and an attachment.
Does anyone have any idea how to do this on Windows?
(It's trivial on UNIX).
Russell Robinson (russellr@rootsoftware.com)
Author of TTMaker (Advanced Timetabling Software)
http://www.rootsoftware.com
|
|
|
|
|
To get you started, you can call ShellExecute() on "mailto:person@whatever.com?Subject=Subject here" to open the mail client with a new message.
--Mike--
http://home.inreach.com/mdunn/
The preferred snack of 4 out of 5 Lounge readers.
|
|
|
|
|
Thanks for the suggestion Mike, but there's no way to attach a file with this "mailto" mechanism.
Russell Robinson (russellr@rootsoftware.com)
Author of TTMaker (Advanced Timetabling Software)
http://www.rootsoftware.com
|
|
|
|
|
Yep, sure is. Just use mailto:address@domain.com?attach="your attachment.ext"
Hope that helps,
Andrew.
|
|
|
|
|
Is there any way of specifying the attachment *and* a subject?
Thanks for this excellent tip.
|
|
|
|
|
I tried this using outlook and it worked for setting both subject and attachment.
CString strTemp = _T("C:\\test.txt");
strTemp.Format (_T("mailto:xxx@yyy.com?Subject=My subject\"%s\""),strFilePath);
ShellExecute (NULL, //Parent window
_T("open"), //verb
strTemp,
NULL,//File
NULL,//Parameters
SW_SHOW);
|
|
|
|
|
Hi Andrew,
With Outlook Express 5 I can't get ?attach to do anything - it seems to be ignored. ?subject works fine though.
Do you (or anyone) have any suggestion? I remember trying this a couple of years ago and getting nowhere. It is much better than using MAPI, but I have to be able to specify the attachment.
Cheers, Simon
|
|
|
|
|
Hi Andrew,
Thanks for the response, and I'm sorry that I haven't replied sooner.....been busy fighting other fires.
Unfortunately, the attach parameter doesn't seem to work at all.
I've tried with Outlook Express 5 and Netscape Communicator as email clients. It doesn't work with either.
I can get subject and body parameters to work, but the attach is just ignored.
Also, I haven't found any information anywhere on the net that documents this facility.
RFCs 1738 and 2368 don't mention "attach", though RFC 2368 allows for the possibility of it.
So, it looks like I'm going to have to "do it myself" somehow.
(We are in the 21st century aren't we??????)
Russell Robinson (russellr@rootsoftware.com)
Author of TTMaker (Advanced Timetabling Software)
http://www.rootsoftware.com
|
|
|
|
|
Some image viewer application programs, for example, Adobe Photoshop(http://www.adobe.com/) or
SolidWorks(http://www.solidworks.com) set thumbnail image of a file to its file icon in Explorer so that
the users can know the content of the image file without opening it.
(I do not imply "Thumbnail View" when Explorer is at "Web Page" mode, but customized icon only for a file
in place of the application's general file icon.)
I want to do same thing above in my application program. If anybody know how to set thumbnail image
(custamized icon) to a file icon in place of the application's general file icon in Explorer, please tell me.
-------------------------------
Masahiro Kurosawa
kurosaw@itg.hitachi.co.jp
-------------------------------
|
|
|
|
|
Have a look at the IconPro sample included on the MSDN CD
|
|
|
|
|
|
Thank you for your reply. I think that's what I want to know.
I'm going to see the recommended article in detail.
-------------------------------
Masahiro Kurosawa
kurosaw@itg.hitachi.co.jp
-------------------------------
|
|
|
|
|
At first, I greatly appreciate your advice. I can understand how to customize the icons
and icon handler architecture.
Well, I have another question:
- - -
How to retrieve a handle to an icon from the specified file as we can do same thing from
DLL or EXE using 'ExtractIcon' function ?
- - -
I'm sorry to trouble you so often. If you can find time for me, please tell me the solution
about this.
-------------------------------
Masahiro Kurosawa
kurosaw@itg.hitachi.co.jp
-------------------------------
|
|
|
|
|
How to retrieve a handle to an icon from the specified file as we can do same thing from DLL or EXE using 'ExtractIcon' function?
Sorry, I don't quite understand what you're asking. Is ExtractIcon not working?
--Mike--
http://home.inreach.com/mdunn/
The preferred snack of 4 out of 5 Lounge readers.
|
|
|
|
|
Oh, I apologize to you if my description was not enough.
At first, Visual C++ 6.0 Help reads that ExtractIcon function retrieves a handle to an icon from
the specified executable file, dynamic-link library (DLL), or icon file. Then, I actually try to use
ExtractIcon function for text file (.txt), but ExtractIcon would not work as Help reads.
If there is a way to retrieve a handle to an icon from '.EXE', '.DLL', or '.ICO', I think there is also
a way to do same from '.TXT'.
Should I use IExtractIcon interface like Explorer? If so, I want to know how to use IExtractIcon
interface ( I understand how to implement IExtractIcon interface for Explorer to use thanks to
you ). Or, If there is more easier way like using ExtractIcon for '.EXE', '.DLL', or '.ICO, please instruct
me.
-------------------------------
Masahiro Kurosawa
kurosaw@itg.hitachi.co.jp
-------------------------------
|
|
|
|
|
Ah ok, you want to get the icon that's used for TXT files, right? The way to do that is with SHGetFileInfo(), such as:
SHFILEINFO info;
SHGetFileInfo ( _T("foo.txt"), FILE_ATTRIBUTE_NORMAL, &info, sizeof(SHFILEINFO),
SHGFI_ICON | SHGFI_USEFILEATTRIBUTES );
After that, info.hIcon is the icon. Add SHGFI_SMALLICON to the flags if you want the small (16x16) icon.
--Mike--
http://home.inreach.com/mdunn/
The preferred snack of 4 out of 5 Lounge readers.
|
|
|
|