|
Add a handler for WM_KICKIDLE . In the handler, call UpdateDialogControls(this, false); You'll need to #include <afxpriv.h> for the definition of WM_KICKIDLE
--Mike--
Yeah, payin' the bills with my mad programming skillz.
Defraggin' my hard drive for thrills.
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Seems like a losing battle... The ON_UPDATE_COMMAND_UI message handler is still never called.
Oh well.
|
|
|
|
|
Look for 'Q242577' in MSDN, there is an example 80 lines of code overriding the OnInitMenuPopup function and it worked for me.
|
|
|
|
|
Hey! That did the trick, thanks.
|
|
|
|
|
I am working on a project where I need to set the region of numerous windows not owned by my application. This works great on 2000 but in testing on a 98se box, I found it gives an "invalid parameter" error(87) when the winow handle passed into setwindowrgn is no associatd with the application calling the function. I cannot find any documentation from MS that eludes to the fact this is not allowed and only occurs on 9x boxes. Does anyone know of a workaround or way to correct this issue. To test - create an app that sets a window region and use FindWindow to get the handle of a running instance of Notepad and try to change the shape of notepad. Keep in mind this works fine on 2000 but not on my 98se machine.
Thanks in Advance.....
|
|
|
|
|
Hi:
i want to record Telephone-conversation through my modem as a Wave File or other format such as mp3 and etc,so can anyone introduce to me an article that discuss in this field.(with source code and tutorial)
Best Regards.
|
|
|
|
|
Hi all,
I am trying to port a VB application (Playwave.exe) that can be downloaded from the microsoft website to C++. I am basically done, but there is just one small thing:
The GDI routine in VB calls a function called
Line (lastX, leftYOffset + lastLeftY)-(x, curLeftY + leftYOffset)
I translated it to C++ as follows:
pDc->MoveTo(lastX, leftYOffset + lastLeftY);
pDc->LineTo(x, curLeftY + leftYOffset);
However, the outputs that I get are quite different. The VB call paints the wave as a filled polygon while I get a bunch of interconnected lines, of course. Is there an equivalant to this Line function in C++. The Line method is defined as in MSDN:
I tried using methods like Polygon and Polyline but to no avail. BTW: i am not using MFC. Since, I am still in the learning stage, I thought it would be nice to be comfortable with core WINAPI and get a hang of how things work behind the scenes.
Syntax
object.Line [Step] (x1, y1) [Step] - (x2, y2), [color], [B][F]
You can also download the Playwave.exe from
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B182983[^]
Thanks for any help that you might give me.
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Hello !!
I have a Problem:
I have an MDI Application, and I split the Child- windows into 2 Views.
These I do in the PreCreateClient () - Funktion from CChildWnd . I habe a static Splitter with 2 columnes and 2 Views. Now I want to switch the second view away, that only the first view is visible.
Normally I must destroy the child window and then I create it without splitter.
But I want by Programm (not by user) switch the second view away without destroying the child window. Can I make the second view not destroying, only the client- area make it to CRect (0,0) ??
Thank you for helping me
Dirk from Germany
|
|
|
|
|
Cany anyone comment on why some people will use:
<br />
int main(int argc, char** argv){}<br />
compared to the MFC app-wizard generated:
<br />
int main(int argc, char* argv[]){}<br />
Thanks.
|
|
|
|
|
Imho, the latter is more correct since argv is an array of pointers to characters. Since an array can be looked upon as a pointer to a block of memory that contains a number of fixed size objects (4 bytes, in the case of argv ), you could define argv as a pointer to a pointer of characters. The latter definition provides more information.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
You will find the first one more common in Unix apps and Win32 ports of Unix apps.
If you are looking for a way to process command-line arguments (even in an MFC app), see my article XGetOpt.
Best wishes,
Hans
|
|
|
|
|
I'm trying to make a list of thumbnails in a listview window. So far I can only make it work with resource bitmaps, when i try a hard coded jpg, i get get a blank image, with "hiya" under it
Its probally something really dumb, but i just cant find it. If anyone could point it out i'd be very grateful
(I'm almost positive its not the Bmp variable, the function does return a BITMAP)
//Here's the code
//Opens a thumbnail struc and sets its x and y
thumb = openThumb(&x ,&y);
_bstr_t txt("Hiya");
//Gets Handle to the listControl
hThumbList = GetDlgItem(g_hWnd ,IDC_LIST_THUMB);
//x = 160, y = 120
hImageList = ImageList_Create(x,y,ILC_MASK | ILC_COLOR32,0,0);
Bmp = getThumbBmp(g_hWnd,hPicDC); //Returns a HBITMAP
//Adds bitmap to the list as position 0
ImageList_Add(hImageList, Bmp, NULL);
SendDlgItemMessage(g_hWnd,IDC_LIST_THUMB,LVM_SETIMAGELIST,0,(LPARAM)hImageList);
lvi.mask = TVIF_TEXT | TVIF_IMAGE;
lvi.pszText = txt;
lvi.iImage = 0; //First Image added
// Insert info to the Listview
SendMessage(hThumbList ,LVM_INSERTITEM,0,(LPARAM)&lvi);
|
|
|
|
|
simple, imageList doesn't support jpeg compressed images. only raw bitmaps.
try using GDI+ to load the jpeg and then get an HBITMAP from it.
|
|
|
|
|
how to have global variables in a file ay _afxvars.h included in the stdafx.h and used by many modules. I found errors in that unless i declare them static,i get linker errors but making static will not change the value of the variables even when changed.functions is not a problem.help.
|
|
|
|
|
try this:
extern int Global1;
extern int Global2;
int Global1 = 0;
int Global2 = 0;
Software Zen: delete this;
|
|
|
|
|
I have written a COM component in VC++ that connects to a ODBC (.mdb file) through OLE DB. When i try to use it in .asp page i get error (0x80004005 - unspecified error). The same component (same asp file) works fine with PWS under Win98. When i run the same with IIS5 in Win2000 and WinXP i get error. I couldn't find out what might be the problem. Can you help me out?
Thanx in advance
Mahesh
|
|
|
|
|
That's because the connection string is different. The ADO/OLEDB section from the ASP documentation shows exactly what it expects.
PWS is a stripped down version of IIS and works with less stringent constraints. That's why it works with PWS.
|
|
|
|
|
Thanx Rod,
Actually i created the OLE DB connection using the 'Data Consumer ATL'. I look at it and try to fix it. Thanx once again.
Mahesh
|
|
|
|
|
Hi guys
i'm trying to get a listview full of thumbnails to load. kinda exactly like this tutorial:
http://www.codeproject.com/listctrl/thumbnailview.asp
only problem is, theres no source code provided, and i can't figure out what type his "m_imageList" class is
is it some kind of MFC listcontrol class? i can't use any stdfx stuff in my program, so if it is i'm screwd... if not where can i DL the code for the class
any help (soon) would be greatly appriciated!
-Mortis
|
|
|
|
|
D'oh
its looking like MFC, in that case, i'll change the question to:
does anyone know a simliar example in WIN32 API?
|
|
|
|
|
|
will do, thanks for the link
|
|
|
|
|
Hi.
Can anyone explain to me once and for all why do i see people write something like:
if (0==myVar)
{
...
}
instead of:
if (myVar==0)
{
...
}
what difference does it make ?
|
|
|
|
|
Simple. Your compiler will tell you if you type
if (0 = myVar)
whereas
if (myVar = 0 )
will compile and will always set myVar to 0 and evaluate to true.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Christian Graus wrote:
if (myVar = 0 )
will compile and will always set myVar to 0 and evaluate to true.
A typo, I guess Christian...
The value of the expression "A = B" is the value of A after the assignment, i.e. the value of B. Thus, "myVar = 0" evaluates to 0 and false.
--
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|