|
I'm working in a VC++ Project. In this project, the key F12 is assigned as a Virtual key for doing something. When I run the exe I got a strange exception which states "Unhandled exception. User break point". I'm saying it's strange because When I debug the project, the exception is thrown. But if I press CTRL+F5 to debug the project the exception is not thrown. What to do overcome this exception? Can anyone help?
|
|
|
|
|
Use some message boxes during runtime (not debugging) to approach what line throws the exception. And then maybe you will know the solution, or you can post that code snippet here!
For example:
CString sTxt;
sTxt.Format("%s (%d)", __FILE__, __LINE__);
AfxMessageBox(sTxt);
Maxwell Chen
|
|
|
|
|
If I break the exception,the control goes to this function.
BOOL CPerspectiveApp::OnIdle(LONG lCount)
{
CWinApp::OnIdle(lCount);
if(CWnd::GetFocus() == NULL)
return TRUE;
if(m_pkRenderView)
m_pkRenderView->OnIdle();
theJoystick.Read();
return TRUE;
}
CPerspectiveApp is a class derived from CWinApp. But the corresponding to thekey F12 is,
if(nChar == VK_F12)
{
m_pDoc->ResetTime();
}
Can u Pls help?
|
|
|
|
|
How do you say, the exception is due the F12 key event handling, In the your post you didn't say exception occur when F12 key is pressed.
Exactly where the exception occurs, you said the call stack is on CPerspectiveApp::OnIdle(), but which statement.
from the code, I think the exception occured on
m_pkRenderView->OnIdle();
May be you are not initialising m_pkRenderView to NULL, and while in debug OnIdle may be called before creating the object m_pkRenderView and crashed, while in release, OnIdle may be called after creating the Object m_pkRenderView. where you are creating the object m_pkRenderView.
Which statement caused the exception.
|
|
|
|
|
|
I am developing an mfc application. in this application i am using windows media player activex control to display the video. now when i embed the control into the screen i am getting the slider bar and the buttons. i only want the screen. i want to make my own playing options. is it possible to do that way? please give me some leads.
|
|
|
|
|
Have you installed WMPSDK.
Chandrasekharanp wrote: i only want the screen
IWMPPlayer::put_uiMode[^]
HRESULT put_uiMode(
BSTR bstrMode
);
"none" - Windows Media Player is embedded without controls, and with only the video or visualization window displayed.
Chandrasekharanp wrote: i want to make my own playing options.
what about skinning Media player, Windows Media Player Skins[^]
|
|
|
|
|
Do i need to install wmpsdk for that?? i could also figure out that wmp11 can play mp2 formats. but i am not being able to play that. what can be the reason for that?
by installing this sdk can i use the functionalities in MFC?
modified on Thursday, February 28, 2008 1:08 AM
|
|
|
|
|
Chandrasekharanp wrote: i could also figure out that wmp11 can play mp2 formats
AFAIK, with out external MPEG2 decoder, Media player doenot support MPEG2 playback. you need to install in XP as OS by default doesnot provide one, I think you figured out that in vista, vista (premium, ultimate) by default loaded with MPEG2 decoder.
Plug-ins for Windows Media Player[^]
Chandrasekharanp wrote: but i am not being able to play that
I guess that you are using XP (not vista). what about the MPEG2 decoder you already installed some days before?
Chandrasekharanp wrote: Do i need to install wmpsdk for that??
I didn't used WMP, i used DSHOW only, the API i got from WMPSDK doc. if you can figure out from activeX API, i think you don't want to install SDK.
Chandrasekharanp wrote: by installing this sdk can i use the functionalities in MFC?
It is COM based API, you ca use any language that supports COM.
modified on Thursday, February 28, 2008 1:41 AM
|
|
|
|
|
Rajkumar R wrote:
AFAIK, with out external MPEG2 decoder, Media player doenot support MPEG2 playback. you need to install in XP as OS by default doesnot provide one, I think you figured out that in vista, vista (premium, ultimate) by default loaded with MPEG2 decoder.
In vista it does play. the system which plays Mp2 format runs in Windows XP.
i have not installed that decoder.. but have got some source code. so trying to use that to run the mp2 file.
|
|
|
|
|
Its better to use the WMPSDK, the sample WMPHost is well written, the has menus to set the uimode, that is you can set from menu to hide the Media Player controls. WMPSDK is nothing but the headers and samples to use the WMP ActiveX controls. Give a try.
|
|
|
|
|
ya i shall certainly give it a try.
before that i was trying to play a wmv file using windows media player activex control. when u embed that and create a member veriable u get lots of wrapper classes attached to the player.
now i am trying to get the volume from the media player.i am attaching the code for reference.
<br />
m_edit = m_value.m_setting.GetVolume();<br />
UpdateData(FALSE);<br />
i have declared m_edit as long.
m_value is the member variale for media player
and m_setting is the variable for CWMPSettings.
but i am getting some junk value as the result. what needs to be done for this to display the value in the editbox. infact none of the API's are working. all the .h files have been defined. but still no result. please give me a solution for this,
|
|
|
|
|
i resolved the above mentioned problem. i dont need to create a new member variable for all the classes.
this is for those who is working on windows media player who doesnt have much information
when u embed the media player ocx and open class wizard to create a variable it c++ creates wrapper classes for it. and the API's that are available will have Get/Set functions. this will directly link to the wrapper classes.
for example
m_value is the media player variable name
<br />
m_value.GetControls().play()<br />
here m_value calls WMPControls wrapper class and then calls the play function.
Thanks,
|
|
|
|
|
Good to hear you solved the problem.
Chandrasekharanp wrote: i dont need to create a new member variable for all the classes.
so you used multiple variable over the single ocx.
I hope you are now able to find the api to set the uimode to hide the WMP controls.
|
|
|
|
|
Hi,
I have a query about the DUN and PPP and hope that someone can point me in the right direction to proceed on. I am programming a console application in C that will be used on Windows platform and maybe other platforms in future. The application will be used by a laptop/PC to connect to the Internet by using the DUN profile of a bluetooth capable mobile phone.
I have managed to connect to the mobile phone and make a call to a normal phone number using the ATcommands. But I understand that to connect to the Internet thru the GPRS, I also have to implement the Point to Point Protocol. If that is so, how can I go about it? Please do correct me if my understanding is wrong.
Any pointers to set me in the right direction is greatly appreciated.
Thanks and regards,
Loh
|
|
|
|
|
probably the easy way would be to create a modem driver and use the windows PPP and tcp/ip implementations for the connection.
Don't try it, just do it!
|
|
|
|
|
Thanks for your reply. To create a modem driver is really beyond my knowledge now. But I am willing to do it. Do you have any recommended readings or resources on creating modem drivers and windows PPP and TCP/IP?
|
|
|
|
|
the windows DDK (now WDK) is always a good source for driver programming.
you can get a copy via MSDN (subscriber) or via http://connect.microsoft.com
Don't try it, just do it!
|
|
|
|
|
dear all
which keys are available to format our code in editor? it makes easily to read? i mean which keys we can press to format our code? thanks
Li Zhiyuan
|
|
|
|
|
Highlight lines, and press ALT + F8 .
Maxwell Chen
|
|
|
|
|
li zhiyuan wrote: which keys are available to format our code in editor?
Actually all the keys are available.
if you want the shortcut keys search msdn for shortcut keys,
Text Manipulation Shortcut Keys[^]
|
|
|
|
|
Hi,
I am wondering about a way to monitor a process that I create to see if it opens a file and then get the filename. I have no access to the process code itself. I just have the handle to the process.
Thanks,
Clint
csmithmaui
"Turn My Headphones Up!"
|
|
|
|
|
there are ways to do that, but they might be tricky...
one way is polling the open handles of the process with ZwQuerySystemInformation with argument SystemHandleInformation from ntdll.dll.
another way could be injecting a dll to the target process and hooking the api functions (e.g. CreateFileA/W), or creating a device filter driver (which can be very nasty)..
if you don't need this feature permanently in your application (e.g. just for one special case for analysing another application or so), you can use Filemon from www.sysinternals.com.
Don't try it, just do it!
|
|
|
|
|
I know this sounds like a hijack , however I would need to associate my application , with the system-provided , Autoplay notification icon .
In other words is it possible to
1. pop-up a custom menu when the user clicks this icon ?
2. Perform custom actions with each of the menu items ?
I dont want to create another tray icon as my use case is related to this sys tray icon .
eg: When a camera is connected and the icon is present, I would want to provide menu options to open the folder to view the files
Engineering is the effort !
|
|
|
|
|
you could use a windows hook to intersect the window messages sent by the tray icon for example.
Don't try it, just do it!
|
|
|
|