|
Hi, I'm having a problem with a dialog. I need my dialog box to recieve/intercept all keyboard events that go on inside, but I'm getting problems where only the controls are reciving the keyboard events. Presumably only the window with the focus can ever recieve keyboard message. My dialog simply does not recieive any OnChar, OnKeyDown, or OnSysChar events. So I implemented OnKillFocus in the dialog like so...
void CMyDialog::OnKillFocus(CWnd* pNewWnd)
{
CWnd::OnKillFocus(pNewWnd);
SetFocus();
} However this seems to make all my buttons totally unclickable! Does anyone have a solution to this at all?
Joel Holdsworth
|
|
|
|
|
You might want to try overriding PreTranslateMessage for your dialog.
|
|
|
|
|
I want write a doc file using Visual c++. I found a lot of microsoft examples but don't work.
Somebody has a project that work that i can use als examples?
Thanks a lot
|
|
|
|
|
|
Thaks a lot but there aren't examples for office 2003.
My problem is that when i select the wrapped class, the file msword*.h and msword*.cpp aren't created but in the project i find only files for single classes that i selected (Capplication.h,CDocments.h,....)
Understand you my problem? Thanks a lot and i hope you understand my english
|
|
|
|
|
Can you give me more details on what you are attempting to do? Are you trying to use a framework such as MFC or just plain Win32 API? Are you trying to use the #import statement?
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
I'm using MFC, and i tryed to use the #import but don't work.
I thing the biggest problem is my office version that is 2003. When i add the wrapped class (type library), there isn't file like msword*.h in my project but only a lot of new class for word (for example CApplication.h, CDocuments.h, CDocument0.h,......).
Undestand you my problem?
thanks
|
|
|
|
|
The article I suggested to you contains sample code to be used with visual studio 6 and I'm assuming you have VS.NET 2002 or 2003. You can still use the sample code with just some minor modifications.
To start with the 'Add Class' wizard generates a header file for each class rather than one file for the whole type library. This means you need to add an include statement for each class you use.
Next the class names have changed. What was _Application in Word2000 is now CApplication in Word2003 likewise _Documents has changed to CDocuments and _Document has changed to CDocument0. If you look at the header file names the class wizard adds to your project you can work it out.
Finally the function names have changed. For instance GetActiveDocument() has changed to get_ActiveDocument() and SetVisible() has changed to put_Visible(). In general the functions are now called get_'property name' to retrieve the value of a property or put_'property name' to set the value of a property.
If you would like a very basic VS.NET 2003 MFC dialog project that generates a word document I would be happy to send one to you.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
hallo!
very very thanks for your answer!
i don't have now a lot of time but tomorrow i try!
if you can send me your project files it's for me very good!! (my email address is tiziacaia@hotmail.com)
thank a lot another time!
|
|
|
|
|
I thanks a lot for your answer!
I make what do you say and now i haven't error when i build my project but when the document is opening i get an error but the message don't help me to understand this error.
If you can send me your project i'm very happy!
thanks a lot another time and i'm sorry for my english!
bye
|
|
|
|
|
I sent you the project a couple of days ago to the address you specified. Let me know if you need it sent to a different address. Alternatively if you have a small test project you would like me look at you can mail it to (steve . thresher @ ukonline . co . uk) remove the brakets and blanks.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
i see now your mail for example project but there isn't atachment!
if you can try to resend me i thanks you a lot.
|
|
|
|
|
hi, i want to know how i can get back the data from click event of the list control?
i received a these 2 pointers, (NMHDR *pNMHDR, LRESULT *pResult). i think i need to have a typecast to get back my data.
how can i get the position i click on the list so that i can get back my data from CListCtrl::GetItem() or CListCtrl::GetItemData()?
any help?
thanks?
|
|
|
|
|
You have to call HitTest() function to check which item of List Control is hit. After getting Handle to that item, you can do whatever you want.
You can find Articles here on CodeProject for this. Sorry, I am too tired to search for those. You have to do it yourself.
Imagine that you are creating a fabric of human destiny with the object of making men happy in the end, giving them peace and rest at last, but that it was essential and inevitable to torture to death only one tiny creature..and to found that edifice on its unavenged tears, would you consent to be the architect on those conditions? Tell me, and tell me the truth!
-Fyodor Dostoevsky, The Brothers Karamazov
|
|
|
|
|
Try casting to LPNMLISTVIEW:
LPNMLISTVIEW p = (LPNMLISTVIEW) pNMHDR;
|
|
|
|
|
oh! i solved the problem. thank you very much!
actually, how can u get this?
i can't get any hints from MSDN library.
|
|
|
|
|
Hi there,
I know that it's bad coding practice to have public data members but what if you have a private struct containing about 10 fields. If I create a public struct containing the exact same fields and set each field to something, can I pass that public struct as a parameter to the mutator method to set the private data members to?
Does this fall under poor coding practices category or is it an exception to the rule?
Thanks!
|
|
|
|
|
Hi
I want to know if the entered user is active or not ? I am developing this application on Windows2000 Professional. Using Win32 Console Based Application.
Is there any function which on providing UserName, Password and Domain tells us that given User is Active or not ?
Plz...Can't u do this for me ?
Thanking You
Anonymous
|
|
|
|
|
Do you mean is the user account enabled?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Take a look at NetUserGetInfo() using level 1. The USER_INFO_1 structure has a field called usri1_flags .
Then do something like
:
if ((usri1_flags & UF_ACCOUNTDISABLE) == UF_ACCOUNTDISABLE)
{
}
:
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
While LOGBRUSH's lbStyle is BS_DIBPATTERN,how to construction a pattern brush?
I read MSDN but can't understand,what's "a packed DIB",How to "fills the memory with the packed DIB"?By the way,what's difference between BS_DIBPATTERN,BS_DIBPATTERNPT and BS_PATTERN?
Who can show me some example of CBrush::CreateBrushIndirect() while lbStyle is BS_DIBPATTERN?
|
|
|
|
|
hi i have a function that is being passed a reference to a vector
the function crashes on an assert. in an area before the vector is even accessed
however if i comment the line where the vector is accessed the function executes no problems
the thing is tho when its not commented it crashes way before the vector is even called
i have stepped through the function an its giving me the assert area basicly when first thing in the function is called no where even near the vector im actualy using the same vector before the function is even called and doing similar things to it in the function before so i know that the vector is valid. and if i rearrange the functions it still crashes in the same function at the same place id paste the code but its fairly large and i doubt it would be much help
can someone please give me some advice
|
|
|
|
|
have you followed the call stack? Often you can find out there were it goes wrong.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Is this function exported one from a dll?If it is then try to change the runtime library in the project settings (and look for "STL access violation DLL" keywords in MSDN).
|
|
|
|
|
Where is the assert? Is it in your code or in the STL code for vector?
What is the assert checking?
|
|
|
|