|
I created by Wizard ATL COM DLL that import my MFC extention DLL(from type: base Dialog) in my ATL.
Please check my steps (describes below) and tell me if I miss something.
(because I dont success create instance of it from client program)
------------------------------------------------------------------------
1. I opened project: ATL COM Wizard. [DLL] [MFC Support]
2. I inserted to the library that created the file : MyMfcDll.dll
and attached to the ATL project the files : MyMfcDll.h , MyMfcDll.lib
3. I Added by wizard ATL class [MyClass] [single] [dual]
4. I added by wizard method [ShowMfcDialog] to IMyClass and fill it so :
___________________________________________
#include "MyMfcDll.h"
STDMETHODIMP CMyClass::ShowMfcDialog()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
CMyDialog dlg; //from the imported dll
dlg.DoModal();
return S_OK;
}
______________________________________________
and that's all !
What is missing ?
I will be greatful if you will help me !
|
|
|
|
|
HI !
Now I see that in OLE/COM Object viewer CMyClass class present in the folder : Automation Objects but if I try open it by press on the + I gets the messageBox:
------------------------
CoGetClassObject failed
class not registered
REGDB_E_CLASSNOTREG(..)
------------------------
What is the problem ?
|
|
|
|
|
|
Is this the same machine that you compiled the ATL dll on. If not, then have you registered the dll. regsvr32 <dll filename>
Michael
|
|
|
|
|
How ?
|
|
|
|
|
from the command prompt,
regsvr32 mydll.dll
Michael
|
|
|
|
|
hi,
To Register the component in a Dll, Run:
regsvr32 yourDllserver.dll
To Un-Register the component in a Dll, Run:
regsvr32 -u yourDllserver.dll
Note:
Run the program "regsvr32" in the directory in which you have your Dll.
or,
Specify the full path to regsvr32
Firoz
|
|
|
|
|
Can you answer me on my first question in this thread also ?
I will be greatful !!!
|
|
|
|
|
When I try present the dll by a client program .
now (after the registration of the dll) it create instance successfully but when It come in to the line that execute function of the dll the computer become crazy and I gets the message :
" 'ClientProgName' caused an invalid page fault in module KERNEL32.DLL "
---------------------------------------------------------------------
In the first question in this thread I detailed my steps of creation that ATL. Is something wrong or missing in it ?
______________________________________________________________________
Or maybe the problem is in my client program ?
----------------------------------------------------------------------
Please ! Please ! Help me !!!
|
|
|
|
|
Hi dear fellow programmers!!!
I have an Edit box in my dialog program(actually 3 and all of them have the same problem) whenever I click on them and then I click on another program(for instance, Internet Explorer) my system crashes...it seems that my dialog box hogs all the system resources...and I can't close it even the Task Manager wouldn't work. At the moment I am running Windows XP but I had the same problem in Windows 2000 before..
Please help!!! Why is this happening? and how can I solve the problem??
|
|
|
|
|
We need to see some code to provide more specific help. What message handlers have you got for the edit control? Are you handling WM_KILLFOCUS or the edit change messages?
Michael
|
|
|
|
|
i have a DirectX program which run under a Full Screen mode,
but now i want to make it display in a window,how could i do this?
please help me.thanx.
|
|
|
|
|
Dear Frineds
I want to select content from any application window to modify the selected contents there only using Win32application.Selection should be done either by mouse movement or by keyboard.
So please let me know how to do this.For output display we can use WM_paint message but for other application what i have to do.What is otheralternative for InvalidateRect or InvalidateRgn in this case.
Kindly help me and guide me how to do this.
Thanks in advance.
Binay
|
|
|
|
|
Let me get this right - you want to select displayed information in another application, and change it ? Any application ? To do that you need not just to change what is drawn ( that is easy ) but to change the data in the application itself ( because it will respond to WM_PAINT messages also ). There is no way I can think of to do this generically, if a way exists, I will be amazed.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Dear Graus
Hi
Thanks for replying to my mail.I wanted to select text from any application and want to change it contents their only.Take an example --
i selected some part of a text file say .doc using mouse click and then and i want to modify the same selected content accordingly by my code.
i am doing this by placing the entire/selected content to display/output file and modifying it their.Now i don't want to place the selected content and want to modify it in the same application window, and it can be any application either word,or whereever any text contents.
So kindly help me in doing this.or it is possible or not and if yes then how.
Thanks once again
Bye
Binay
|
|
|
|
|
If you're looking to do it with text, then it may be possible, because if you can get the HWND of the edit box, you can send select, cut and paste messages to it. However, this strikes me as a very strange ( or at least unfriendly ) thing to want to do. Are you wanting to write a program that enters usernames and passwords or something similar to automate a task ? That's the only good reason I can think of.
Anyhow, it's possible to get a HWND from mouse position ( I forget the command ), that's probably as good a place as any to start.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Dear Graus
Hi
Thanks once agian for ur advice.As i written to you before i am doing this using cut and paste method by copying the contents to my window or u can say it as output display.and there only i am modifying it,say changing the font.
But i wanted to do it in another way.now i don't want to paste and put it into output display but want to change their only from where i am copying.
how it will be possible and if possible kindly give me example or please tell me about that instruction.
Thanking you in advance and once again thanks for replying.
Bye
Binay
|
|
|
|
|
I want to load a bitmap from a specified location on my hard drive eg: "C:/bg.bmp" rather then using a resource bitmap like LoadBitmap(IDB_MYBITMAP)
Any suggestions would be excellent, thanks
Ryan
|
|
|
|
|
|
Thank Mike, you rock.
I used
CBitmap bmp7;
bmp7.Attach(::LoadImage(::AfxGetInstanceHandle(),"C:\\bg.bmp", IMAGE_BITMAP,0,0,LR_LOADFROMFILE));
Worked great.
-Ryan
|
|
|
|
|
Be aware about Mike's suggestion of using LoadImage() that the flag LR_LOADFROMFILE does not work in Windows NT. If that poses a problem to you, have a look at Chris Maunder's DIBSection wrapper for Win32 and WinCE, which does the job of loading a .bmp file without resorting to LoadImage() .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Is this documented somewhere? I found no mention of this restriction in MSDN or the KB.
--Mike--
http://home.inreach.com/mdunn/
"The Earth is doomed." -- Rupert Giles
your with and
|
|
|
|
|
Whis is a weird thing, you know, cause I wasn't able either to find this restriction on the MSDN as it is on the web. Nevertheless, my online documentation (arguably pretty much outdated, MS Visual Studio 97) says explicitly
<bold>Windows NT: LR_LOADFROMFILE is not supported.
Moreover, if you do a search on Google with
LR_LOADFROMFILE "not supported"
a number of entries appear repeating this assertion. Maybe the documentation is wrong and the guys from Microsoft silently corrected it, maybe the capability was added to NT with some SP everybody's assumed to have installed, who knows. IMHO this definitely deserves some investigation, I'll post anyting here I come up with.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Well, after some searching on USENET archives, seems that LR_LOADFROMFILE is indeed supported since NT 4.0 (and even before than that), and the claim on the documentation is simply false, and eventually was removed. Some of the articles I found relevant to the issue are: (BTW, one of the folks is well known here in CodeProject)
- Naughter, PJ: Re: LoadImage not supported under NT?, comp.os.ms-windows.programmer.win32, 1998/01/26
- Chen, R: Re: Does LoadImage(..) work with LOADFROMFILE under NT 4.0 ?, comp.os.ms-windows.programmer.win32, microsoft.public.win32.programmer, 1998/02/04
- Naughter, PJ: Re: Loading bmp file using LoadImage on Windows NT 4.0, microsoft.public.vc.mfc, microsoft.public.win32.programmer.gdi, microsoft.public.win32.programmer.ui, 1999/01/29
So, my apologies to all, and good luck using LoadImage()
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I recently found article Q264347 regarding the behavioral differences between NT (2000 & XP) vs. Win9x. It says LoadImage() could fail in NT due to biSizeImage being invalid in the BITMAPINFOHEADER struct. But I don't get it how to remedy the invalid value prior to loading via LoadImage().
I've also recently discovered that XP doesn't have a problem loading uncompressed .BMPs, but won't load by 4-bit RLE bitmap files. What's the deal?
Cliff Hall
|
|
|
|