|
When I stretch the OpenGL MFC window past a certain point, my OpenGL rendered scene gets a black border. The border tends to grow as I increase the client area of the window. The bug happens most of the time, not always. Any ideas?
|
|
|
|
|
This is happaned only if you use combination of MS software render and Windows 2000. This can be fixed with some tricky changes of Windows's size.
|
|
|
|
|
Can anyone give me some pointers on how I would send the data I receive in a CWnd Overloaded function to another window using SendMessage.
For example
void CMyWnd::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CWnd::OnKeyUp(nChar, nRepCnt, nFlags);
::SendMessage(m_hWndTarget, WM_KEYUP, ...)
}
How is this done
James Spibey
|
|
|
|
|
It depends on the message. In this case WM_KEYUP looks like this:
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_KEYUP
WPARAM wParam, // virtual-key code
LPARAM lParam // key data
);
So you would send it as ::SendMessage(m_hWndTarget, WM_KEYUP, (WPARAM)nChar, (LPARAM) nRepCnt | nFlags);
I *think* that is right, basically you need to make sure you send on the data in the format expected by the message, the info you want will always have come into the message handler at the top.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
void CMyWnd::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CWnd::OnKeyUp(nChar, nRepCnt, nFlags);
::SendMessage(m_hWndTarget, WM_KEYUP, (WPARAM) nChar, (LPARAM) ((nFlags * 256) + 1))
}
the lparam for this messages consists on nFlags in bits 31-16, and repeat count in bits 15-0. But the repeat count it always 1 in this message.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Jon is right and I am wrong - I didn't look at the MSDN properly when I wrote my answer.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Actually, I have found an easier way. All I have to do is override the DefWindowProc for my window and filter out the messages which I wish to forward:-
LRESULT CMyWnd::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_KEYUP:
case WM_KEYDOWN:
case WM_SYSKEYUP:
case WM_SYSKEYDOWN:
::SendMessage(m_hWndTarget, message, wParam, lParam);
break;
}
return CWnd::DefWindowProc(message, wParam, lParam);
}
James Spibey
|
|
|
|
|
Maybe you can use CWnd::GetCurrentMessage() and use the returned MSG structure.
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
In my program i use a CListCtrl..
Selecting multiple Items.. everything is ok..
but after processing the selection i would like to destroy the selection the user made..
visually it is simple, using SetSelectionMark(-1)...
but msdn says:
"This macro does not affect the selection state of the item"
and this is the problem.. the user clicks "process" once again.. and the same selection gets processed... but i want to delete the section..
the only solution i found would be setting the "ItemState" to NonSelected.. but i had to do this for the whole selection..
is there any other / easier way??
thanks in advance
bernhard
stolen sig#19:
"Just looking for loopholes." W. C. Fields [American actor, 1880-1946, explaining why he was reading the Bible on his deathbed.]
|
|
|
|
|
Well if you are doing the processing in a loop then you could just set the ItemState to Nonselected as soon as you are done processing that item and then when all processing is done set the selection mark to -1.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
ListView_SetItemState ( hwndYourList, -1, LVIS_SELECTED, 0 );
turns off the selected state for all items in the list.
--Mike--
http://home.inreach.com/mdunn/
"Listen you footwarriors, can you hold down a bit with the firing? I've just got three impromptu weddings breaking out behind me!" -- Arthur Dent
your with and
|
|
|
|
|
How can i create setup foe win ce application?
Kumar Saurabh
Software Engneer
Syndew Pvt Ltd
New Delhi
India
|
|
|
|
|
Is it possible to change screen resolution which is not supported by the device driver(for eg. 700x400) by calling IDirectDraw::setdisplaymode?
I want to call this api as setdisplaymode(700,400,16)or
setdisplaymode(200,400,8)
|
|
|
|
|
No, no, no. Look up EnumDisplayModes - they are ALL you can set it to, the ones the card supports.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I need to create a dll component that shows dialog form that performs some things.
This component have to match to work in client program of Delphi.
So Which type of dll I need create for it ? (ATL/ ACTIVE X or another )
-----------------------------------------------------------------------
I maked it as MFC Extention DLL but it works only in client program of VC (not in Delphi !)
------------------------------------------------------------------------
Please help ! It is very urgent !!!
|
|
|
|
|
I maked it as MFC Extention DLL but it works only in client program of VC (not in Delphi !)
extension dll's work just in mfc... so you can't use em in delphi, visual basic or whatever..
i am not expert.. but if you want to use the component everywhere you have to use
ActiveX or COM..
to decrease size of the component it is better if you implement it using ATL and not MFC... that makes the whole dll smaller and you don't have to link with the MFC (static or dynamic linking)...
if you need tutorials building a component see the sections in codeproject...
hope this helps a little bit
bernhard
stolen sig #18
"Pseudocode is code to demonstrate a concept, not designed to be run. Like certain Microsoft software. "
|
|
|
|
|
Thank you.
So you suggest me to use in ATL.
But I understood that there are problem in ATL if I want to use in class CDialog of MFC and I need use Dialog form as basis to my implementation.
What do you say about it ?
|
|
|
|
|
You can use a dialog resource to make an ATL dialog, but you won't use any MFC classes, like CDialog. There are ATL equivalents of these. In the ATL object wizrd thingy, under the miscellaneous tab, there is a "dialog" option. Chose that. You'll have an ATL dialog. The resulting dialog is NOT a COM object yet, though. Go back into the new object wizrd thingy, and select new Simple object, and make a COM object that contains an instance of the dialog class as a member, and expose functionality of the dialog through the COM objects interface. Then you can use the dialog in VB, or wherever COM objects may be used.
|
|
|
|
|
|
or you can use WTL (Windows Template Library) for your dialogs
|
|
|
|
|
Manny Thanks !
IN ATL :
Can I insert dialog by Go to Insert ATL Object, Select Category - Miscellaneous and double click on Dialog.
Which is option better ? (ATL or WTL) and why ?
Remmember : I need it for another language (Delphi) !
|
|
|
|
|
HO !! I'm in troubles
I try to add to ATL project dialog in two ways and there are problems
If I add a sinple dialog in resources as Aron suggest and I create class for the dialog I gets errors because it is base :MFC CDialog
If I Insert ATL Object, Select Category - Miscellaneous - Dialog.
I see that the code that I gets from the wizard is very strange and I dont know how to add my methods to that class.
|
|
|
|
|
MFC can be used in ATL projects. I don't tend to use it now but it can be used. So if you want to try the MFC route, post the errors and related code and we'll see if we can't help you out.
If you want to go the straight ATL route, there is a bit of a learning curve from MFC because the code is slightly different to MFC classes. What methods are you trying to add to your class?
Michael
|
|
|
|
|
The errors that I gets if I trys to add class from base CDialog for my dialog resource are:
c:\windows\שולחן עבודה\222\dlg.h(14) : error C2504: 'CDialog' : base class undefined
c:\windows\שולחן עבודה\222\dlg.h(17) : error C2629: unexpected 'class Dlg ('
c:\windows\שולחן עבודה\222\dlg.h(17) : error C2238: unexpected token(s) preceding ';'
c:\windows\שולחן עבודה\222\dlg.h(21) : error C2065: 'IDD_DIALOG1' : undeclared identifier
c:\windows\שולחן עבודה\222\dlg.h(21) : error C2057: expected constant expression
c:\windows\שולחן עבודה\222\dlg.h(30) : error C2061: syntax error : identifier 'CDataExchange'
c:\windows\שולחן עבודה\222\dlg.h(41) : error C2143: syntax error : missing ';' before '}'
C:\WINDOWS\שולחן עבודה\222\Dlg.cpp(18) : error C2065: 'CWnd' : undeclared identifier
C:\WINDOWS\שולחן עבודה\222\Dlg.cpp(18) : error C2065: 'pParent' : undeclared identifier
C:\WINDOWS\שולחן עבודה\222\Dlg.cpp(19) : error C2448: '<unknown>' : function-style initializer appears to be a function definition
C:\WINDOWS\שולחן עבודה\222\Dlg.cpp(19) : error C2143: syntax error : missing ';' before ':'
C:\WINDOWS\שולחן עבודה\222\Dlg.cpp(20) : error C2448: '<unknown>' : function-style initializer appears to be a function definition
C:\WINDOWS\שולחן עבודה\222\Dlg.cpp(27) : error C2065: 'CDataExchange' : undeclared identifier
C:\WINDOWS\שולחן עבודה\222\Dlg.cpp(27) : error C2065: 'pDX' : undeclared identifier
C:\WINDOWS\שולחן עבודה\222\Dlg.cpp(28) : error C2448: '<unknown>' : function-style initializer appears to be a function definition
C:\WINDOWS\שולחן עבודה\222\Dlg.cpp(36) : error C2061: syntax error : identifier 'CDialog'
C:\WINDOWS\שולחן עבודה\222\Dlg.cpp(40) : error C2146: syntax error : missing ';' before identifier 'END_MESSAGE_MAP'
C:\WINDOWS\שולחן עבודה\222\Dlg.cpp(40) : fatal error C1004: unexpected end of file found
Generating Code...
Error executing cl.exe.
222.dll - 18 error(s), 0 warning(s)
_____________________________________________________
I anderstand that the normal way in my case is to use
the straight ATL route.
I need add manny code to this class , mainly to the methods OnOK and OnDestoy.
Can I use simple code that I use in MFC ?
|
|
|
|
|
Hi,
Inside of the constructor of an object, I want to specify a callback routine which belongs to the same object (member function). How can I do this
If my callback routine is static everything's ok, but I need a different callback routine for every object.
I read something about wrappers which should work fine if I could write the code for the caller, but I can't because it's an OpenGL function:
glutDisplayFunc (pointerToMyMemberFunction);
In the above line (which I want to use in my object's constructor) I tell OpenGL which function it has to call when the time has come to refresh the screen.
I could do something non-object-oriented with an array of function-pointers, but that's not nice
Can anyone help me??
|
|
|
|