|
Ann66 wrote:
I am doing a project in win32. Sometimes in XP, even after I close the app the process sits there ie. I could see my exe still up in the task manager.
ExitProces..... Why don't you use WM_QUIT message to close you application....
Ann66 wrote:
I could see my exe still up in the task manager.
Intresting... are you running any loop or you forget to free any com object..... could you tell me what exactly your application doing...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
A while back i saw a program that was able to capture an image of the entire workspace, i think by utilizing the Print_screen key on the keyboard some how!
I would like to know, how would you go about doing that with c++, and saving that image into a file?
thankz.
|
|
|
|
|
i seem to get this warning on damn near any MFC project i've used on Visual Studio .net
LINK : warning LNK4089: all references to 'OLEAUT32.dll' discarded by /OPT:REF
i looked it up and apparently the linker is decided that i dont need OLEAUT32.dll cause nothing is using it.. but i cant figure out where in the world any part of my project is mentioning OLEAUT32.dll in the first place. so im not sure why the linker thinks i wanted it in the first place
|
|
|
|
|
With many include files, they have a #pragma statement that adds the DLL/LIB as a required DLL/LIB during the link phase.
For example, COMDEF.H includes:
#pragma comment(lib, "oleaut32.lib")
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
This warning is harmless, and can be ignored if the DLL in question is one of the system DLL's. In that case, a piece of library code (which may have been omitted due to function-level linking) referenced the DLL, and you no longer need it. If the DLL in the message is one of yours, you may want to check.
Software Zen: delete this;
|
|
|
|
|
I am having trouble overiding the default tooltip text that display the tick count in a slider control.
My code is below. Any suggestion is greatly appreciated.
void CGraphView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
static CString strMinutes;
CToolTipCtrl *pTool;
if ((CSliderCtrl*)pScrollBar == &m_Slide &&
(nSBCode == SB_THUMBPOSITION || nSBCode == SB_THUMBTRACK)
)
{
pTool = m_Slide.GetToolTips();
strMinutes = "Test";
pTool->UpdateTipText(strMinutes, this);
pTool->Update();
}
CFormView::OnHScroll(nSBCode, nPos, pScrollBar);
}
Anil
|
|
|
|
|
How can I read each cell from each row in a worksheet. Can some one help me . I have tried it out. I can search a particular string. Also can some1 plz give me a good link for tutorial on it or any other reference
Regards
|
|
|
|
|
Hello All.
I'm a beginner programmer and try to make a simple web browser using C++/MFC. With the help of this site, I managed to started it. I'd like to do the control on VIEW menu (Text Size) to be changed same as in IE. I don't know how can I do it. I'd like to ask some help for the people out there. Please teach/tell me how can I start to do it.
Any help will be much appreciated.
Thanks and more power to this site.
With great power comes a great responsibility.
|
|
|
|
|
babyspidy wrote:
I'm a beginner programmer and try to make a simple web browser using C++/MFC.
So have you see the CHtmlView class?
babyspidy wrote:
I'd like to do the control on VIEW menu (Text Size) to be changed same as in IE.
I'm not exactly sure what this means?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thanks for the reply.
I have seen the CHtmlView class but not quite familiar how it works.
For the View menu found in IE menubar, there's a Text Size option which you can select Largest, Large, Medium, Small, and Smallest for the user to increase/decrease the text size. I want to do this function in my project but I don't know how I will put a function on it.
In my ****View.cpp, I put
ON_COMMAND(IDR_VIEW_LARGEST, .....)
ON_COMMAND(IDR_VIEW_LARGE, .....)
ON_COMMAND(IDR_VIEW_MEDIUM, .....)
ON_COMMAND(IDR_VIEW_SMALL, .....)
ON_COMMAND(IDR_VIEW_SMALLEST, .....)
...
but I don't know how I will implement the function for it. I hope someone knows how to handle those commands..
Thanks again and best regards.
With great power comes a great responsibility
|
|
|
|
|
If you are using CHtmlView, to obtain the current setting, try this:
VARIANT var;
ExecWB(OLECMDID_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, NULL, &var);
To set a given size, try this:
VARIANT var;
var.vt = VT_I4;
var.lVal = 1;
ExecWB(OLECMDID_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thanks for the quick response.
Where I will set the code above.
From MESSAGE_MAP, I made this:
ON_COMMAND(ID_VIEW_LARGEST, CHtmlView::OnViewLargest)
.
.
.
then, I made a function for that using the line you gave and it goes like this.
void CHtmlView::OnViewLargest()
{
/* Assuming the following is in a member function of
a class derived from CHtmlView
*/
VARIANT var;
var.vt = VT_I4;
var.lVal = 4; // 1 means small
ExecWB(OLECMDID_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
}
and so on...
Is this correct?
Sorry for being an ignorant with this matter. I am really a beginner in VC++/MFC Programmer. I hope I can overcome this.
Thanks for your patience guys and for giving some time of yours with this matter. It really helps a lot to me.
With great power comes a great responsibility.
|
|
|
|
|
You are using a view class derived from CHtmlView, right? Then, assuming your class is named CYourView and derived from CHtmlView, the lines in red are what you'd need to add:
class CYourView : public CHtmlView
{
.
.
.
<code>afx_msg void OnViewLargest();</code>
.
.
.
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(CYourView, CHtmlView)
<code>ON_COMMAND(ID_VIEW_LARGEST, OnViewLargest)</code>
.
.
.
END_MESSAGE_MAP()
.
.
.
<code>void CYourView::OnViewLargest()
{
VARIANT var;
var.vt = VT_I4;
var.lVal = 4;
ExecWB(OLECMDID_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
}</code>
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thank you very much Mr. Jose Lamas.
It works now for me.
One more thing, when I click the Small option from the View Menubar, Medium option remains checked. The checked option should be change to Small. The check always remain on Medium option, it never change to the selected Size option.
How can I do that?
Thanks again and I really appreciated your help a lot.
With great power comes a great responsibility.
-- modified at 22:05 Sunday 28th August, 2005
|
|
|
|
|
You need to add ON_UPDATE_COMMAND_UI entries with a handler for each of the options. In each handler, you can call SetRadio on the CCmdUI parameter you receive. The value for SetRadio is TRUE when the current selection (obtained as shown in previous posts) matches the value that correspond to the menu entry for which you are handling the update command message.
For example:
afx_msg void OnUpdateViewTextSize(CCmdUI* pCmdUI);
ON_UPDATE_COMMAND_UI(ID_VIEW_SMALLEST, OnUpdateViewTextSize)
ON_UPDATE_COMMAND_UI(ID_VIEW_SMALL, OnUpdateViewTextSize)
ON_UPDATE_COMMAND_UI(ID_VIEW_MEDIUM, OnUpdateViewTextSize)
ON_UPDATE_COMMAND_UI(ID_VIEW_LARGE, OnUpdateViewTextSize)
ON_UPDATE_COMMAND_UI(ID_VIEW_LARGEST, OnUpdateViewTextSize)
long GetTextSizeFromMenuID(UINT nId)
{
long lVal = 2;
switch (nId)
{
default:
ASSERT(FALSE);
break;
case ID_VIEW_SMALLEST:
lVal = 0;
break;
case ID_VIEW_SMALL:
lVal = 1;
break;
case ID_VIEW_MEDIUM:
lVal = 2;
break;
case ID_VIEW_LARGE:
lVal = 3;
break;
case ID_VIEW_LARGEST:
lVal = 4;
break;
}
return lVal;
}
void CYourView::OnUpdateViewTextSize(CCmdUI* pCmdUI)
{
long lSize = GetTextSizeFromMenuID(pCmdUI->m_nID);
VARIANT var;
ExecWB(OLECMDID_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, NULL, &var);
pCmdUI->SetRadio(var.vt == VT_I4 && var.lVal == lSize);
}
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thank you very much Mr. Jose Lamas Rios.
I made it now. It really helps me a lot. I can now continue my project. I really appreciated your help here.
By the way, I would like to ask, is there's a way of showing a html that is within the resources but its not declared in .rc. I have read some forum regarding on CHtmlView using LoadFromResource command but it is necessary that all html files in res should be declared in .rc file. And for using Navigate command, the path or directory of the html file is required. If I used the resource path, still it needs to be declared in .rc. Is it possible to view the html file that is not declared in .rc?
Thanks again and best regards. More power to you Mr. Jose Lamas Rios. You're the man! More blessings for you.
With great power comes a great responsibility.
|
|
|
|
|
Hi,
I am trying to put together a Video Clip organizer for all of my captured AVI file clips.
I need to be able to get it to play the clip so that I can see what it was in order to catalog it, so I went for the "simplest" method using MCIWndCreate() and MCIWndPlay() etc...
Unfortunately when I try this, I get a message; "Video not available: Cannot find 'vids:dvsd' decompressor."
But if I just click the clip in explorer, it plays OK in Windows Media Player (v10)....
I am using Visual Studio.net 2003 on WinXP Professional.
At the same time I am using some AVIFile functions within the program to access various stream information from the file; if this is relevant in any way.
Anyone have any idea why this is happenning, and how to fix it, or is there a better way to get the clip to play?
Thanks,
Bryan.
|
|
|
|
|
OK, I didn't have a dvds codec installed on my development machine.
Just installed a frre one and all is well now.
Bryan.
|
|
|
|
|
I am trying to call a Fortran dll in my c++ code.
The fortran bit is as follows:
<br />
subroutine swap(x,y,z)<br />
real , intent(inout) :: x<br />
real , intent(inout) :: y<br />
real , intent(out) :: z<br />
real :: t<br />
!<br />
!DEC$ATTRIBUTES dllexport :: swap<br />
!DEC$ATTRIBUTES DEFAULT, DECORATE, ALIAS: 'swap' :: swap<br />
!<br />
t=x<br />
x=y<br />
y=t<br />
z=1.23<br />
end subroutine swap<br />
<\code><br />
<br />
The C++ calling code is:<br />
<br />
<code><br />
#include <iostream><br />
using namespace std;<br />
extern "C" __declspec(dllimport)void swap(double &x, double &y,double &z);<br />
int main() <br />
{<br />
double x,y,z;<br />
x = 10;<br />
y = 999;<br />
swap(x,y,z);<br />
cout<<x<<"\t"<<y<<"\t"<<z<<endl;<br />
return="" 0;<br />
}<br />
<\code=""><br />
<br />
There are some problems however. x and y are not swapped but they do display their original values on the console. And z has not been assigned a value. I think it's a problem with the C++ bit but I could be wrong. The good thing is that it compiles and executes.<br />
I will eventually try and do this in C# but one step at a time ;)<br />
<br />
Kash
|
|
|
|
|
Kash wrote:
extern "C" __declspec(dllimport)void swap(double &x, double &y,double &z);
Does Fortran support references? What happens if you change this to:
extern "C" __declspec(dllimport)void swap(double *x, double *y,double *z);
...
swap(&x, &y, &z);
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
If that version of Fortran supports pointers, then it probably can support references indirectly. After all, under the hood, a reference is just a pointer without the dereferencing symantics.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hello all,
Could anyone tell me how to obtain the index of the selected item from a CMenu control?
The reason I want it is so that I can call CMenu::GetMenuString(int index,...); My goal is really to obtain the text of the selection. If anyone knows an easier way, I'd be happy to learn it.
-----------------
Genaro
\\\|
_ _
@ @
_\\
--|
_/
|
|
|
|
|
As the menu selection chnages you receive WM_MENUSELECT messages. You can use this with the command ID to get what you need, unless you need it after the selection has completed and the menu been dismissed.
If you vote me down, my score will only get lower
|
|
|
|
|
The menu is actually a popup menu... View/Doc... can I still use this message?
-----------------
Genaro
\\\|
_ _
@ @
_\\
--|
_/
|
|
|
|
|
Yes, but you have to map it in the window that owns the menu (the HWND or CWnd parameter passed to TrackPopupMenu)
If you vote me down, my score will only get lower
|
|
|
|
|