|
Hi,
The general bahavior is to use the dialog resource of the dll inside the
dll only(or the dialog is instatiated inside the dll). Then MFC actually
takes care of locating the resource from the correct module autmatically.
(But you need the 'AFX_MANAGE_STATE(AfxGetStaticModuleState( ));' )
If your are deviating from this behavior then you need to get the
'resource handle' of the module from which you want to use the resource
by using FindResource and passing the desired module handle and then
use the returned resource handle to load the resource and
use it,.
|
|
|
|
|
Thank you for your answer but I think my question wasn't clear enough.
In fact, I have got a method in my DLL which aims to show a dialog. For example :
void myMethod()
{
CMyDialog dlg;
dlg.DoModal();
}
the CMyDialog class was done with the ClassWizard after designing the dialog itself.
So I compile my DLL and all is OK.
Then, I create a new WIN32 EXE project. I include my dll.lib in the Project settings and in my code I include the dll.h which declares the dll's methods and functions. In this code, I try to show the dll's dialog by calling myMethod().
I compile and all is OK but when I execute the EXE, instead of displaying the DLL's dialog, it displays another resource contained in the EXE because its resource ID is the same of the DLL's dialog ID.
Thank you for your help.
|
|
|
|
|
How abt using the
'AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
at the start of the function as I have mentioned in
my previous post ?
|
|
|
|
|
OK, thanks a lot ...
I see you're very good in visual C++ programming so I've got another question : Can you explain me exactly what are the differences between the MFC Regular DLL Project and the MFC Extension DLL Project ? When should I choose one instead of the other ?
|
|
|
|
|
In MFC extension Dll's you can export classes,
but there is a draw back, you need to use these
dll's only in C++ code(not even 'C', uses explicit
C++ linkage).
Where as a regular Dll you cannot export classes,
only functions ! but a properly designed & written
dll can in general be called from many
language like C,C++, VB etc....
|
|
|
|
|
Hi,
I have a problem with Setting the Region for a child window. When I use the following code in the OnInitDialog of a CDialog I get a Dialog Box that is having a Rounded Rect Shape.
CRect rect;
GetClientRect(rect);
CRgn rgn;
SetWindowRgn(rgn,TRUE);
But when I use the same code to get a Rounded Rect shaped child window(CEdit) of the CDialog Box. It does not seem to work. Can any body tell me What else will I have to do to get the Desired result ? Thanks in advance.
Regards,
nitin.
Nitin S. Jadhav
|
|
|
|
|
I have bee mainly using Visual Studio 6.0 on Win NT and 98. I was wondering if it installs and work correctly on Win2000 and Win XP? I don't want to upgrade to .NET so am curious.
Thanks in advance,
|
|
|
|
|
I use VS6 on both 2000 and XP, and there are no problems. Just make sure you've got VS service pack 5 and are up-to date with the 2000 service packs.
Michael
Logic, my dear Zoe, merely enables one to be wrong with authority. - The Doctor
|
|
|
|
|
I wonder if there's a possibility to Post and Get messages (using the API PostMessage and SendMessage functions) inside a .DLL that have no Window.
That DLL is calling the TWAIN API and TWAIN is supposed to post messages to the caller to inform it on the current process. Unfortunately I'm using a MFC regular DLL with just the CWinApp class and I've no Windows Handle (hWnd) for posting TWAIN messages.
I could post messages to the DLL caller and then back to the DLL but as this is a Plugin framework I don't want to use that method. At the moment I've created a fake Window in that DLL and I'm posting the messages to that Window but I'm wondering if there's a better way to do this.
Yarp
|
|
|
|
|
I need to display HTML pages in CListView, and i need to disable downloading of pictures on displayed page, like when you have 'show pictures' option turned off in IE. Does anybody know how to do that ?
Thanks.
rrrado
|
|
|
|
|
How to play a .wav file when the wave device is already opened by another DirectSound app?
PlaySound or sndPlaySound don't work
|
|
|
|
|
i am not sure but,
u can try with "mciSendString" with Open Command and in Sharable mode
|
|
|
|
|
Hi guy,
Please see the note:
Note: from MSDN
shareable::Initializes the device or file as shareable. Subsequent attempts to open the device or file fail unless you specify "shareable" in both the original and subsequent open commands.
MCI returns an invalid device error if the device is already open and not shareable.
The MCISEQ sequencer and MCIWAVE devices do not support shared files.
|
|
|
|
|
Use API function: PlaySound()
|
|
|
|
|
Try to play your sound Synchronously(SND_SYNC)
Shibu K.V.
|
|
|
|
|
I used DrawState,DrawIcon,DrawIconEx
I have icon with only 48x48 type image.
how use 48x48 type if system at first (on loading - LoadIcon)convert to 32x32 and then mapped to 48x48
|
|
|
|
|
LoadIcon has been superseded by the LoadImage function. Maybe LoadImage can be better for you.
|
|
|
|
|
i find method
create ImageList - Create(48,48,ILC_MASK|ILC_COLOR8,2,1);
ImageList.Add(LoadIcon());
then ImageList.Draw(&dc,Check.Active,CPoint(0,0),ILD_TRANSPARENT);
everything worked
URAAAA
|
|
|
|
|
I'm writing a automation EXE server in VC++ 6.0 and I want to send COM/ActiveX events to the calling program... is it possible and how ?
The project was created as a MFC application with Automation support and works fine as a Automation server for my client application.
Now I just need to notify the client of events in my automation EXE application.
I'm desperately in need of help.... please help.... thanks
|
|
|
|
|
Add a sink interface to your client that sink the events fired from the server. I think there are some samples in MSDN called koala or ekoala.
Cheers,
Fredrik
<right>Sonork ID: 100.11430:PhatBoy
'It is so much simpler to bury reality than it is to dispose of dreams.'
- Don Delillo, Americana
|
|
|
|
|
Well... the problem is not the client but my server application.
How do I fire events from my (.EXE) automation server application ?
|
|
|
|
|
If you didn't like the koala samples, check here, there's plenty of articles about events.
Cheers,
Fredrik
<right>Sonork ID: 100.11430:PhatBoy
'It is so much simpler to bury reality than it is to dispose of dreams.'
- Don Delillo, Americana
|
|
|
|
|
Well... there are plenty of samples but I still can't find any which shows how to add events to my EXE automation server (MFC).
My automation server is a windowed application created as an MFC EXE application in VC++ and I want to send events back to the client when the user performs specfic actions in the window.
|
|
|
|
|
http://www.codeproject.com/com/connectionpoints1.asp
http://www.codeproject.com/com/connectionpoints2.asp
Cheers,
Fredrik
<right>Sonork ID: 100.11430:PhatBoy
'It is so much simpler to bury reality than it is to dispose of dreams.'
- Don Delillo, Americana
|
|
|
|
|
I get tooltips for every Win32 functions, MFC or my own functions... however I don't get them for OpenGL? Anyone knows why, DirectX Conspiracy?
|
|
|
|