|
Thanks for the explanations all.
Mr.Prakash wrote:
You can use callback functions to notify back the messages.
Could you elaborate on this point? How would a callback function notify back to the calling application.
So that you understand my set up. My main application is a dialog based application and so are the plug-ins. So lets say a plug-in wants to tell the main application that a song has just ended (end of song event).
Thanks
|
|
|
|
|
Declare a pure virtual class that your dialog etc will inherit from. Then you pass a pointer to your dialog across to the dll and it calls the functions it required on this calss object:
class MyCallBacks
{
virtual void Callback1(parameters) = 0;
virtual bool Callback2(parameters) = 0;
}
CMyDialog : public CDialog, public MyCallbacks
{
void Callback1(parameters);
bool Callback2(parameters);
}
So when you init your DLL, pass a MyCallBacks* pointer in the structure across. Then in the DLL, if you need to do a certain actio, you would do:
if (m_pCallback != NULL)
{
m_pCallback->Callback1(parameters);
}
Hopefully this makes some sense!
Roger Allen - Sonork 100.10016
Strong Sad:
Clever I am? Next to no one.
Undiscovered and soggy.
Look up. Look down. They're around.
Probably laughing. Still, bright, watery.
Listed among the top. Ten.
Nine. Late night. Early morn.
Early mourn. Now I sleep.
|
|
|
|
|
Yes, that makes sense.
Thanks
|
|
|
|
|
Hi Gurus:
i m new to VC++. i want to make a make a button , a default button at run time , i know a button could me make a default button at design time be setting its property as default button , but how could this get at run time .......
thanks in advance.....
Touseef Afzal
"Winner's don't do different things , they do things differently "
|
|
|
|
|
btn->SetButtonStyle(btn->GetButtonStyle() | BS_DEFPUSHBUTTON)
Robert-Antonio
"Love without sex is like a fish without antlers"
|
|
|
|
|
Hi:
i have an SDI Application in which i have used CFormView as my view Class ,
i have tried this code
btn->SetButtonStyle(btn->GetButtonStyle() | BS_DEFPUSHBUTTON
but it just change the look of button from simple look to a dark black rectange showing that button has now default button property , but the button is not working as default button .....
help please..........
thanks.....
"Winner's don't do different things , they do things differently "
|
|
|
|
|
Check out DM_SETDEFID.
You post this to the dialog (in this case, the form view), and pass WPARAM which is the ID of the button you want to be default, leave LPARAM as NULL.
Steve S
|
|
|
|
|
Hi everyone,
I did not know which forum would get closest in relevance to my question, so I posted it here. I am really sorry if it is the wrong place.
I am trying to learn DirectX and was looking at DirectSound in particular. I was looking at the documentation for mixing various DirectSound buffers and playing them simultaneously. However, this concept of simultaneous playing bothers me. The documentation says that simultaneously played sounds are automatically mixed in the DirectSound primary buffer and played. I could not find an example of mixing multiple wave sources.
Now, here is my question:
Suppose I have 50 DirectSound secondary buffers. I want to ensure that they are mixed first and then played. What I could gather from the documentation is that I loop through the buffers and call Play() on them. However, that will certainly affect the synchronization of the buffers and they will not be played simultaneously. The documentation only states that you play the buffers simultaneously. I could not come across a way on how to do it.
I am pretty sure I am missing something here. So, if any DirectSound expert could shed some light on it, I would be grateful.
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Looping through the buffers and calling Play() won't be a problem. AFAICR, The Play() method is asynchronous, so it flags the buffer to start playing and then returns. The actual delay involved in very minimal, so starting 50 buffers playing will only take a microsecond or so. Compare that with the time between two samples (20.8 microseconds at 48kHz), and the delay involved is much less than a single sample, so by the time the next sample comes along, all of the buffers will be ready. They may be out of sync by a single sample, but this will not be noticeable to us humans.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hey Ryan,
Thanks a lot for the explanation This really helps.
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Hello.
Please, help me, how to set focus into EditControl when I run the application?
I know how to do it in Delphi, does anyone know how to make this in Visual Studio C++ ?
Thanks.
|
|
|
|
|
use SetFocus (a member of CWnd)
MyEdit->SetFocus();
|
|
|
|
|
Hello, everyone,
In my current project, I want to display xp style button(OK, Cancel and apply) in the properties sheet.
If I do it using MFC, it would be very easy. I just need to
m_btnXPButton.SubclassWindow(GetDlgItem(ID_APPLY_NOW)->m_hWand);
But when I tried to do the same thing in ATL, the returned handle for ID_APPLY_NOW (IDOK and IDCANCEL) is NULL.
How can I get the handle of a control in the properties sheet written in ATL.
Thanks a lot in advance.
bin
|
|
|
|
|
bin8922 wrote:
How can I get the handle of a control in the properties sheet written in ATL.
Don't forget about this forum.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Does GetdlgItem(...) does not work?
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
I tried to use GetDlgItem(IDOK), but the returned value is NULL
|
|
|
|
|
How do you remove a gripper from a status bar. I created it using:
m_wndStatusBar.Create(this, CBRS_BOTTOM|WS_CHILD|WS_VISIBLE|CBRS_SIZE_FIXED);
I have tried the following to remove the gripper:
m_wndStatusBar.ModifyStyle(SBARS_SIZEGRIP,0);
but it didn't work.
Does anyone know how to remove the gripper.
Thanks
|
|
|
|
|
Hello all...I have a dialog based application. What i want to do is, set up a timer in my dialog, say for every 4 minutes, i want my dialog to call a function from another dialog to write some data into a file. How can i accomplish this. I have looked at and tried timers in a regular mfc program, but have not had success with a dialog based program. If anyone has a sample code or an article pertaining to timers and dialogs, i would appricate the help.
none
|
|
|
|
|
modeonetwo wrote:
...say for every 4 minutes
Which is equal to 240,000 milliseconds.
modeonetwo wrote:
...but have not had success with a dialog based program
Meaning what? To simply state that something did not work is not very informative. I assume that you did not have compiler/linker errors, but had run-time errors instead.
A timer does not care that it was created in the context of a window or a dialog (which is just a specialized window). Once you create it and the specified time has elapsed, the specific callback function is called or a WM_TIMER message is posted to the owning application.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
In OnInitDialog() call SetTimer with appropriate parameters. Then (in the dialog class) write a handler for WM_TIMER . You can do it through classwizard, analogous to other messages, because CDialog is derived from CWnd .
Robert-Antonio
"A flower walked around a meadow. She saw a beatiful human and plucked off his head."
|
|
|
|
|
Hi,
I have an SDI that spins off a thread. How can I get access to the window (GetMainWnd) and also pass variables from my CWinApp derived class to the thread ?
Thanks !!
|
|
|
|
|
pMyApp = (CMyWinApp*)AfxGetApp();
and there is also
pMyWnd = (CMyWnd*)AfxGetMainWnd();
Or just keep it global or "delivere" it into as function parameter.
|
|
|
|
|
I have a dll that I created in C++ and declare the function in a VB .exe and it works just fine. But when I give the folder to somebody else and have them run the .exe with the dll in the same folder I get a 'run-time error 53: Export.DLL not found'. Even if I hard code it and specify it with an absolute path I still get the same error. This dll doesn't have to be registered. Does anyone know what's going on?
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Is your dll using any other dlls?
Maybe they can not be loaded but final efect
is that head dll error is reported.
For example if you build dll in
Debug and you are distributing it
on computer without same developer tool.
(there are only release version)
It will not to work.
that sometime happen
|
|
|
|
|
I made the DLL with MFC statically linked, so it shouldn't be that. what about #include files? For instance, I'm using the MySQL.h header file and linking to its .lib file when compiling my DLL, but they are not included in the project. Should I do that? thanks for your help
If it's broken, I probably did it
bdiamond
|
|
|
|