|
mailMonty wrote:
why don't you declare CMyDialog as member variable or global variable or static variable, that will work exactly as you intend.
Because I do not know how many of them I will need (see in my post, you fire up a dlg every time you click on a button). So declaring them as global would require a dynamical global array of dlgs
~RaGE();
|
|
|
|
|
mailMonty wrote:
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
very good sig
~RaGE();
|
|
|
|
|
You may use:
CMyDialog *pmydlg=new CMyDialog;
pmydlg->Create(...);
pmydlg->Show();
to create the modeless dialog who's PostNcDestroy should look like this:
void CMyDialog::PostNcDestroy()
{
CDialog::PostNcDestroy();
delete this;
}
rechi
|
|
|
|
|
Thanks rechi, I had already thought about something like this, i missed the existence of PostNcDestroy . Thanks again.
~RaGE();
|
|
|
|
|
Rage wrote:
Thanks
A pleasure
Rage wrote:
i missed the existence of PostNcDestroy
I knew it...
rechi
|
|
|
|
|
in your button event,you should like this:
CMyDialog mydlg=new CMyDialog;
mydlg.Create(...);
mydlg.Show();
in the class of CMyDialog
you should add a function
CMyDialog::PostNCDestroy()
{
delete this;
}
|
|
|
|
|
coolaka wrote:
CMyDialog mydlg=new CMyDialog;
mydlg.Create(...);
mydlg.Show();
Yep, even better with a pointer (see rechi's post) IMO. Thanks a lot for your help.
~RaGE();
|
|
|
|
|
I want to record mp3 file with mciSendString and use this code
<br />
- mciSendString("open new type waveaudio alias capture", 0, 0, 0);<br />
- mciSendString("set capture bitspersample 8", 0, 0, 0);<br />
- mciSendString("set capture samplespersec 11025", 0, 0, 0);<br />
- mciSendString("set capture channels 2", 0, 0, 0);<br />
- mciSendString("record capture",0,0,0);<br />
- mciSendString("save capture c:\\test.mp3",0,0,0);<br />
when test.mp3 file saved, I play it with windowmedia and one error occur "ClassFactory cannot supply requested class (Error=80040111)"
somebody can help me to fix it, thanks
Nho'c Ti`
|
|
|
|
|
HI;
Which headfile is include the GetLastInputInfo function ?
GFL
|
|
|
|
|
How did you find out the function exists ? If from the MSDN, it tells you what header to include.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
The function is exits , so
you can find it with input "::" in C++
d
|
|
|
|
|
so you've already included it. :: won't show you every function that exists, across header files that the compiler isn't able to look at, how could it ?
msdn.microsoft.com. I know the answer, but it would serve you better to work out how to find it for yourself, it's not hard. Google would almost certainly link to the MSDN entry.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
i was found it
it declare in winuser.h
d
|
|
|
|
|
What I'm trying to do this time is talk to a USB device. I'm not sure what port I need to acess to be able to talk to it. Or if I need to check what port it's on before I talk to it. I do hate to bother but I do have another question. How would I write a program that is a system process(doesn't have to be run by the sys just so there are no visuals to it and is only a process)?Thank you for your time.
|
|
|
|
|
To write a process with no interface in VC++, write all ur code inside WinMain() and dont create or draw any windows. Ur program will run hidden. U can check that ur appl. is running by doing Ctrl+Alt+Tab.
lol, i dont know any other better way
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
i wanted to learn assembly but can't find the compiler for it... i hope it's free... does it come with vc++6 studio and if so were?
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
|
NASM[^]
Free, and the best assembler!
Maxwell Chen
|
|
|
|
|
Hello,
I've got a dialog application generated with the Visual Studio 6 class wizard. After generating the app, I added an acellerator table.
I loaded the table like this
::LoadAcelerators(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDR_MAINFRAME));
I tried loading it at several places, in the InitInstance() and the main dialog constructor for exemple.
I don't know why, but my shortcut keys don't seem to work .
Did someone experience the same problem, or does anyone know an answer to this %$&^%N problem? Thanks in advance.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Bob Stanneveld wrote:
::LoadAcelerators
is this api valid, could not find it in the MSDN.
give this method a try
LoadAccelTable(...)
it needs to be loaded in the framewindow.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
Hi
Mr.Prakash wrote:
::LoadAcelerators
is this api valid, could not find it in the MSDN.
Whoops, I guess I made a typo. It should be
LoadAccelerators()
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
To handle accelerator keys, you need to do two things. Firstly, you need to load the table; secondly, you need to handle them.
LoadAccelerators returns a handle to the loaded table. If it returns NULL , the table couldn't be loaded. Typically this means that a resource of the appropriate type with this resource identifier couldn't be found in the module instance passed to the function. You'll need to store this handle somewhere so we can use it in stage 2.
Stage 2 requires us to hook into MFC's Windows message handling. MFC offers the PreTranslateMessage function, which we can override to do what we need to.
You can find sample code in July 2000's MSDN Magazine[^] (the third question down).
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanks very much, that PreTranselateMessage() function did the trick for me.
Mike Dimmick wrote:
(the third question down)
It was the 2nd question
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
when scroll the horizontal scrollbar,i want make the first column fixed.
thanks!
|
|
|
|
|
hi
No luck.
Otherwise you can do by subclassing the list control and by overriding OnHScroll . We need 2 skip the base class scrolling and to impliment our own scrolling logic using GetScrollPos and SetScrollPos. But it is hardly time consuming and err prone. Then we have 2 take care of all the columnmovement, header movement everything. But I prefer u keep those content in the first column outside ListCtrl - in the parent window.
rgds..mil10.
|
|
|
|
|