|
How can I edit a ListItem in a MFC CListCtrl. I know that i should place a Edit-Box. But on which position?
How can I get the Position for the EditBox?
|
|
|
|
|
No, you don't create your own edit box. Handle the LVN_BEGINLABELEDIT and LVN_ENDLABELEDIT notifications.
--Mike--
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
|
|
|
|
|
Do you have a sample-code?
|
|
|
|
|
What do you mean edit an item? Do you mean change an item if the user clicks on it?
For example, if the user double clicks an item, you could create a dialog box with the item's current data and allow the user to change it.
Kuphryn
|
|
|
|
|
In our very own List Control articles section, there is an article on Editing Sub-Items in List Control by s.prabhakarreddy. You may find it useful...
Shog9
------
And on the pedestal, these words appear:
"My name is Ozymandias, King of Kings,
Look on my Works, ye Mighty, and despair!"
Nothing beside remains.
|
|
|
|
|
I am having a problem with getting an animation to be displayed with a transparent background. I have a C++ based application (no MFC) which has a dialog that I want to display an animation on. I am doing something similar to the Windows dialog when a copy operation is occuring. However, I have an animation of a PC and a watch communicating. My background color in the AVI file is white (RGB 255, 255, 255). Here is the code I use in my WM_INITDIALOG message:
hAnim = CreateAnimationCtrl(hDlg, IDC_ANIMATE);
Animate_Play(hAnim, 0, -1, -1);
hdc = GetDC(GetDlgItem(hDlg, IDC_ANIMATE));
SetBkColor(hdc, RGB(255, 255, 255));
The IDC_ANIMATE Id is the animation control on the dialog. Here is the code for the CreateAnimationCtrl function:
HWND CreateAnimationCtrl(HWND hwndDlg, int nIDCtl)
{
HWND hwndAnim = NULL;
RECT rc;
POINT pt;
hwndAnim = Animate_Create(hwndDlg, IDC_ANIMATE, ACS_TRANSPARENT | WS_CHILD, ghInst);
GetWindowRect(GetDlgItem(hwndDlg, nIDCtl), &rc);
pt.x = rc.left;
pt.y = rc.top;
ScreenToClient(hwndDlg, &pt);
SetWindowPos(hwndAnim, 0, pt.x+10, pt.y,
149, 25,
SWP_NOZORDER | SWP_DRAWFRAME);
Animate_Open(hwndAnim, MAKEINTRESOURCE(IDR_AVI));
ShowWindow(hwndAnim, SW_SHOW);
return hwndAnim;
}
In addition to the window style in the creation, I also have it set for the resource.
It seems like I've covered everything, however, the AVI clip plays showing the white background on my gray dialog.
Anyone have any suggestions?
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
I think the problem is just in your AVI file. Did you set the transparency color in your AVI editor? I have only used the Animation Control once and all I had to do was import my AVI resource and call the Open method on the Animation control.
--
If it starts to make sense, you're in a cult.
|
|
|
|
|
Also, my background color is RGB(255, 0, 255). I found that most AVI files I found on the Internet use this color as the background.
--
If it starts to make sense, you're in a cult.
|
|
|
|
|
Tom,
I was able to get the transparency to work, however it only seems to work on video cards with 32-bit color depth. When I go down to 16-bit color depth, the magenta background that I have shows up. I am handling the WM_CTLCOLORSTATIC message in my message procedure to set the background color of the image to the dialog color as shown below.
case WM_CTLCOLORSTATIC:
hdc = (HDC)wParam;
dwColor = GetSysColor(COLOR_BTNFACE);
SetBkColor(hdc, dwColor);
return TRUE;
Do you have any suggestions on how to get this to work with all video card bit depths?
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
Are you testing in XP? I've had a similar problem some months ago, everything worked just fine in every OS except XP. Finally, modifying the style right before opening the file seems to fix the problem:
DWORD dwStyle = GetWindowLong(hwndAdmin,GWL_STYLE);
dwStyle = dwStyle | dwAdd;
SetWindowLong(hwndAdmin,GWL_STYLE,ACS_TRANSPARENT);
Animate_Open(hwndAnim, MAKEINTRESOURCE(IDR_AVI));
...
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I am sure there was a switch for Visual Studio 6.0 that displayed build times. Dammned if I can remember it though.
Can anyone 'jog' my memory.
Ryan.
Computers allow you to make more mistakes than any other invention, with the possible exception of handguns and tequila.
|
|
|
|
|
Start msdev.exe with the /y3 command. Build times should be displayed now...
-----------------------
New and improved: kwakkelflap.com
My first CP article: Pseudoregisters[^]
"When I hear of Schrödinger's cat, I reach for my gun." - Stephen Hawking
|
|
|
|
|
Hi,
i have a own protocol stack implementation in Windows2000.
Wenn i send an udp Frame with a port xxxx ( to the Win2000 PC ), the WinSock Part of the OS sends an ICMP Message at the sender with
Type 3 : Destination unreachable
Code 2 : Port unreachable.
It doesn't matter to my program, because i can get the frame and make
my own processing. But how can i prevent these messages.
I think i could bind a (the)udp port to a socket and listen.
But these isn't quite good.
Can anybody help me ?
Marco
|
|
|
|
|
I use Visual C++ 6.0 to compile my program.
I can compile my program but there is error message happen at this line
[code]
int *cumchange;
cumchange = (int*)malloc(cols * sizeof(int));
[/code]
The error message show
***************************************
User breakpoint called from code at 0x77f7f570
***************************************
and the screen show Disassembly window
At that Disassembly window
the first line is
77F7F570 int 3
If you know how to solve my problem, please tell me. Thank you.
|
|
|
|
|
Sounds like you're breaking inside the memory allocation code; this is usually because you've trashed some memory elsewhere (tried to free memory twice, overwritten beyond the allocated area, written to memory after freeing it).
If you have a DEBUG build, there's usually a diagnostic of some sort generated in the output window when you run under the debugger.
Steve S
[This signature space available for rent]
|
|
|
|
|
in my C++ app, i nned to run a java app with process and pipe re-direction for any output.
when initialize, i set:
STARTUPINFO si;
si.dwFlags=STARTF_USESHOWWINDOW|STARTF_USESTDHANDLES;
si.wShowWindow = SW_HIDE;
//more somethings
problem (with java 1.3):
if i hide dos window, the java app is hidden also. if show, both are shown.
i hope user only sees java app, no dos window.
i tested with java process to exec the java app, no dos window appears!
but i have to use C++ ...
please help ...
includeh10
|
|
|
|
|
Hi guys,
If I use the STL find algorithm, it returns an iterator. Is there any way for me to determine from the iterator, at what index the item was found?
Thanks
Senkwe
ASP.NET can never fail as working with it is like fitting bras to supermodels - it's one pleasure after the next - David Wulff
|
|
|
|
|
Assumming the iterator belongs to an indexed contaner c (like std::vector ), then std::distance(c.begin(),it) should yield the index.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquin, i've often wonderered, how is your name pronounced?
Signature space for rent. Apply by email to....
|
|
|
|
|
Following the notation of www.m-w.com, it is something like
/kö-a-'kEn/
where k is the sound of scotch Loch or german Bach. Many people diphthonguize the first two syllables into:
/kwa-'kEn/
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Brilliant!
Thanks Joaquin.
ASP.NET can never fail as working with it is like fitting bras to supermodels - it's one pleasure after the next - David Wulff
|
|
|
|
|
I have created CMyView class derived from CHtmlView. I use this class to show text from html file. I want to know how can I get text in CMyView at position that mouse clicked?
|
|
|
|
|
In the web world, clicking with the mouse doesn't set any position, since the Html renderer dynamically stretches the content so it fits.
Now if the user selects something with click+drag, then the MSIE DOM allows you to get the current selection. See MSDN stuff like InnerHtml.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
Hello all, I have written a little MFC application (i have VC6 standard edition) and would like to distribute it shareware on a low deployment basis.
Now, checking out a MSDN document ('redistributing VC++ 6.0 Applications') and reading carefully the 'redist.txt' document in the Visual Studio CD, i have noticed that there is a comprehensive, not short, list of what DLL's I ought to include, but i'd like to determine, if possibile, just only , say, 'the minimum' dll set.
1) I think i could just distribute these (i have no database support in my application):
-mfc42.dll
-msvcrt.dll
and:
-msvcp60.dll <-- is it really necessary?
-msvcirt.dll <-- is it really necessary?
-atl.ddl <-- is it really necessary?
2) I plan to put these files in the app directory, not on the system or system32: anybody knoews in there would be some problems with win98, win98SE, win ME and win XP? I read somewhere about a slight different way of checking the dll path in these OS.
3) In the MSDN document i read 'the mfc42.dll' SHOULD be registered on the target computer to ensure 'all mfc funcionality' is present. somehwere (If i am not wrong even searching on this excellent forum) somebody told this is actually not necessary.
Thanks in adavance for any suggestion/tip about the above
Joe
|
|
|
|
|
1) If you use MFC as static link, you don't need either of these DLLs (all the code is embedded in your exe or dll).
If you use MFC as shared dll (default behaviour) then yes redistrubtion problems arise.
mfc42.dll and msvcrt.dll are the primary release dlls and are needed. But msvcirt.dll, msvcp60.dll, and a few others (including msstkprp.dll) may be required depending on whether you use them. To know it, just use "Dependency walker" and figure them out. Otherwise you could rename one of those dlls and try to run your program. If it runs fine, now you know...
Be warned, if <winsysdir>mfc42.dll is already installed (but in an older version) and locked by another process, then you won't be able to overwrite it until next boot-time. And you'll have to add a win.ini entry and stuff ==> use InstallShield for this purpose instead.
atl.dll is often not needed. Default use of atl is static linking, thus atl.dll is not needed. Again, check this out with "Dependency walker" (static report is enough). You may also check out your project settings : if there is no _ATL_DLL, then you don't need atl.dll at all.
2) Go on. It's fine. ::LoadLibrary() always consider the current directory, so as long as your app loads those DLLs at launch-time (before you do any ::SetCurDir(...)) it's ok.
3) mfc42.dll is actually a COM component. Just ask Install shield to register it. Or dfo yourself a regsvr32 mfc42.dll
x) A question you didn't ask. What about restricted profiles, such lke those from NT/2K/XP : in fact, you can't rely on raw installation (belive it or not) : you MUST use Windows Installer. .msi files are the only files allowed to install anything on a client desktop with restricted profile. Of course, you may end up asding the end user to log as local admin, but now you know...
To manage .msi files (and embed .msm MFC merge modules), use either VisualStudio Installer, or InstallShield 7, or upgrade to VC7.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|