|
I have some code like this in OnInitDialog() to set background image, Does it causing the problem?
m_PictureWindow.SubclassWindow(m_hWnd);
m_PictureWindow.m_nMessageHandler = CPictureWindow::BackGroundPaint;
m_PictureWindow.Load("D:\\image.bmp");
Did there is a Background image for your dialog when you tried?
|
|
|
|
|
Try reversing the tab order. In MSVC 6:
- Select "Layout->Tab order".
- Click on all the control from the highest number to the lowest number.
This is just a hunch.
Steve
|
|
|
|
|
Still no change: Thanks for your suggestions. Lets start again a break!!!
Steve,
How I add a windows media player control to my ATL dialog. I can't add using wizard, since it not support in ATL. Then how i get the pointer to operate the control like set the movie file, start video and stop video etc etc....
|
|
|
|
|
1. Go to the dialog editor.
2. Right click on the dialog and select "Insert ActiveX Control...".
3. Select the ActiveX control you want. I selected "Windows MEdia Player", it was last in the list.
4. Press "OK.
5. Right click on the control and select "Properties".
6. Set the properties.
Try that for a start.
Steve
|
|
|
|
|
Done already, How I identify & get the interface from the control
for example, A brwser control use <iwebbrowser2> & we can get pointer "Navigate" to WebBrowser control. Like this...
CAxWindow wndIE = GetDlgItem(IDC_OCX1);
CComPtr<iwebbrowser2> pWB2;
HRESULT hr;
hr = wndIE.QueryControl ( &pWB2 );
if ( pWB2 )
{
CComVariant v; // empty variant
pWB2->Navigate ( CComBSTR("http://www.codeproject.com/"),&v, &v, &v, &v);
}
So in case of windows media player, what must be given as "IWebBrowser2". I need interface to play, stop, pause video
Please advise I am just new comer to COM interfaces
|
|
|
|
|
There are a number of ways. In the case of the WebBrowser all the files you need already come with the compiler and it's just a matter of including them. I believe the Media Player has an SDK that will the header files you need. Alternatively you can use #import . Follow these steps to use #import :
1. Load up the "OLE View" tool that comes with Visual Studio.
2. Open up "Object Classes->Grouped by Component Category->Contols".
3. Find control in question.
4. Select it.
5. In the right pane under the "Registry" tab find the Type library location. For me it looked like this: "win32 = C:\WINDOWS\System32\wmp.dll".
6. Add #import "<TypeLibrary>" to the dialog - Where <TypeLibrary> is the path to the type library. So for me I add #import C:\WINDOWS\System32\wmp.dll"
This will generate the files you need - Look for .TLH and .TLI files in your output directory, these are what was generated by #import (when you compile).
In OLE View you can right click on a component and select "View Type Information" to view the components interface.
Then you use the control with code like this:
WMPLib::IWMPPlayer4Ptr spWMP4;<br />
HRESULT hr = GetDlgControl(IDC_OCX1, __uuidof(spWMP4), (void**)&spWMP4);<br />
if ( SUCCEEDED(hr) )<br />
{<br />
spWMP4->SOME_FUNCTION();<br />
}
That's the basic idea. I don't know how to drive the Media player control so my example doesn't do much.
Steve
|
|
|
|
|
Thanks, It worked.
But the windows media player show as pop up window, rather than show as embedded control in the parent ATL dialog. How to it in the parent dialog as embedded?
|
|
|
|
|
anilFirst wrote: I
It does? Mine shows up as a little media player on the dialog. Did you add the control to the dialog as I did (right click dialog and select add ActiveX control)?
Steve
|
|
|
|
|
Exactly same way!!! Also the poped up window is same as when we call mediaplayer from Start>programfiles>mplayer.exe
-- modified at 2:32 Tuesday 24th January, 2006
|
|
|
|
|
I always thought you had to get at least the Standard version of VC++ to be able to program WTL apps due to the fact you need ATL. Because of this I was planning on getting Visual Studio Standard 2005 soon.
Now I've just found an article on CP with instructions of how to program WTL apps with VC++ Express 2005 since you can get ATL from the Server 2003 SP1 PSDK.
Can someone who's tried it clarify for me that it is indeed possible to develop fully fledged WTL apps with VC++ Express 2005 ?
What are the drawbacks (if any) of using VC++ Express 2005 to develop WTL apps ?
|
|
|
|
|
I haven't looked at that particular build of the PSDK, but in the earlier builds, any MFC and ATL files that came with it were pre-releases and/or 64-bit versions. Not suitable for production code. (This may have changed, but double-check the SDK to be sure before you start using those files.)
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hi,
I am creating a plugin for Outlook. i have created commandbarbutton on Explorer window. Now i have to create those commandbarbuttons on inspetor window.
how can i resolve this .
Thanks in advance
regards,
RamakoteswaraRao
spend every minute for success
|
|
|
|
|
Can anybody help me how to convert MFC DLL to ATL DLL?
Srinu
|
|
|
|
|
|
I have 3 MFC DLLs(YSUTIL.DLL, YSWEB.DLL and YSCOMMON.DLL) which we cannot change and one more DLL YSWEB_STCNTY.DLL this we need to convert into ATL. YSWEB_STCNY uses some classes of above mentioned MFC DLLs.
Srinu
|
|
|
|
|
If it's an MFC extension DLL, then you can't - that type of DLL only works with an MFC app.
Otherwise, you'll need to change the global CWinApp object to a CComModule and initialize it appropriately. You can create a dummy ATL DLL project and copy the init code into your DLL's code.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
We are using STLPort 4.62 in previous version of our program.
All was work perfectly (set, map).
In the stl_user_config.h uncommented
# define _STLP_NO_OWN_IOSTREAMS 1
In a next version I try to use vector.
And...
#include <vector>
cause several errors:
c:\program files\microsoft visual studio\vc98\stl\stlport\ios.h(41) : error C2874: using-declaration causes a multiple declaration of 'ios'
c:\program files\microsoft visual studio\vc98\include\ios.h(106) : see declaration of 'ios'
etc.
Help to me, please, resolve this problem.
Victor_jv
|
|
|
|
|
Victor_jv wrote: c:\program files\microsoft visual studio\vc98\stl\stlport\ios.h(41) : error C2874: using-declaration causes a multiple declaration of 'ios'
c:\program files\microsoft visual studio\vc98\include\ios.h(106) : see declaration of 'ios' etc.
You #include iostreams from both, VC++ and STLPort. Probably a configuration problem. You need to study the STLPort documentation or ask in a STLPort forum.
|
|
|
|
|
Roland is correct. I use MSVC6 - I would check "Tools->Options..." then select the "Directories" tab. Make sure the path to STL port is higher in the list then the path to MSVCs STL implementation.
Steve
|
|
|
|
|
Since you didn't post your code, I'm not sure if you're using the standard C++ headers.
Try to avoid using non-standard headers, like <iostream.h> and <vector.h>.
Use the standard extensionless headers that are part of the C++ standard, like <iostream> and <vector>
The *.h versions are not portable, and not part of the official C++ standard.
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
Hi There
Im having problems replacing an ATL DLL in a project at the moment, lets call this DLL_A. I need to replace a DLL with a DLL_A to get info needed for a bug. The application installs and the DLLs are registered and the program runs fine. If I close down the APP, unregister the DLL and then change the DLL with DLL_A, register that with DLL_A and then Run the program, a sort of undefined behaviour happens. The DLL seems to load but It just crashes. The DLL definatly works but The application doesnt like me altering the DLL for some reason.
Even If I try and unregister DLL_A replace it with the original DLL and register that, the program still doesnt like it and I have to do a build or install all over again.
the CLSID is be the same for both and Im registering and unregistering correctly.
Is there something Im missing or extra that I need to do.
All help appreciated.
Karl
|
|
|
|
|
If all the GUIDS are the same and you've registered it all should be fine (assuming the replacment isn't cactus). Have you got details on the crash? Perhaps this will give someone a clue.
Steve
|
|
|
|
|
Hi all
What sort of control is YPagerMyStatus in Yahoo Messenger. I want to find the user's yahoo id. how can I do it. I didnt know what sort of control is it so i used WM_GETTEXT with no success
Any Suggestions?
Thanx
|
|
|
|
|
_Sanjay_ wrote: t sort of control is YPagerMyStatus in Yahoo Messenger. I want to find the user's yahoo id
its seems it Owner Created Control, where might be WM_GETTEXT message has been blocked!
"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
|
|
|
|
|
Folks,
I have been able to create a Windows Service (aka NT Service) using C# with the help of an article posted by Mahesh Chand on c-sharpcorner.
I need to create an NT Service using C++ in Visual Studio .Net. Use of ATL and MFC is OK for my application. I did not find any article/ book chapter that addresses this. I know doing so in Visual C++ Studio 6 is fairly straight forward. Unfortunately, going back to Studio 6 is a not a desirable option.
In .Net Studio, I have created both kinds of Windows Service C++ ATL Projects: (a) Attributed (default) and (b) non-attributed. Fom these projects, I am not able to figure out: (1) how to install/ uninstall the created service and (2) where to put in the business code of the Windows Service.
If any body has done it and can share tips/ code/ steps to accomplish this, I will appreciate it. You may write to me at rgoyal@esri.com.
Thanks,
Roop Goyal
|
|
|
|