|
No. It is a seperate process.
Steve
|
|
|
|
|
Hi All,
I am working on addin development for visual studio 6. I am going to add a menu under Tools to get .dsw file path through a dialogbox. After pressin ok button of this dialogbox, i want to open (and close already opened workspace) given .dsw file in visual studio IDE.
Visual Studio 2005 has Solution.Open(string solnPath) method provided by DTE2 itnerface. I am looking similar thing for visual studio 6.
Thanks in advance.
-- abhay
|
|
|
|
|
ShellExecute is what you want.
John
|
|
|
|
|
Hi Jonh,
thanx for suggestion, but there are some more complications.
1. I want to open .dsw file in same IDE. I have tried to use ShellExecute() function in my Visual Studio 6 IDE. But as I have visual studio 2005 also installed on my machine and .dsw file, by default, opens with VS2005, VS2005 instance is get created and opend .dsw file. Which i don't want to achieve.
2. Secondly, the file which we are going to open, (say, .dat or .txt) should have association with an executation file (open with setting). Someone may consider .dat as movie file and opens with media player, and one will consider it as simple text file and opens with notepad.
In this scinario respective application will execute and open the file.
I have tried same thing (creation of addin for vs2005 to open .sln file) with VS2005, one can call DTE2 interface's Solution.Open(string filename) method.
As DTE is interface for current running IDE instance, solution get opened in same IDE. I want same thing for studio 6.
Can I invoke "open workspace" command through code? (what mainly done by using File->open workspace option of same IDE).
|
|
|
|
|
Abhayc wrote: . I want to open .dsw file in same IDE. I have tried to use ShellExecute() function in my Visual Studio 6 IDE. But as I have visual studio 2005 also installed on my machine and .dsw file, by default, opens with VS2005, VS2005 instance is get created and opend .dsw file. Which i don't want to achieve.
wow what about
ShellExecute(NULL,"msdev.exe","project.dsw",NULL,SW_SHOWNORMAL);
"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
|
|
|
|
|
Thanx Alok,
It works, but again a new instance of VS6 is created and i want to open in same instance of IDE. I want to perform similar operation like "File->open workspace" of IDE (without showing select file dialog) more correct example is open "File->recent workspaces" option. How IDE takes filename from registry and opens it in IDE?
|
|
|
|
|
Hi,
I have developed the program that let user record video as avi file and audio wav file separate, and now I want to develop the orther program to let user merge these to one avi file.
I have not used DirectShow in my code for this module.
Please help me for this.
Tri
|
|
|
|
|
Instead of saving separate AVI and WAV files and then using additional code to combine the AVI and WAV files, I think it would be cleaner / better to update the code which writes the AVI file so it saves an AVI with audio and video.
I did something similar - I wrote a program which saved video-only AVIs (based on the MSDN WriteAVI sample), then later updated it to save audio in the AVI file. If you decide to follow that route, I will clean it up a bit (it's a long function) and post the code. My program is C, not C++, but it should be useable.
|
|
|
|
|
Hi,
The follow are some my codes. I finished to write a Avis and wav(write by other thread) then continue to add the wav to Avis file existing.
Please help me for some suggestions and code example.
With the follow code it can write but I can't play final avi file with Window Media, Real Player, it seem to wrong codecs or format
I have used the compression codecs option as MSVC(Mircorsoft Video Codecs 1)
Please help me again.
//Add Frame code
bool CAVIUtil::AppendFrameUsual(HBITMAP hBitmap)
{
BITMAPINFO bmpInfo;
bmpInfo.bmiHeader.biBitCount = 0;
bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
GetDIBits(m_hAviDC, hBitmap, 0, 0, NULL, &bmpInfo, DIB_RGB_COLORS);
bmpInfo.bmiHeader.biCompression = BI_RGB;
GetDIBits(m_hAviDC, hBitmap, 0, bmpInfo.bmiHeader.biHeight, m_lpBits, &bmpInfo, DIB_RGB_COLORS);
if (FAILED(AVIStreamWrite(m_pAviCompressedStream, m_lSample++, 1, m_lpBits, bmpInfo.bmiHeader.biSizeImage, 0, NULL, NULL)))
{
strcpy(m_szErrorMessage, "AppendFrameUsual(): AVIStreamWrite failed");
return (false);
}
return (true);
}
//Add wav to avi
HRESULT CAVIUtil::AddAviWav(const char *src)
{
char *buf=0; WavChunk *wav = (WavChunk*)src;
HANDLE hf=CreateFile(src,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL);
if (hf==INVALID_HANDLE_VALUE) {
MessageBox(NULL,"AVIERR_FILEOPEN","ERROR",MB_OK);
return AVIERR_FILEOPEN;
}
DWORD size = GetFileSize(hf,NULL);
buf = new char[size];
DWORD red; ReadFile(hf,buf,size,&red,NULL);
CloseHandle(hf);
wav = (WavChunk*)buf;
// check that format doesn't clash
bool badformat=false;
if (m_wfx.nChannels==0)
{ m_wfx.wFormatTag=wav->fmt.wFormatTag;
m_wfx.cbSize=0;
m_wfx.nAvgBytesPerSec=wav->fmt.dwAvgBytesPerSec;
m_wfx.nBlockAlign=wav->fmt.wBlockAlign;
m_wfx.nChannels=wav->fmt.wChannels;
m_wfx.nSamplesPerSec=wav->fmt.dwSamplesPerSec;
m_wfx.wBitsPerSample=wav->fmt.wBitsPerSample;
}
else
{
if (m_wfx.wFormatTag!=wav->fmt.wFormatTag) badformat=true;
if (m_wfx.nAvgBytesPerSec!=wav->fmt.dwAvgBytesPerSec) badformat=true;
if (m_wfx.nBlockAlign!=wav->fmt.wBlockAlign) badformat=true;
if (m_wfx.nChannels!=wav->fmt.wChannels) badformat=true;
if (m_wfx.nSamplesPerSec!=wav->fmt.dwSamplesPerSec) badformat=true;
if (m_wfx.wBitsPerSample!=wav->fmt.wBitsPerSample) badformat=true;
}
if (badformat) {if (buf!=0) delete[] buf;
MessageBox(NULL,"AVIERR_BADFORMAT","ERROR",MB_OK);
return AVIERR_BADFORMAT;
}
//
// create the stream if necessary
if(m_pAudioStream==0){
AVISTREAMINFO ahdr; ZeroMemory(&ahdr,sizeof(ahdr));
ahdr.fccType=streamtypeAUDIO;
ahdr.dwScale=m_wfx.nBlockAlign;
ahdr.dwRate=m_wfx.nSamplesPerSec*m_wfx.nBlockAlign;
ahdr.dwSampleSize=m_wfx.nBlockAlign;
ahdr.dwQuality=(DWORD)-1;
HRESULT hr = AVIFileCreateStream(m_pAviFile,&m_pAudioStream, &ahdr);
if (hr!=AVIERR_OK) {if (buf!=0) delete[] buf; return hr;}
hr = AVIStreamSetFormat(m_pAudioStream,0,&m_wfx,sizeof(WAVEFORMATEX));
if (hr!=AVIERR_OK) {if (buf!=0) delete[] buf;return hr;}
}
// now we can write the data
unsigned long numbytes = wav->dat.size;
unsigned long numsamps = numbytes*8 / m_wfx.wBitsPerSample;
HRESULT hr = AVIStreamWrite(m_pAudioStream,m_lAudioSample,numsamps,wav->dat.data,numbytes,0,NULL,NULL);
if (buf!=0) delete[] buf;
if (hr!=AVIERR_OK) {
MessageBox(NULL,"AVIERR_OK","ERROR",MB_OK);
return hr;
}
m_lAudioSample+=numsamps;
MessageBox(NULL,"AVIS_OK","S_OK",MB_OK);
return S_OK;
}
|
|
|
|
|
I need to write the sepatared file in some case and need to merge these to a avi file if needed.
So, Please help me with this route.
Thank again
Tri
|
|
|
|
|
Please modify your post - I can't read the code easily. Select the code and click on the Formatting: pre label below the text entry box - this tells CodeProject to keep formatting as you had it in the code.
It is always useful to do Preview before you Post message.
I will find my code and try to make a short extract, then post that. The details look similar so it may be useful.
|
|
|
|
|
Yah,
Sorry for make difficulty to read,
Please help me with some your code
Thanks!
|
|
|
|
|
I have not checked in detail, but I noticed a difference in dwRate setting - I use the samplesPerSecond value, while you use samplesPerSecond * sampleSize. This will be a problem if you are not using 8-bit samples.
Error checking (using uiResult) removed to save space
Lots of other details removed as well
void SaveAVIFileWithAudio(void)
{
PAVIFILE pAVIFile = NULL;
AVISTREAMINFO VideoStreamInfo;
AVISTREAMINFO AudioStreamInfo;
PAVISTREAM pAVIVideoStream = NULL;
PAVISTREAM pCompressedVideoStream = NULL;
PAVISTREAM pAVIAudioStream = NULL;
AVICOMPRESSOPTIONS CompressionOptions;
AVIFileInit();
GetSaveFileName(&AVIFileNameEtc);
uiResult = AVIFileOpen(&pAVIFile,
AVIFileNameEtc.lpstrFile,
OF_WRITE | OF_CREATE,
NULL);
memset(&VideoStreamInfo, 0, sizeof(VideoStreamInfo));
memset(&AudioStreamInfo, 0, sizeof(AudioStreamInfo));
VideoStreamInfo.fccType = streamtypeVIDEO;
VideoStreamInfo.fccHandler = mmioFOURCC('m','p','4','2');
uiResult = AVIFileCreateStream(pAVIFile,
&pAVIVideoStream,
&VideoStreamInfo);
memset(&CompressionOptions, 0, sizeof(CompressionOptions));
CompressionOptions.fccType = streamtypeVIDEO;
CompressionOptions.fccHandler = VideoStreamInfo.fccHandler;
uiResult = AVIMakeCompressedStream(&pCompressedVideoStream,
pAVIVideoStream, &CompressionOptions, NULL);
uiResult = AVIStreamSetFormat(pCompressedVideoStream, 0,
&bitmapForAVIHeader,
bitmapForAVIHeader.biSize);
AudioStreamInfo.fccType = streamtypeAUDIO;
AudioStreamInfo.dwScale = 1;
AudioStreamInfo.dwQuality = -1;
AudioStreamInfo.dwRate = 11025;
AudioStreamInfo.dwStart = 0;
AudioStreamInfo.dwLength = uiLocalNumFramesUsed *
uiAudioBufferActualSize;
AudioStreamInfo.dwSuggestedBufferSize = uiAudioBufferActualSize;
AudioStreamInfo.dwSampleSize = 2;
uiResult = AVIFileCreateStream(pAVIFile,
&pAVIAudioStream,
&AudioStreamInfo);
uiResult = AVIStreamSetFormat(pAVIAudioStream, 0,
&AudioFormat,
sizeof(AudioFormat));
for (uiCounter = 0; uiCounter < uiLocalNumFramesUsed; uiCounter++)
{
uiResult = AVIStreamWrite(pCompressedVideoStream,
uiCounter,
1,
gpAVIBufBits,
bitmapForAVIHeader.biSizeImage,
0, NULL, NULL);
uiResult = AVIStreamWrite(pAVIAudioStream,
uiCounter,
1,
pAudioDataBlock[uiLocalIndex],
uiAudioBufferActualSize,
0, NULL, NULL);
}
AVIStreamRelease(pCompressedVideoStream);
AVIStreamRelease(pAVIVideoStream);
AVIStreamRelease(pAVIAudioStream);
AVIFileRelease(pAVIFile);
AVIFileExit();
};
|
|
|
|
|
Many thank to normanS,
But I need merge the wav and avis together, because I have recorded as two separate file by two record threading, so with your code I can not add to my code for merge now.
Do you have any suggetsion or help again?
Tx,
Tri
|
|
|
|
|
Where exactly is the problem?
As far as I could tell, the code I posted was similar to what you used (same APIs, etc), so it should be possible for you to use my code (parameters used in the audio header, sequence of calling AVI functions etc) to give ideas of what to try in your code. The source of the data (you are reading from AVI and WAV files, I am getting it from audio and video buffers in memory) should not make a difference.
One thought I had - are you creating the AVI with video only, and the WAV with audio only, then trying to add the audio to the end of the video-only AVI? If so, this is not recommended - it may work (maybe only in some AVI players?), but performance could be really bad, since AVIs are designed to alternate between chunks of audio and chunks of video.
A better approach if you have video.avi and audio.wav would be to read a frame of video from video.avi, a block of audio the same length as the video frame (33.333 or 40 milliseconds) from audio.wav, then write this information to a new mixedAudioVideo.avi. Repeat until finished.
What error message are you getting when you try to play the AVI you create? Maybe that can give a tip of what is going wrong.
|
|
|
|
|
Hi All,
Could any one please provide me with the sample or example code for updating the data of XML files to MS Access database tables.?, Actually i need to make a vc++ dll which can read all xml files in a particular directory and update the data to coresponding table in MS Access database..Thanks in Advance.!
Regards,
princenrj23
____________
|
|
|
|
|
Use MSXML to read or parse data from the XML file .
CDatabase etc can be used to read and modify the Access files
So after reading data from the XML write it to Access Files
Or you can also use
IXMLDocument otherwise.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
dude even am aware that i have to use XMLParser to read the XML file and then have to map the tags to the table of MS Access database using ADO, but as i am newbee to vc++ and xml so i was looking for an example code or a tutorial which could help me getting started??? Thanks anyway for the help!
|
|
|
|
|
Dude what i am confused with is, how to open all xml files one by one from a single directory, parse the file and how do i know which element is to be updated to which column of which table(MS-Access Database)??, i am newbee to xml and vc++???, what is surprising to me is that there is no single tutorial or example code for this on internet?? dude if you have done such a programming in past plz post something useful?. It will be a great help...Thanks in Advance!!
|
|
|
|
|
May be this code can help you. You can get all the filenames that reside in a single directory. Now once you have the file names you can read the file parse it and use the data
WIN32_FIND_DATA FindFileData; <br />
HANDLE hHandle; <br />
<br />
int complt=1; <br />
char FileName[100]; <br />
strcpy(FileName,""); <br />
char rpath[]="abc"; <br />
char Path[]="abc"; <br />
SetCurrentDirectory(Path); <br />
hHandle=FindFirstFile("*.*",&FindFileData); <br />
<br />
if(hHandle == INVALID_HANDLE_VALUE) <br />
MessageBox("The Path Could Not Be Found."); <br />
else <br />
{ <br />
while(complt) <br />
{ <br />
strcpy(FileName,Path); <br />
strcat(FileName,FindFileData.cFileName); <br />
CString s=FindFileData .cFileName;<br />
if(s.Find ("txt"))<br />
{<br />
}<br />
complt=FindNextFile(hHandle,&FindFileData); <br />
} <br />
} <br />
FindClose(hHandle); <br />
as far as your specific requirement is concerned it would be hard to tell what you actually want to do and the logic behind that.
To update the table accordingly you will have to search for the CDatabase class and use its functions. This class will be derived from CRecordSet. Check out MSDN for details.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks Anshuman for the speedy response dude, my major concern is how to use MSXML parser and when & where to use ADO??.... do i need to have xml schema or a database schema?? to do the mapping of xml tags to MS Access table columns, or by simply opening each file traversing through it's nodes and looking for corresponding table in the database and updating it will do the job??
|
|
|
|
|
if you have small amount of data you can go for the second option.
Read articles on MSXML for this.
For large and huge data you would need a different approach. Can't help you on this man.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
is there anyone who could help me with this?
|
|
|
|
|
I want to create a transparent RichEdit control, and find many example use follow code in parent dialog class:
HBRUSH CParentDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if((nCtlColor == CTLCOLOR_EDIT) && (pWnd->GetDlgCtrlID()==IDC_MYRICHEDIT))
{
pDC->SetBkMode(TRANSPARENT);
pDC->SetTextColor(RGB(255,0,0));
return HBRUSH(GetStockObject(HOLLOW_BRUSH));
}
}
It does not work in my application. I think maybe because which I create is CRichEditCtrl while those example create CEdit, or maybe because my parent window is CWnd class while those example use CDialog class.
Anyone can tell me what the problem is, and how to fix it? help me create a transparent RichEdit control successfully, thanks a lot.
|
|
|
|
|
Hi,
Have u called AfxInitRichEdit in InitInstance of your application ??
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|