|
Please, i have no idea how to do it. Libjpeg is so complicated to use that iam having a troubles with it for over 2hours, imagesource library is not freeware, but i have made it.. i dont have any other idea. please i just need to convert a bmp file to jpg file, with the most short code. not even a library,just a quick code that will be able to do this, or some example of project that uses the jpeglib with compiled lib files ;(( God.., please guys, help me..
|
|
|
|
|
http://www.smalleranimals.com/jpegfile.htm
there is only one MFC usage in it and it's a CString that you can easily replace with const char *.
-c
There's one easy way to prove the effectiveness of 'letting the market decide' when it comes to environmental protection. It's spelt 'S-U-V'.
--Holgate, from Plastic
|
|
|
|
|
How can I stop the X from closing the window?
I don't want to disable it, I just want it to hide the window, not close it.
|
|
|
|
|
Handle the WM_CLOSE message, and call ShowWindow(hwnd, SW_HIDE) in response to it.
--Mike--
Thing #9 to say when mad at work: "Therapy is expensive. Popping bubble plastic is cheap. You choose."
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
A problem that I see with this method is that another control could not send a WM_CLOSE message and have the window close, you would either have to set a flag in your WndProc to allow it to close at certain times, you would have to out right destroy the window.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hnadle the WM_SYSCOMMAND message. Execute your special processing where the WPARAM is SC_CLOSE.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
does anyone know how i could extract a dialog form so i could use it in another program...
thanks,
grahamoj.
|
|
|
|
|
what do you mean by saying "extracting dialog forms"??
could u explain me so I will know whether I can answer your question or not.
|
|
|
|
|
If you mean that you created a dialog in a given (old) workspace and you wanna have exactly the same dialog in another (new) workspace without typing it in from scratch than do the following:
1. Create a blank dialog in the new workspace, and close this workspace
2. Go to the old workspce (not in VS but in Windows Explorer) and open oldprojectname.rc file for editing (e.g. with notepad)
Copy the dialog's resources to the clipboard
3. Paste the clipboard in newprojectname.rcto the place where your new dialog was created by VS
4. In resource.h of your new workspace define all resources of the old dialog.
5. Launch VS with the new workspace
Bunburry
|
|
|
|
|
The question I ask today is very simple: how do I load icons and text into a ListView control with MFC? I know how to do it in Win32 but as far as I can tell, it's not compatible with MFC ListView control functions.
-- Steve
|
|
|
|
|
|
Thanks! One more question though. How do I get a floating menu to appear when I right-click on the ListView? It always ends up in the top left corner because I have to use ON_NOTIFY(NM_RCLICK...) to give it the message. What do I do?
-- Steve
|
|
|
|
|
Do you mean a simple popup menu? If yes, I can give you some sample code
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Yes, I need a floating menu to appear when I right-click the ListView control. That's it
-- Steve
|
|
|
|
|
here we go:
POINT point;
GetCursorPos(&point);
CMenu menu;
CMenu *submenu;
menu.LoadMenu(IDR_POPUP);
submenu = menu.GetSubMenu(0);
submenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,point.x,point.y,GetActiveWindow(),NULL);
hope this helps
modified 12-Sep-18 21:01pm.
|
|
|
|
|
How can one determine if the local machine or a machine on the local network is running an SMTP server? I was thinking I could just check to see if a specific port (#25) was open, but it could be set up to use a different one. Is there any way to check?
David Wulff Born and Bred.
|
|
|
|
|
Dont think so...
The only way I can think of, is to try every 65535 ports, and when you find an open one, see if it understand SMTP
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
If the port 25 is open, you can telnet into it and send the command HELO <<yourmachinename>>(for SMTP) or EHLO <<yourmachinename>>(for ESMTP), if you get a response back starting with 250, you can be sure it is running an (E)SMTP server. Normally when you connect, the mail server itself sends you a welcome string telling you about it. Don't forget to send a QUIT after you are done though. If you are not telnetting on port 25, you can write a socket program that connects to port 25 on the other machine and does the same thing.
Simple isn't it? If it's an SMTP server, it must be able to speak SMTP, so that's the way you can test it.
Regards,
Rohit Sinha
|
|
|
|
|
I think he might be worried about black hats
installing SMTP servers on non-standard ports
on machines somewhere in his network and using
his domain for sending spam, porn, warez or
what-have-you? In that case, you can try
connecting to ports (all of them) and talking
SMTP, looking for a server. Or you can watch
traffic on the network and try to sniff out
culprits.
(of course, would they make it stand out as
what it is by speaking plain ol' SMTP? I dunno.)
I wonder what the goal was?
|
|
|
|
|
I have a dialog based application that includes a modal dialog that has a CComboBox in it. I have attached a control variable (through the class wizard in MFC) to the CComboBox because I need the strings in the box to change dynamically depending on other settings in the program. The combo box works fine the first time the dialog is opened, but if I re-open the dialog the control variable causes a crash (assertion error) because it is no longer pointing to the combo.
Can anyone help me with this problem? I need that control variable to point to the combo every time the dialog opens.
|
|
|
|
|
Hi,
I am populating a treeview with some data and since there are too many and too long items my app requires even more and more memory.
To avoid this I decided to use single select mode and add only those items to the tree which belong to the CURRENTLY expanded node.
If this node gets collapsed all items are removed from this node. In that way the app's footprint might be significantly reduced.
Problem: the whole tree must be kept in and read in from a file according to a certain algorithm.
I need your advice as to how you would do this.
Thanks in advance.
Bunburry
|
|
|
|
|
// CollapseBranch - Collapses a branch completely
// hti - Handle of the tree item to collapse
void CTreeCtrlX::CollapseBranch( HTREEITEM hti)
{
if( ItemHasChildren( hti ) ){
Expand( hti, TVE_COLLAPSE );
hti = GetChildItem( hti );
do{
CollapseBranch( hti );
}while( (hti = GetNextSiblingItem( hti )) != NULL );
}
}
Expanding a branch
--------------------------------------------------------------------------------
The treeview has built in support for expanding expanding the outline one level at a time. If you want to completely expand a branch, the code below will help. It uses recursion to expand all items. The last line, that is, the call to EnsureVisible() is useful when this code is hooked up to a user interface. After expanding the outline branch, the previously selected item may have scrolled off and calling EnsureVisible() brings it back.
// ExpandBranch - Expands a branch completely
// hti - Handle of the tree item to expand
void CTreeCtrlX::ExpandBranch( HTREEITEM hti )
{
if( ItemHasChildren( hti ) ){
Expand( hti, TVE_EXPAND );
hti = GetChildItem( hti );
do{
ExpandBranch( hti );
}while( (hti = GetNextSiblingItem( hti )) != NULL );
}
EnsureVisible( GetSelectedItem() );
}
search more in codeguru and codeproject
|
|
|
|
|
I must have asked in the wrong way:
The real question is how can I serialize a treeview into a file so that I can retrieve its nodes any time.
When I expand an item, I have to read in its childs from the file, when I collapse delete all items in this node because all subitems are saved in the file in question.
Anyway thanks for the feedback.
Bunburry
|
|
|
|
|
I need to be able to create some controls as the user needs them. They are all the same control. I will need to be able to still get access to each controls messages etc. At the time the appliction starts to run I will not know how many controls the users will be using, but there will be a max number of controls that the user can create.
How can I do this in VC++? If anyone can point me in the right direction I will be happy to do the research. I looked over at MSDN but could only find examples for VB.
Thanks,
-Eric
|
|
|
|
|
Option 1: You could create all controls with the dialog editor in the non visible state, and show/hide them according to user input with ShowWindow(SW_SHOW/ShowWindow(SW_HIDE)
Option 2: Create them dinamically with the controls Create method.
Bunburry
|
|
|
|