|
It is also possible to simulate a "service" on 9x platforms, although not a true NT service.
You have to use a function from kernel32.dll with GetProcAddress (although I don't remember the function name now, is something like RegisterService or similar, but I might be wrong).
|
|
|
|
|
Hi,
As far as my i know, windows services can only run on NT/2k/XP onwords. we can't deploy windows/NT services on windows 98 and on linux too.
but we can utilize the same functionality by running as a background process or demon.
Cheers
Jitendra.
Jitendra Pal Singh Gangwar
E-mail: jitendra_gangwar@hotmail.com
Mobile No: 09831352305
|
|
|
|
|
How can i use a tree control to display the directories in the system?
|
|
|
|
|
HI,
I want to run a MFC based Application on DOS.
Can i do this?
What are the conditions or limitation or precuation I have to take care of?
Any link or resource that explains about this?
Thanks
Regards.
|
|
|
|
|
in this application I am also using CSocket Class.
Regards.
|
|
|
|
|
You can't run Windows applications on DOS. You can make a console application that runs on Windows that uses MFC but that's a different situation; but some people use the word DOS to mean a console application which is why I mention it.
Steve
|
|
|
|
|
As i get from you reply.
Windows applicxation cannot run on DOS operating system, but a consol based application can run on windows infact this consol based application is not basicaly a DOS application.
So to run a consol based application windows Operating system must be installed.
As i think DOS is a 16 bit operating system and windows is 32 bit operating System that why the windows applications cannot run on DOS operating system is it .
thanks
Regards.
|
|
|
|
|
Microsoft droped support for writing applications in DOS over 10 years ago. I believe VC4 did not even support DOS.
John
|
|
|
|
|
You can use Visual C++ 1.5 (1993 if I remember well), it has an option for DOS console application.
Also I think it was the first time when MFC was introduced, but I don't think you can use MFC for a console application.
There were dlls available for a DOS application, by the way? I think they are available for 16-bit and DOS only under Windows (3.11 etc.), I think the type of application was called QuickDOS or so (a pseudo-console emulated under 16-bit Windows).
Consider a rewrite in C - it's not really necessary to use MFC for a console application anyway just for CString or whatever are the few classes you need. Even talking about Win64 - what kind of console application needs a heavy GUI library as MFC to worth its usage?
-- modified at 4:31 Saturday 20th May, 2006
|
|
|
|
|
when i am trying to access the protected web sites, it is not poping up the password dialog. instead of it is going to "page not available" page.please give me a solution for this...
manikandan M S
|
|
|
|
|
How to set background color for Toolbar?
|
|
|
|
|
|
Hi,
I am totally struggling because of this issue please give me your hand to solve this....
I need to send text as stream/Bytes to MFC Active-X control and read the content in MFC and display the same in Text box. Since i am very new to this world i couldn't grasp things immediately so If possible please provide me code snippet both ActiveX control and Wrapper program.
Please note both wrapper application and ActiveX controll are written in VC++.Net.
Thanks in Advance.
|
|
|
|
|
sivaprakashshanmugam wrote: Please note both wrapper application and ActiveX controll are written in VC++.Net.
how come we give you source code for reading file, when that wrapper class havn't exposed to us!
"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
|
|
|
|
|
Does a debugger runs at the space address space of the program it's debugging?
MadMax
|
|
|
|
|
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
|
|
|
|
|