|
I want to use CRecordset and CDatabase classes to open MDB files without registering them on DSN. HOw can i do that and what possible compatibility issues will there be.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Using CDaoRecordset isn't an option?
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
http://www.codeproject.com/database/excel_odbc_write.asp
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I am finding Unicode Controls that can run on Windows 98. Help me, please.
Thanks for your help.
|
|
|
|
|
|
First, is it possible to terminate a CDialog (modeless) from the spawning class?
Second, if I am receiving repeated SendMessages from a dll, and this happens at a function call to the dll, will my dialog vanish after all the messages have been sent, or earlier? Will it wait for the dll to finish before executing the next line?
//launch modeless form
//call dll which wil send 100 sendmessages
//terminate modeless form
Third,can you sendmessage from a completely independent app, (not a dll) using the same technique as usual?
Thanks,
ns
|
|
|
|
|
First, is it possible to terminate a CDialog (modeless) from the spawning class?
Yes. Add a handler for a hidden button (or menu command) in your modeless dialog, eg: CMD_HIDDEN_CLOSE , which does this:
CMyModelessDlg::OnHiddenClose()
{
...
CDialog::OnOK();
DestroyWindow();
delete this;
} Then, just post the modeless dialog the CMD_HIDDEN_CLOSE command, eg:
CMyModelessDlg* pModeless = ...;
pModeless->PostMessage (WM_COMMAND, CMD_HIDDEN_CLOSE);
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Third,can you sendmessage from a completely independent app, (not a dll) using the same technique as usual?
Yes, as long as you have the target window's handle.
This (posting or sending messages) is an easy way to "automate" windows because they become responsive to a collection of commands. I suggest using PostMessage unless it's necessary for the command to be executed right away.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Second, if I am receiving repeated SendMessages from a dll...
This is a good example of the distinction between Send/PostMessage() . Your DLL can call SendMessage() or PostMessage() .
However, the termination message should be Post ed, not Send ed in order to ensure that all previous messages are handled before the modeless dialog goes bye bye.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks! I've been stuck for almost a week trying to get my VB dll to send me a message. If this doesnt look i have to do shared memory............aaaargh! It sounds horrible. Plus Ihave to do it in VB and in Vc since the two are talking.....really dont want to, but ...
Thanks,
ns
|
|
|
|
|
If I spawn a modal form can I terminate it from the parent like
myDialog.EndDialog(retVal);
Will retval get filled in if I send it the address of the variable?
Thanks,
ns
|
|
|
|
|
|
So this is fine, right?
CDialog myDialog;
myDialog.DoModal();
myDialog.EndDialog(& nretVal);
Thanks,
ns
|
|
|
|
|
It's not - DoModal doesn't return until EndDialog is called. You'll have to call EndDialog in response to some event.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
ns wrote:
So this is fine, right?
NO!!!
When you call DoModal a dialog is created and shown and a message loop is started. Now when you call EndDialog in one of the message handlers the dialog is destroyed, the message loop exited and then DoModal returns and the value it returns is the value you passed to EndDialog. Get it?
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Finally
Thanks,
ns
|
|
|
|
|
No it's not fine. DoModal will not return until the dialog is closed. Therefore your EndDialog will be called for a dialog that no longer exists.
It only makes sense to call EndDialog from a member function of the dialog. EndDialog is only relevant for modal dialogs and, by definition, the calling thread can't continue while a modal dialog is open.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Appreciate the responses. I didnt really realize what modal meant..
|
|
|
|
|
"Yikes, please no!!! Ouch, that hurts." (Sound of your modal dialog talking) .
A method like EndDialog() should only be called from within the dialog itself. To terminate a dialog from its parent, post it a custom message that causes the dialog to execute an orderly shutdown. (See my earlier reply about hidden commands).
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
Just wondering if it is possible to parse MP3 files with DirectSound. I want to get access to the raw music data and change it, like you could do with a .wav file
Pankaj
Without struggle, there is no progress
|
|
|
|
|
No. You need DirectMedia (part of the Directx sdk).
DirectSound plays audio sample buffers described by a standard WAVEFORMATEX structure.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
If I do:
CProgressCtrl *pBar = (CProgressCtrl*)GetDlgItem(IDC_PROGRESS1);
long hPbHandle = (long)pBar->GetSafeHwnd();
than if I do
(long)m_Progress1.GetSafeHwnd();
where m_Progress1 is the name of the control.
Thanks,
ns
|
|
|
|
|
|
I'm passing the handle to a dll which sends me messages> Well, done the first way I get the message. Done the second way, it doesnt get past the senmessage in the dll, and an exception occurs in the client. With one method, the progressbar gets PBM_STEPIT, but not with the other..
Thanks,
ns
|
|
|
|
|
Are you sure m_Progress1 in correctly mapped to Windows control in DoDataExchange or elsewhere?
Put the breakpoint in the second version and check the members of m_Progress1.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|