|
No. I need VC++ code to combine them. I need to embed it into my application. Do you have any sample code which can direct me?
|
|
|
|
|
i dont have a sample code with me. but i feel that the classes in DirectX SDK will help you in doing that.
You need to download the SDK from Microsoft site. Its freely available
|
|
|
|
|
Nikhil_7777 wrote: . I need VC++ code to combine them.
If you are a programmer, write code because you are paid to do it. If you are not a programmer, hire one.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
You can use DirectShow from C++, and it's probably the best way to do things like this.
However, if you want an alternative, have a look at the Windows Multimedia functions (AVIFileOpen, AVIStreamRead, AVIStreamWrite etc.). Note that they do have limitations, and DirectShow is the better option.
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
I was working on a GPL project so I thought and used another GPL Project ffmpeg and used it. I'm done now (for now)
Thanks a lot
|
|
|
|
|
Hello,
I am trying to send a message across processes. However, the message is not successfully sent.
Here is what happens:
a) If the process (from which message is to be sent) is not elevated, then GetLastError returns 5 which means access error.
b) If the process (from which message is to sent) is elevated, then the message is sucessfully sent.
Now the problem is I cannot elevate the process. Is there any work around or possible solution.
Thanks.
|
|
|
|
|
I think you need to indicate what o/s, what version of c++, and how you are sending the message - eg postmessage, sendmessage, carrier-pidgeon for others to help/make sense of your request
'g'
|
|
|
|
|
OK. Here are the details:
I am using Windows Vista. I am developing the application using VS 2005 (C++). I have tried PostMessage & SendMessage. Both have same behavior in both cases.
Thanks.
|
|
|
|
|
Look at the WM_COPYDATA message.
See: Inter-Process Communication using WM_COPYDATA[^]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Identity Undisclosed wrote: Is there any work around or possible solution
Use a different IPC mechanism (named pipe, shared memory + mutex or event or something)?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
You're seeing the correct behavior. UIPI blocks messages sent from a lower-integrity process to a higher-integrity process. If you control the receiving process, you can call ChangeWindowMessageFilter() to allow the message through.
--Mike--
|
|
|
|
|
I'm not sure if this is the right place to put this, but...
I'm using an example program that doesn't use glut that needed a variable
LPCWSTR name1;
I've included:
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <string>
using namespace std;
I get the error message: Run-Time Check Failure #3 - The variable 'name1' is being used without being initialized.
But I think I initialized name1 with the line LPCWSTR name1.
I'm using Visual c++ 2008 Express Edition on a Windows Vista 64 bit.
Thanks for any input!
|
|
|
|
|
You should read this: Windows Data Types[^]. The reference tells you that a type LPCWSTR is: Pointer to a constant null-terminated string of 16-bit Unicode characters. Yes, you've given it a name. This merely allocates memory for the pointer reference. But, where is it in virtual memory? And more importantly, what existing Unicode string does it reference (point to)?
How did you use it in your code? By passing it to a Unicode version of some Windows API? It won't function correctly. The solution is simple: assign it to some existing Uniocode String.
LPCWSTR name1 = L("This is your unicode string.") ;
Probably, the clearest explanation of string usage and conversions are explained in Michael Dunn's Complete Guide to C++ Strings, Part 1[^], and, Part 2[^].
Also, read this: Generic Text Mappings in Tchar.h[^]
|
|
|
|
|
Intrinsic data types (including pointers, which is what LPCWSTR is) are not initialized unless you give them an initial value. For example:
LPCWSTR name1 = NULL;
--Mike--
|
|
|
|
|
Hi,
I have a CLI audio recording program which uses WaveIn and WaveOut to record.
1. I need to prepare buffer and should be able to use for less time i.e., prepare the buffer for 30 mins but should be able to stop at 15 mins and save it to file. I am not able to do this now.
2. I need to get the path of the file. I need to record to a temp file and access it.
The audio's source is Microphone. It can record for custom # of seconds. I mean, when you run VoiceRec.exe and press enter, it would ask you for the # of seconds to record. After I give a number, it prepares the buffer for that time, starts recording and saves it to a file.
But what I want is, I would like to start recording and when the user presses any key, it should stop recording and save it to a WAV file.
http://rapidshare.com/files/240845783/Working_VoiceRecording_2_.rar.html
|
|
|
|
|
This isn't particularly difficult, so what exactly are you having a problem with?
Nikhil_7777 wrote: 1. I need to prepare buffer and should be able to use for less time i.e., prepare the buffer for 30 mins but should be able to stop at 15 mins and save it to file. I am not able to do this now.
Why not? OK, 30 minutes of audio is a fairly big file, but not extreme (even at 48KHz sample rate).
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
What happens is, I am being compelled to create a buffer for the time I need to record which I don't want to.
After preparing the buffer, even if I stop recording in between the file is redording for the entire buffer time. e.g., if I prepare buffer for 30 mins and stop recording at 15 mins, my output wav files is for 30 mins.
VoiceRecording m_Record;
CVoicePlaying m_Play;
m_Record.PrepareBuffer(seconds_to_record1);
|
|
|
|
|
Two solutions to this come to mind :-
1) Only write out to disc the part of the buffer you've used. You can work out how much this is, based on record time, sample size and sample rate.
2) Use smaller buffers, maybe even just a few seconds long, and write these out to disc as they fill. At worst you'll only have one buffer's worth of extra data in the file. (Depending on system usage, performance etc. you could even go down to sub-second buffer lengths.)
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Hi Everyone,
I am working on a project which need to upload the documents to Sharepoint portal.
I am able to get some samples with C# but i am not able to get any samples with C++/MFC.
We are not using .Net in our environment and we want to create a C++ windows service which will upload the documents sharepoint.
If anyone can point me to some samples on how to do it with C++, it will be really helpfull.
Thanks,
KK
Ramchandra
|
|
|
|
|
Hi guys,
I have a qustion in windows programing like this.
I think free was always needed win16 programing because malloc was implmented by GlobalAlloc and system never free its pointer until GlobalFree called. So it makes a system memory leaks.
But nowadays, in win32 system, malloc is implemented by HeapAlloc and do not need call at program exiting anymore, because system frees its heap safely at process died.
Is this true or not?
|
|
|
|
|
norish wrote: But nowadays, in win32 system, malloc is implemented by HeapAlloc and do not need call at program exiting anymore, because system frees its heap safely at process died.
Strictly you are correct - Windows releases a processes resources when the process terminates. However, it's good practise to release resources explicitly, just in case the code gets reused somewhere that it matters. Use smart pointers/resource handles and it becomes easy enough.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for reply.
I might be correct after all.
However, it's good practise to release resources explicitly
Your point is the very good manner in most case, I know, especially some system handles (like kernel objects) must explicitly release in the code before progaram exits.
So sometimes I use smart pointers for managing such handles.
|
|
|
|
|
Hi
I designed a new dialog class as:
class CDialogBase : public CDialog
{
public:
CDialogBase( CWnd* parent, UINT resId );
virtual ~CDialogBase() { }
protected:
void EvHelp(HELPINFO*);
virtual BOOL OnInitDialog();
virtual void OnOK() {};
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
public:
afx_msg virtual void CMHelp();
DECLARE_MESSAGE_MAP( );
};
I did following:
CAboutDialog *pAboutDialog = new CAboutDialog( .... ); ---> CAboutDialog is inherited from "CDialogBase "
pAboutDialog->DoModal();
But OnInitDialog() is not called. Where is the problem?
Thanks,
|
|
|
|
|
pAboutDialog->DoModal(); will immediatelly return?
If then instantiation of CAboutDialog has some error.
I know a case cause this situation.
Check the resource id is exist and reffer exact dialog resource.
If resource id is valid, I'm not sure, maybe some declaration is not matched their prototypes or no appropriate message mapping macro defined...
|
|
|
|
|
Yes, pAboutDialog->DoModal()will immediatelly return.
|
|
|
|