|
I am using wm asfwriter to write wma files, and I would like to write a segment of the song using IMediaSeeking::setpositions, but hr = E_NOTIMPL. I added wm asf writer to the graph, and used renderfile to load songs, and built the filter graph. I reached ImediaSeeking through writer filter, then used setpositions function to locate the segment I would like to write. But setpositions did not succeed. Thanks for your help.
|
|
|
|
|
Hi, I am using ADO 2.81 with C++ 6.
In my program I have a datagrid which is filled with data from adodatacontrol. Whenever i select a different row, my app needs to display information about it. The problem is, I can't find in which row the user clicked...
Is there any code that can help me?
i am trying to put it in the function:
void CMyDlg::RowColChangeDatagrid(VARIANT* LastRow, short LastCol)
here lastRow shows the last row clicked not the present.
I tried with dataGrid.get_Row();
this works fine if I dont scrool the data grid. But if I do so, it gives me the same informations (like I am not scrolling)
PLS help
|
|
|
|
|
Hello, I'm trying to create a program that will allow me to launch various applications as many times as I want, and also close them all at once. So far I have manage to code the launch part. my program runs and gives the choice to execute three programs: notepad, calculator, and paint. I can keep on crating as many isntances as I want of any of the three programs. However, I have not been able to come up with a solution to close all of the open programs at once, this will be done when the option 4 is selected from the menu!! So far my program only closes the last opened application, but not the rest..How can I come about resolving this problem thank you.. here is my code::
#include windows.h
#include stdio.h
#include stdlib.h
#include "linkedlist.h"(structure contains: PROCESS_INFORMATION si, and *next node)
void P1();
void P2();
void P3();
void main(void)
{
Node *head = NULL;
Node *newPtr = new Node;
STARTUPINFO si;
//PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
//ZeroMemory(&pi, sizeof(pi));
int num=0;
while(num!=5){
//char ch ='0';
//char skip[31]="";
system("cls");
printf("\t\t****Select which application to execute *****\n\n"
"\t\t\t1.NotePad\n \t\t\t2.Calculator\n \t\t\t3.Paint\n\t\t\t4.Quit\n\n");
scanf("%d", &num);
if (num==1){
CreateProcess(NULL,"C:\\Windows\\System32\\Notepad.exe",NULL,NULL,NULL,NULL,NULL,NULL,&si,&newPtr->pi);
}
if(num==2){
CreateProcess(NULL,"C:\\Windows\\System32\\Calc.exe",NULL,NULL,NULL,NULL,NULL,NULL,&si,&newPtr->pi);
}
if(num==3){
CreateProcess(NULL,"C:\\Windows\\System32\\Mspaint.exe",NULL,NULL,NULL,NULL,NULL,NULL,&si,&newPtr->pi);
}
if (num==4){
TerminateProcess(newPtr->pi.hProcess,0);
TerminateProcess(newPtr->pi.hThread,0);
}
}
}
-- modified at 11:06 Wednesday 29th March, 2006
|
|
|
|
|
What does it do when 4 is selected? My guess is that it will close the most recently created process.
Each time that 1, 2, or 3 is selected, you need to create a new Node and add it to a list of some sort. Then when 4 is selected, iterate through this list, calling TerminateProcess() . Make sense?
eprt wrote: TerminateProcess(newPtr->pi.hThread,0);
You can't use a thread id with TerminateProcess() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thanks for your help! Indeed when 4 is selected, it closes the most recently created process. Now you suggest that I implement a Linked list perhaps? If so does the creation of the new node will have to be declared within each if statement? thanx !!
|
|
|
|
|
eprt wrote: Now you suggest that I implement a Linked list perhaps?
Yes. Use std::list from the STL.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
A much better solution. Thanks.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Calling TerminateProcess is meant as a last line of defense - In general it is not safe to go around terminating processes. If you must stop another process the correct technique is to ask it nicely to exit and only fall back on TerminateProcess if this doesn't succeed. See here[^] for some more info on this. If you do call TerminateProcess here's some possible ramifications in order of severity:
- Nothing bad happens.
- The program doesn't get a chance to clean up after itself - For example temporary files are left behind undeleted.
- The process corrupts data. This can occur if, say, the program was interrupted in the middle of an operation that should be atomic.
- If the process used shared memory, such if often the case when global hooks are used, the global data could be corrupted and effect other processes.
Steve
|
|
|
|
|
I have a vc++6 MFC app, i have a main dialog that shows in the taskbar, the dialog can call a login dialog which also shows in the taskbar but i have the main callin another dialog but that doesnt show in the task bar. what is causing this
what part of the code actually makes a dialog show in the taskbar?
thx
|
|
|
|
|
i just found the line that does it in the .rc file
EXSTYLE WS_EX_APPWINDOW
i have added the above lines to the correct sections in the .rc file using notepad but how is this ment to be added when using visual studio 6
as the above way im sure isnt the right way
|
|
|
|
|
i'm quite sure you're calling that login dialog as modal from the Main dialog's OnInitDialog() function... aren't you ?!
|
|
|
|
|
yes, that is correct, while the other dialog is called once a button is click in the main dialog
is this having an effect?
|
|
|
|
|
I want to write some articles for the forum, how to do (publish) that?
A special image tool for Windows C++ programmers, don't miss it!
A nice hyper tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
|
right, but how to navigate to these pages if not clicking links given by you?
A special image tool for Windows C++ programmers, don't miss it!
A nice hyper tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
sorry, wasn't thinking...
Look at the top right hand menu on every page then Articles / Submit an Article
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
I like to do a “printscreen” on a window. Can I use the windows HWND to accomplish that in some way?
All tips are welcomed.
_____________________________
...and justice for all
APe
|
|
|
|
|
search for "screen capture" in articles of the forum, u can find some samples - also in VC CD (samples).
A nice hyper tool for optimizing your Microsoft html-help contents.
A best image tool for Windows C++ programmers, don't miss it!.
Includeh10
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I have the below code:
There is a classs"CPaintDC".
Can anyone please tell me what is the difference between the following 2 statements:
1.)CPaintDC *pDC = new CPaintDC(this);
2.)CPaintDC* pDC=new CPaintDC;
|
|
|
|
|
1. calls the CPaintDC contructor which receives a CWnd* parameter, and initializes it with the this pointer passed,
2. calls the CPaintDC default constructor...
|
|
|
|
|
DC is related to Window, in other words, we say "a DC of a window".
1) the DC of "this" window - similar to ::GetDC(this->m_hWnd);
2) the DC of screen - similar to ::GetDC(0).
A special image tool for Windows C++ programmers, don't miss it!
A nice hyper tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Hi all
I have such question :
I often see following things in other people's code :
object.SomeFunction(BS_STYLE1 | BS_STYLE2 | BS_STYLE3)
and then after execution all those three styles are set to
the object .
How is this implemented inside the function ?
Can anybody clarify, or bring an example ?
thank you.
PS. For example this API uses such thing too :
ListView_SetExtendedListViewStyle(m_list, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES );
|
|
|
|
|
Actually it is a DWORD in the function:
void ListView_SetExtendedListViewStyle(HWND hwndLV,DWORD dwExStyle);
And this one is:
#define LVS_EX_FULLROWSELECT 0x00000020
this is this.
|
|
|
|