|
Hi Ajay,
I can't attach to the process, because of dll is calling at the begining of the fork.
Thank you.
Orkun GEDiK
Senior SAP R/3 Basis and Development Consultant
ASTRON
|
|
|
|
|
Hi,
I am trying to plot the wavform of wav file.In my case the wavfile consists of 6112 samples and having 8 bits per sample.byterate is 4395 bytes /s.Roughly it is equal to about 1.39 seconds of sample data.I want to plot this giving time on x axis and the sample amplitude on y axis.
I am not able to normalize such that 6112 samples can be represented on the scale of 0 to 1.39 seconds.Any hints or suggestions are welcome.
Regards,
Mayank
|
|
|
|
|
What exactly is your problem?
To calculate the X (-time) axis of the spectrum from the sample rate and the sample number?
time = samplerate * sampleno
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
To plot this properly you need to establish the range of values represented by each x-axis pixel and then plot a vertical line. Unless the plot area allows more than one pixel per sample.
struct Plot
{
int y_min;
int y_max;
}
samples_per_xaxis_pixels = number_of_samples / display_width;
Plot * plot_array = new Plot[ display_width / number_of_samples ];
for(int x=0,i=0;x<number_of_samples;i++,x+=samples_per_xaxis_pixels)
{
int y_min = INTMAX;
int y_max = -INTMAX;
for(i=x;i<x+samples_per_xaxis_pixels;x++)
{
plot_array[i].y_min = samples_array[x]<plot_array[i].y_min?samples_array[x]:plot_array[i].y_min;
plot_array[i].y_max = samples_array[x]>plot_array[i].y_max?samples_array[x]:plot_array[i].y_max;
}
}
And then plot it !
|
|
|
|
|
Hi,
Thanks for your reply.Actually in my case the samples=6112(with wach sample amplitude value between 0 and 255) and on x axis i have to represent these 6112 samples in a total of 1.39 seconds.Roughly if i divide x axis into parts of 100 ms then there are 13 such parts in which i have to divide 6112 samples,so if the display_width in the above case comes out to be 13 .
Thanks and Regards,
Mayank
|
|
|
|
|
I am developing an application that saves files as different file types. I am concerned with the .XML. How do you modify the tooltip when the operator hovers his/her mouse over the file if the file type is .XML? The XML document is defaulted to display the type, date modified, and size in the infotip (tooltip). Is there any programming I can do using C++/MFC to modify these contents? I have been told look into using shell scripting, but this application is to be installed on other machines with Windows XP.
|
|
|
|
|
What context is the user hovering over the file in Explorer or in you own application ?
|
|
|
|
|
|
|
First I tried to enable and disable menu item's in main frame window like this:
CMenu *m = GetMenu()->GetSubMenu(1);
m->EnableMenuItem(ID_SCHEME_SELMOVE, bEnabled);
m->EnableMenuItem(ID_SCHEME_HAND, bEnabled);
m->EnableMenuItem(ID_SCHEME_SCALEUP, bEnabled);
m->EnableMenuItem(ID_SCHEME_SCALEDOWN, bEnabled);
This code didn't work until I've add this in frame constructor.
CMainFrame::CMainFrame()
{
m_bAutoMenuEnable = FALSE; //disables auto menu enable
}
Now, I can't enable and disable toolbar buttons:
m_wndViewToolBar.GetToolBarCtrl().EnableButton(ID_SCHEME_SELMOVE, b);
m_wndViewToolBar.GetToolBarCtrl().EnableButton(ID_SCHEME_HAND, b);
m_wndViewToolBar.GetToolBarCtrl().EnableButton(ID_SCHEME_SCALEUP, b);
m_wndViewToolBar.GetToolBarCtrl().EnableButton(ID_SCHEME_SCALEDOWN, b);
I think there is should be a mechanism to disable automatic toolbar enable.
What is that mechanism?
|
|
|
|
|
MFC is set up to not require you constantly maintain and update the state of the menu/toolbars.
It asks you how to display the toolbars/menu item through update handlers.
In the "wizard" where you set up a handler for the menu or toolbar, you can also choose to add an update handler that the system will call whenever displaying them.
void CYourView::OnUpdateViewSomeMenuItem(CCmdUI *pCmdUI)
{
// TODO: Add your command update UI handler code here
if (/*Some Condition*/) {
pCmdUI->Enabled(TRUE);
} else {
pCmdUI->Enabled(FALSE);
}
// Also can set the checked state here
if (/*Some Condition*/) {
pCmdUI->SetCheck(TRUE);
}
}
|
|
|
|
|
Can you use the regular MFC command enabling mechanism?
ON_UPDATE_COMMAND_UI(ID_SCHEME_SELMOVE, OnUpdateSchemeSelMove)
...
void CMainFrame::OnUpdateSchemeSelMove(CCmdUI* pCmdUI)
{
pCmdUI->Enable(false);
} Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks a lot, that was helpful.
|
|
|
|
|
Using DirectShow I have made a program that captures a video stream and writes the data to screen and to disk. Rendering to screen is done by using IVMRWindowlessControl.
Problems occur when the desktop is locked, e.g. by the screensaver. After unlocking, the rendering part of my application is gray. Calling IVMRWindowlessControl:: RepaintVideo refreshes this rendering part but resets the framecounter and the video contents.
Any ideas how to solve this problem?
Best regards,
Peter
|
|
|
|
|
can you get a handle to the window and call InvalidateRect
BOOL InvalidateRect(
HWND hWnd, // handle to window
CONST RECT* lpRect, // rectangle coordinates
BOOL bErase // erase state
);
|
|
|
|
|
Hi, I have a small problem with my ListCtrl.
I noticed when writing code for HDN_ITEMCLICK notify message, that this will be affected only if I click on a far left side. When I click on item label I cant get click notification!!!
Why is this?
I'm using one column with no header and only text, I added LVS_EX_TRACKSELECT | LVS_EX_FULLROWSELECT stayls!
Thanks.
|
|
|
|
|
I'm not sure how the header notification HDN_ITEMCLICK applies to LVS_EX_FULLROWSELECT.
Maybe LVN_ITEMACTIVATE is the notification you're looking for?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for yours answer!
How to implement LVN_ITEMACTIVATE?
This is a notify messeage, I cant find it with "Add Windows Message Handler..."
I use vc++ 6.0!
-- modified at 4:16 Wednesday 12th September, 2007
|
|
|
|
|
Here's one way (I can't remember if it was the same in VC 6)
ON_NOTIFY(LVN_ITEMACTIVATE, ID_MYLISTVIEWCTRL, OnMyLVNItemActivate)
void OnMyLVNItemActivate(NMHDR *pNotifyStruct, LRESULT *result)
{
...
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
In my last project I was using a CListCtrl with dinamic number of rows and columns. I managed the selection of a click with...
void CMyTabView::OnClickTab(NMHDR* pNMHDR, LRESULT* pResult)
{ POSITION pos = m_clcTabList.GetFirstSelectedItemPosition();
if (!pos)
{ m_nRowNum = -1;
UpdateData (FALSE);
}
while (pos)
{ int nPos = m_clcTabList.GetNextSelectedItem(pos);
m_nRowNum = nPos;
UpdateData (FALSE);
}
Invalidate (); UpdateWindow ();
*pResult = 0;
return;
}
Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi,
I have implemented Client and server applications using Named pipes.
Server is written as a Service. This is working fine in admin user mode, Server (service) and client able to communicate properly.
where as in a guest user mode , Server is able to start( at the startup service starts automatically). But client not able to connect getting access denied error.
Not sure any privilizes have to provide while creating a pipe or creating a file from client.
Can any one help me out in this.
Nagadravid
|
|
|
|
|
I think your OS is Vista! It is so sure, that you cant do think the easy way.
You got to create accessable objects in your service. This is a sample from the great Micheal Dunn, which should help you: http://www.codeproject.com/vista-security/PMSurvivalGuide.asp
Greetings from Germany
|
|
|
|
|
Thanks Karstenk.
My OS is XP. One thing m not able to understand is if I run server as a normal console application (rather than as a service), even in guest usermode it is working fine. but in case of service it is failing.
|
|
|
|
|
What account is your service running in the context of?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Service is running in Local system account (admin mode). Below are the service creation properties.
CreateService(
shSCManager, // SCM database
m_pServiceName, // name of service
m_pServiceName, // service name to display
SERVICE_ALL_ACCESS, // desired access
SERVICE_WIN32_OWN_PROCESS |SERVICE_INTERACTIVE_PROCESS, // service type
SERVICE_AUTO_START, // start type
SERVICE_ERROR_CRITICAL, // error control type
szServicePath, // path to service's binary
NULL, // no load ordering group
NULL, // no tag identifier
NULL, // no dependencies
NULL, // LocalSystem account
NULL);
There is no dependencies on the service.
|
|
|
|