|
Kindly tell me as, is there any function to find the install path of MSOffice/Microsoft VC++. I tried SHGetFolderPath but in vain.
|
|
|
|
|
You could look in HKLM\SOFTWARE\Microsoft\Office\11.0\Common\InstallRoot, assuming you are using Office 2003.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
harsha u wrote: I have to create a CFont object,with a perticulat size in points, of a perticular face type. I also want to specify the weight (Bold or not).
I have created a font using CFont::CreateFont(). But then i have to pass the size in terms of height and width (not in pt). I need to specify the size in pt.
Actually, it is very difficult to understand , what you are saying.
Probably, you can have a look at LOGFONT .
harsha u wrote: I have also tried this:
CFont *font;
font->CreatePointFont(120,"Arial",this->GetDC());
It is throwing an exception
It is because, you are using uninitialized pointer.
Prasad
MS MVP - VC++
|
|
|
|
|
I am new to VS2005.I am facing this error message and the application closes. Can i want to know what causes this error and what is the solution
S.Yamini
|
|
|
|
|
Yes: start your debugger and see where the program crashes. In most of the cases, it will give you enough info to solve the problem.
|
|
|
|
|
Thanks.I found my probelm.I am using dislog based application. Actually I am using a CImage Class which is derived from CStatic.I have to connect this derived class to a picture control and I have to add a control member variable to the picture control ,This control member variable should have a data type CImage instead of CStatic. I am using VS2005.
S.Yamini
|
|
|
|
|
You derived a CStatic class and on that class use of CImage class,right?
|
|
|
|
|
I have a radio button with ID say, "BTN_RADIO"
I'm trying to control it directly without creating any variables.
Like:
<br />
(CButton*)this->GetDlgItem(BTN_RADIO)<br />
It's fine it works with some thing like ,
<br />
((CButton*)this->GetDlgItem(BTN_RADIO))->ShowWindow(true);<br />
But why the same doesn't work with EnableWindow() ?
For example,
<br />
((CButton*)this->GetDlgItem(BTN_RADIO))->EnableWindow(true);<br />
This doesn't work. Why?
Also , you've got a puzzle here : Clickety[^]
|
|
|
|
|
VuNic wrote: But why the same doesn't work with EnableWindow() ?
It does work.
Probably, you need to give some more information, if at all there is such behaviour.
In short, I could not reproduce it.
Prasad
MS MVP - VC++
|
|
|
|
|
VuNic wrote: This doesn't work. Why?
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
David,
I guess, there should not be any problem with OP's code. I wonder how it could be related to post refered by you ?
Probably, he has missed some thing to tell altogether.
Prasad
MS MVP - VC++
|
|
|
|
|
prasad_som wrote: I wonder how it could be related to post refered by you ?
My post was related as he apparently had a lack of understanding of how GetDlgItem() works.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Just noticing your reply! thanks David, let me have a look at it.
|
|
|
|
|
Hi,
please if you could tell me what type of project I need to use if I want to create process that will run on startup and the whole time computer is turned on.
Process will be monitoring WM message and try to grip user selection. For example catch 'on_mouse_left_button_down,on_mouse_move, on_mouse_left_button_up...
tkx!
P.S. I'm using VC++ 6.0
|
|
|
|
|
Are you looking for some combination of windows services and a hook installed for trapping up all the WM messages?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Yes it would be some kind of a hook for trapping earlier mentioned messages!
THX
|
|
|
|
|
Hello
I need help to add the crystal repot chart object into a report using VC++.
I am using Crystal Report XI and Visual C++ 6.0.
I have two fields based on which i must generate a graph on the report(Dynamically).
Kindly provide me the information to achieve this.
Thank you
Kind Regards
Sandy
|
|
|
|
|
I have been trying to make a window (not dialog) modal without using any of the SDK/MFC functionality provided for this (I am trying to understand how it works internally), but it doesn't seem to be work. This is what I have tried.
* Create the main window with a button.
* On the button press, create a child window with its own windows proc (this will be our modal window) with a button on it (to close it)
* Disable the main window, show the child window and start a standard message loop.
* If the button on the child window is pressed set a flag to ensure we end the message loop
Unfortunately, as soon as the secondary (child window) loop starts, the whole UI freezes up - it responds to neither keyboard nor mouse events (although it still paints fine). Both my main as well as modal message loops are the same:
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
The code above does not show the 'EndDialog' mechanism, but thats not the problem. I wish to know why keyboard and mouse events are not being handled. Therea are no issues if I dont start the message loop (ie. create a 'modeless' window).
--- NAF
|
|
|
|
|
I imagine when you disable the main window, your child window gets disabled as well.
Maybe try disabling the main window before creating the child (that's what MFC does when
creating modal dialogs).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
you might need to set the focus to the child window, otherwise it will not get keyboard and mouses messages, are you doing this?
Yours Truly, The One and Only!
|
|
|
|
|
I have tried that, but doesn't work
Anyway, the focus is required only for the keyboard not the mouse.
|
|
|
|
|
Hi,
I am a bit confused on how to make and use a timer. Currently I have
<br />
void MyClass::func()<br />
{<br />
<br />
<br />
UINT m_Timer = SetTimer(1, 2000, 0);<br />
CMainFrame *pFrame = (CMainFrame *)AfxGetMainWnd();<br />
ASSERT(pFrame != NULL);<br />
pFrame->OnTimer(1);<br />
<br />
}<br />
where
<br />
void CMainFrame::OnTimer(UINT nIDEvent) <br />
{<br />
<br />
FlashScreen();<br />
CWnd::OnTimer(nIDEvent);<br />
<br />
}<br />
<br />
I wish the screen to blink every 2 seconds. What I dont understand in the examples I have seen is that OnTimer is not explicitly called. So if you have 2 timers how does each timer know which OnTimer to call? I know that the 1st parameter in the SetTimer function is the nIDEvent which is supposed to be assciociated with the OnTimer() to uniquely identify the timer. I hope that you could provide me with an example where OnTimer is invoked? Thanks!
|
|
|
|
|
OnTimer() is not supposed to be called directly, rather when the timer expires, your app will receive a message and this handler will get called. If you have more than one timer, the nIDEvent should be used to identify it. This is the same value that you passed to SetTimer() as the first argument. So you should specify different values for the first param for each timer attached to a particular window.
|
|
|
|
|
Hey thanks for your reply. So in my class where I have defined the function
<br />
void CMainFrame::OnTimer(UINT nIDEvent) <br />
{<br />
<br />
FlashScreen();<br />
CWnd::OnTimer(nIDEvent);<br />
<br />
}<br />
you're saying it is invoked when the time expires as defined in the SetTimer() function (in my case 2000ms). I put a break point in the function above but unfortunately it was not hit... errr isn't it supposed to be if the function is invoked after the 2000ms?
Thanks.
|
|
|
|
|
yes it should happen after 2s, if its not happening perhaps you have not set up the message map for WM_TIMER?
|
|
|
|