|
Great! That's exactly what I was looking for!
Thank you very much for replying.
David
|
|
|
|
|
You are welcome, glad the information helped.
It is a handy feature to make custom builds of your software for different customers or target audiances.
|
|
|
|
|
Hi
I want to merge several files into one file. How can i do this in Visual C++
In DOS it is very easy, you just use the copy function in a batch file, e.g copy "c:\tstTag3.csv" + "c:\tstTag4.csv" "c:\test.HTML"
Can anyone help me get started with this?
Thanks
Gunnar
|
|
|
|
|
You use the file commands: CreateFile, ReadFile, WriteFile, and CloseHandle functions. The first call creates the output file and opens the first input file. When you are done reading the first input file, close its handle and open the next one. Open each subsequent input file for reading and keep writing to the output file. Close the output file when you are done reading the input files.
|
|
|
|
|
On days like this I feel like a total n00b, even after three years of intensivly using MFC... do a good deed today and help me... pleeeease!
I do have Visual Studio .NET 2003 and plan to make a multi document application with several different views for each document so I can switch on-the-fly between those different views with some buttons on the toolbar.
For achieving this I used the project wizard to generate a multi document Doc/View application with the view derived from CView. So far so good. Now I inserted a new MFC class derived from CFormView and I enabled the checkbox "Create DocTemplate ressources". Afterwards I had a new class, a new dialog in the ressources and in the applications InitInstance() I got this:
CMultiDocTemplate* pNewDocTemplate = new CMultiDocTemplate(
IDR_SOMEFORMVIEW_TMPL,
RUNTIME_CLASS(CTestMultiViewsDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CSomeFormView));
AddDocTemplate(pNewDocTemplate);
When I start my application now I get the following window:
(image link)
Question 1: how do I circumvent this dialog and preselect one of those views?
Question 2: how do I switch between those views during runtime without closing/deleting the document?
Jup, that would be it.
I have already read this Codeproject article and this (quite old) Codeguru article but I do not get it working as I want it to work.
There must be a good and simple solution for this, because my intend isn't that special I think. So please tell me how to do it or where to read more about it.
Thanks & Bye,
Matthias / T.T.H.
|
|
|
|
|
losing the dialog in 1. involves changing the command line passed to the app in initinstance() ... cant remember exactly what but look in msdn and it'll be there
2. switching between views? u mean creating a new view or what exactly? the user switches between them with the mouse
unless u mean a different representation of the same data ... in which case ur OnDraw() handler can do that for you
"there is no spoon" biz stuff about me
|
|
|
|
|
Concerning 1: I solved the problem another way and don't have multiple document templates now - so I don't need to preselect one of them.
Concerning 2: I want to switch through all the views by some buttons on the toolbar.
I guess I developed a solution yesterday solving my problem. I appended a (quite long) post under Jorge's articel about switching views. You can find it here.
Thanks for the help,
Matthias / T.T.H.
|
|
|
|
|
I'm not sure I understand ...
you only have the name of the file ( test.xml ) ? or the full path name ( C:\Temp\Data\test.xml ) ?
if you only have the name of the file, you need to search your disk to find the file ( FindFirstFile an d FindNextFile, and recurse all folders ).
if you already have the full path, only extract the string up to the last backslash.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hi All,
I've got an application which I based on the StillCap demo that comes with the DirectX SDK.
I wrote and tested the software on a Windows 2000 machine but have recently tried the software on a Windows XP machine and suprise suprise the software no longer produces the results we expect!!!
What the software does is to capture frames from the video camera as needed and the perform some processing on the image and then save the image to a RAW file. On the XP machine the saved images color don't save right and there is also a slight 'border' on the left hand side of the image (on the 2000 machine the images are perfect).
I think I've managed to locate a potential cause of the problem, on the 2000 machine the size of the image array in the windows callback is 233472 whereas on the XP machine it is only 230400. Thats a total of 3072 difference which I *think* is the image header, i.e. 1024 * 3 (for RGB).
Does anyone have any ideas on this and how I can fix it.
cheers,
|
|
|
|
|
I think I've now got round this feature by interrorgating the O/S, if its XP then I 'add' the extra bits onto the buffer, this then produces the output file correctly.
I know this is not ideal and would appreciate if someone could still answer this question.
cheers,
Andy
|
|
|
|
|
Hi
In my application i want to change volume control of Main speaker,WaveIn,etc. Is there any simple way to do this. If yes can i get some sample code.
Thanks
JP
ALL THINGS ARE POSSIBLE UNTIL THEY ARE PROVED IMPOSSIBLE-AND EVEN THE IMPOSSIBLE MAY ONLY BE SO,AS OF NOW
|
|
|
|
|
See if this article gets you started.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks for ur reply . it is very helpful for me. one general question. How can i change the volume of wavein device(mic)?
Thanks
JP
ALL THINGS ARE POSSIBLE UNTIL THEY ARE PROVED IMPOSSIBLE-AND EVEN THE IMPOSSIBLE MAY ONLY BE SO,AS OF NOW
|
|
|
|
|
P_JAYAPRAKASH wrote:
How can i change the volume of wavein device(mic)?
How about waveOutSetVolume() ?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I think WaveOutVolume is for "WaveOut" devices not for wavein.
ALL THINGS ARE POSSIBLE UNTIL THEY ARE PROVED IMPOSSIBLE-AND EVEN THE IMPOSSIBLE MAY ONLY BE SO,AS OF NOW
|
|
|
|
|
P_JAYAPRAKASH wrote:
I think WaveOutVolume is for "WaveOut" devices not for wavein.
Fair enough. As my article indicates, I'm not an audio aficionado.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi,
Im trying to develop an application that has some sound processing issues, i need to clip a sound file and put the output in another sound file of the same format. How can i achieve this issue. What libraries and classes i need to use to accomplish that ??
|
|
|
|
|
Hi,
I´m using C++ and WMI to get hold of information from my network cards. The problem is that I only recieve information of my primary, Ethernet network card. I´m intrested to get information from both my primary and my wireless network card. When executing ExecuteQuery() with the query "Select * from win32_NetworkAdapter", is there anyway that I can get that into a list of "network adapters". Possible this already is done and put into the list object sent to exec.query, but I can´t get more than one item from it, even if my wireless network card is actice.
Does somebody have a clue of a solution of my problem. If I have been fuzzy in my description of the problem I can explain it more and hopefully better.
Torben00
|
|
|
|
|
Hi,
I want to find the path of a file for example test.xml.
If test.xml is located in C:\Temp\Data\test.xml, then by giving the file name (test.xml) as input, I want the path as output i.e C:\Temp\Data
Can anyone please help me to do this?
Thanks
Madhavi.
|
|
|
|
|
hi,
use the win32findfile data strcture an use cfindfile class mfc or findfile apis
|
|
|
|
|
Hello,
I'd like to run two successive dialogs in my dialog application. The problem is that when the user exits the first one and the application tries to run the second, it fails (I suspect the message pump gets destroyed).
I've tried creating a dummy window (so that there would always be at least one message target) before running the first dialog but that didn't help)
Any helps? Can I re-ren the pump again or prevent it from ceasing?
Thanks
|
|
|
|
|
|
dlg = new CPoolDlg;
m_pMainWnd = dlg;
int nResponse = dlg->DoModal();
delete dlg;
playoff_dlg = new CPlayoffDlg;
m_pMainWnd = playoff_dlg;
nResponse = playoff_dlg->DoModal();
delete playoff_dlg;
That's the code in InitInstance. I have to say I'm in no way a MFC guru. I played with the code a bit to make the CPoolDlg and CPlayoffDlg members of the CMyApp, and had to make them * in order to be able to create them after the common controls initialization is done. If I comment the first dialog out, the second runs wo problems, if I don't, the DoModal returns -1 (from what I know on some message pump checking call)
|
|
|
|
|
search in the MSDN for Q138681
or just comment the m_pMainWnd lines out.
dlg = new CPoolDlg;
int nResponse = dlg->DoModal();
delete dlg;
playoff_dlg = new CPlayoffDlg;
nResponse = playoff_dlg->DoModal();
delete playoff_dlg;
|
|
|
|
|
The problem you have is that you are setting the m_pMainWin to be a pointer to your first dialog.
MFC automatically terminates the thread (your application) when the window that m_pMainWnd is pointing to is closed. For further information see MSDN.
You could change the code to:
dlg = new CPoolDlg;
playoff_dlg = new CPlayoffDlg;
m_pMainWnd = playoff_dlg;
int nResponse = dlg->DoModal();
delete dlg;
nResponse = playoff_dlg->DoModal();
delete playoff_dlg;
Which will ensure that the application lives for the duration of the second dialog.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|