|
ThatsMe. wrote: Anyone can tell me how can resize the control which is inside of other control.
Control is a fancy name for Window. And all windows are inside other windows. So, you do it the same way you resize anything:
SetWindowPos.<br />
<br />
If you are using one of the articles on codeproject that does resizing for you, then you need to look at the example code that comes with that article. And each article has a message board on it. First read all the postings on that article; someone may have already fixed your problem. If you're still struggle, try posting on that message board first - the author is notified of any posting, and may be able to help you.<br />
<br />
Iain. <br />
<br />
<div class="ForumSig">Iain Clarke appears because <sup class="Error">C</sup>Pallini still cares.</div>
|
|
|
|
|
Did you use of MoveWindow?
|
|
|
|
|
hi
i need study about Structure of MFC Architecture ...please send me some useful links ..
Thanks And Regards
Nisha.S
|
|
|
|
|
Never heard of something called google[^] ?
|
|
|
|
|
Well, there are lots of books on MFC but i'll particularly recommend
http://www.codeproject.com/?cat=2[^] as it contains lots of userful articles for both biginners and advanced users/programmers...
|
|
|
|
|
|
For the structure of MFC, I find the MFC source code to be the best place to study.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Did you search on the codeproject?
|
|
|
|
|
This code snippet is used to bring up a confirmation dialod box to close the window only when the top right close box is clicked not for any other methods of closing like File>Exit and Syatem Close and Alt+F4. The behaviour of getAsyncKeyState() is not undersatndable here...
LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg,WPARAM wParam, LPARAM lParam)
{
LRESULT result=0L;
int k=0;
switch(Msg)
{
case WM_NCLBUTTONDOWN:
if (wParam!=HTCLOSE) // allow clicks on system menu to continue and proceed
{
DefWindowProc(hWnd, Msg, wParam, lParam);
return 0;
}
GetAsyncKeyState(VK_LBUTTON);
break;
case WM_NCLBUTTONUP:
if ((int)wParam ==HTCLOSE && !(GetAsyncKeyState(VK_LBUTTON)))
{
k=MessageBoxA(NULL, "Do u wish to close ", "getasynckeystate", MB_YESNO);
if (k==IDYES)
{
PostMessage(hWnd, WM_CLOSE, 0, 0L);
return 0;
}
else
{
DefWindowProc(hWnd, Msg, wParam, lParam);
}
}
DefWindowProc(hWnd, Msg, wParam, lParam);
break;
case WM_DESTROY:PostQuitMessage(WM_QUIT);// then close it
break;
default : return DefWindowProc(hWnd, Msg, wParam, lParam);// Process the left-over messages
}
return result;
}
Bibhakar Ranjan
|
|
|
|
|
GetAsyncKeyState[^].
Please, read the posting guidelines before posting a message, format your code with the pre or code tag otherwise it is difficult to read.
Furthermore, you shouldn't use MessageBoxA directly, but MessageBox. So that your compile will still compile if you switch UNICODE on or off.
|
|
|
|
|
...you can see also suggest the related GetAsyncHi and GetSynchronousHello functions.
BTW Good morning Cedric.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hello mister Pallini
Sorry, but I didn't get what you were trying to say. My brain is still not fully operational in the morning
|
|
|
|
|
folks,
I need help on how to write a C/C++ code to compute the Gaussian and Laplacian Pyramids at 5 levels.
Using PGM image format as the input. Please help
|
|
|
|
|
|
Is this is Debug or Release mode?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Usef Marzbani wrote: It's On Release Mode
Enjoy!
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
I was recently forced to switch from VC6 to VC2008. Many projects to convert, many errors to fix, many days to -- well -- spend. One day I recompiled and registered a MFC ActiveX control. That went fine. I had a few projects that use that control, so I removed the old H/CPP wrapper files from one of them and imported the control using Project -> Add Class -> MFC Class From ActiveX Control. The wizard re-generated H/CPP files, containing wrapper class for the control. When I recompiled the project I got many errors saying dozens and dozens of Get/Set methods are not members of my control (wrapper). I looked into generated H file of the wrapper class and found out the compiler was right: there were no Get/Set methods for any of the properties contained in the control.
After a few tries and failures I decided to start from the scratch. I created a simple MFC ActiveX control containing only two properties -- Prop1 and Prop2 of type LONG -- and two empty methods -- Method1 and Method2. All checkboxes and radio buttons in wizards were left on their default values while doing that. I imported the control the same way as before into a newly created MFC application and got the same problem: wrapper class contained only Method1 and Method2, but no Get/Set methods for the properties Prop1 and Prop2.
What am I doing wrong?
--
Vladimir Svrkota,
CardWare
Novi Sad, Serbia.
|
|
|
|
|
Hi Vladimir
I run exactly in the same problem with VS2005. In case you find a solution, please inform me THANK YOU VERY MUCH!!!.
I need the import over ActiveX because this generates a CWND derivated class. However, i get all properties and also events (which are missing too for ActiveX class) when i generate a class by TypeLib (actualle this generates 2 Files, the events are separated).
Maybe it´s possible to take from typelib generated files the missing parts and hack them in the file from the ActiveX import. A nuisance, however!
Best regards
Stefan
|
|
|
|
|
Rehi
ok, i have a weird solution, but it seems to work:
Starting from a scratch container:
1.1) Insert ActiveX in resource editor
1.2) Assign a control variable. This generates a CWND derivated class with all props, events can be assigned by adding event handler and so on. Update is difficult however, except one deletes always the control and redo it (maybe even the way with less effort).
Anyway:
Updating ActiveX ( added method, event, whatever )
2.1 Remove every file for control declaration from the project (.h, .cpp) by destroying it!
2.2 leave project, delete the .ncb file, restart project but do not compile anything that would remake the ncb file
2.3 Add the control by the MFC ActiveX class. Name will be different by default then for 1)
2.4 Add the control by the MFC TypeLib, choose there the methods AND events. this will generate 2 more header file types of similar name
2.5 copy the missing parts form the typelib header files into the activex class (event block, property)
2.5 Destroy the generated typlib files, delete the includes
2.6 Remove added includes (in case they were already defined) of afxdisp.h in stdafx.h and the control header file in your main application - else you get after some new class inserts a long list of same include definitions.
and only once after you did 1)
3.1 Destroy the control files from 1)
3.2 Replace the object class from 1) by the new activeX class
Seems to work, at least in a very simple test
Regards
Stefan
modified on Wednesday, June 25, 2008 4:51 AM
|
|
|
|
|
Stefan_L_01 wrote: 1.1) Insert ActiveX in resource editor
1.2) Assign a control variable. This generates a CWND derivated class with all props, events can be assigned by adding event handler and so on. Update is difficult however, except one deletes always the control and redo it (maybe even the way with less effort).
Yes, this is the same solution I accidentaly discovered, take a look at this thread[^] in microsoft.public.vc.mfc newsgroup.
This "trick" gave me Visual C++ 6 compatible h/cpp files and that was all I needed at the time. Fortunately, my OCX control won't be needing any changes in the near future, but it's nice to have your solution when it comes to that. Thank you.
By the way, while googling around I found out this problem appeared in the first release of Visual Studio .NET (version 7.0, a.k.a. 2002), it remained in VS2003, VS2005 and it's quite strange it's still present in the most recent VS2008, so many years later.
--
Vladimir Svrkota,
CardWare
Novi Sad, Serbia.
|
|
|
|
|
btw: do you know how to delete a method, property or event from an aciveX Projekt in VS200x ?? I can´t find a way to do it.
At the moment it looks to me that i have to remove it manually with the problem that i have to renumber the odl indizes by hand argh (interrupted number order seems to cause problems)
Best regards
Stefan
|
|
|
|
|
Stefan_L_01 wrote: btw: do you know how to delete a method, property or event from an aciveX Projekt in VS200x ?? I can´t find a way to do it.
No, sorry.
--
Vladimir Svrkota,
CardWare
Novi Sad, Serbia.
|
|
|
|
|
I've created a unicode HeaderControl (window class name WC_HEADERW).
I'm adding items something like this:
HDITEMW headerItem;
memset( &headerItem, 0, sizeof(headerItem) );
headerItem.mask = HDI_LPARAM | HDI_WIDTH|HDI_FORMAT|HDI_TEXT;
headerItem.lParam = (LPARAM)j;
headerItem.pszText = LPSTR_TEXTCALLBACKW;
headerItem.cxy = 80;
headerItem.fmt = HDF_LEFT;
int err = SendMessage( headerWnd_, HDM_INSERTITEMW, (WPARAM)j, (LPARAM)&headerItem );
That works fine. I get a HDN_GETDISPINFOW notification. However the iItem in the NMHDDISPINFOW structure is always some bizarre number, i.e. it's not "0" or "1" etc, like one would expect. I googled a bit and didn't find much of a resolution to this. Has anyone else every gotten this to happen and how do you deal with it? Since I'm storing the index in the lParam I can see that is being sent correctly and work around this, but it's kind of silly to say the least.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|