|
Try with:
m_ofn.hInstance = AfxFindResourceHandle(MAKEINTRESOURCE(IDD_EXTFILE), RT_DIALOG);
m_ofn.lpTemplateName = MAKEINTRESOURCE(IDD_EXTFILE);
-----------------------------------------------------
is there a same Dialog Template in your app?
|
|
|
|
|
Thanks! That (along with Neville's suggestion) helped!
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi Ravi,
In the DLL Constructor:
m_hInstOld = AfxGetResourceHandle ();
ASSERT (m_hInstOld != NULL);
AfxSetResourceHandle ( MyDLL.hModule );
and in the Destructor:
AfxSetResourceHandle (m_hInstOld);
where MyDLL is:
static AFX_EXTENSION_MODULE MyDLL = { NULL, NULL };
...
if (!AfxInitExtensionModule( MyDLL, hInstance ) )
...
Hope that helps. Works for me.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Thanks, Neville! That (along with Wang Yi's suggestion) helped!
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I have VC6 SP5. where do I look??
|
|
|
|
|
Program Files\Microsoft Visual Studio\VC98\CRT\SRC\THREADEX.C
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need ASP hosting? Check out 123HostNow.com
|
|
|
|
|
OK, here's the scenario:
I have a VC++ 6 MFC SDI application that uses CSplitter to create 4 Views. (The app is an operator interface for a machine tool.) It has been requested that we have Hotkeys for various operator actions. Some of these hotkeys need to be active at all times regardless of which view or which control in any view has focus. (Most of the various controls are buttons, but there are a few edit boxes and list controls.) I accomplished this by using Accelerator keys in my MainFrm class. However, in one case I have axis Jog buttons that I need to monitor "key up" vs. "key down" activity. (The accelerator key functions don't seem to offer this ability.) I accomplished this by overloading the PreTranslateMessage function of the MainFrm class.
However, I seem to recall reading that overloading the PreTranslateMessage function is to be avoided when possible, but I don't remember the details of why. I would have liked to use the OnKeyUp and OnKeyDown messages but if a child window has the input focus then all keyboard messages go to it and not the MainFrm.
I have 2 questions:
#1 - Why should I avoid the PreTranslateMessage function?
#2 - Is there a work around or trick to let the MainFrm class see the keyboard events even when a child window has the input focus?
Thanks in advance!!
Mike Mullikin
If you can't beat your computer at chess, try kick boxing.
|
|
|
|
|
Hi Mike, I use PreTranslateMessage in my MainFrm class in ED for exactly this. It is "the way" to do it afaic. As the other replies in The Lounge said this is what PreTranslateMessage is for.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
How do u add a menu to a dialog box?
I tried this:
Defined a menu resource
Did a load menu in teh CDialog constructor
Overrode PreCreateWindow and assigned the menu handle to cs.hMenu
didnt work
|
|
|
|
|
It's actually as easy as defining a menu resource and setting the "Menu" property of the dialog (in the resource editor) to the menu's identifier.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
If you wanna do this programatically, try SetMenu().
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
Hi there,
Do you have an idea of how to run executable content on the web?
What I want is to non-stop monitor some web site and detect and report changes from a simple app. It could be achieved from a computer which is permanently connected to the net, but this is not satisfactory in this case.
Any ideas would be nice.
Thanks
R.
|
|
|
|
|
If you own or have full control of the server you could just setup a simple monitoring app. If it is a IIS server you could write an ASP object to track this.
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
The first one (full control of server) can be excluded. Could you be please more specific what actually the tool is for writing an ASP object on an IIS?
Thanks
R.
|
|
|
|
|
I personally don't know ASP but you should refer to the ASP section of the for more ideas. It was more of an idea. Good luck on your project.
- Matt Newman / Anti-Linux Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
If you are currently a Visual C++ developer of any flavor(MFC,ATL,WTL,STL...) and are considering switching to Visual C# please respond back explaining why you have made this consideration. Just curious were everyone stands.
Nick Parker
|
|
|
|
|
if i'm going to do any .Net work, i'll personally want to do it in C# because i am somewhat offended by the idea of "managed" C++.
a dumb reason. but there it is.
-c
Ah, but a programmer's reach should exceed his grasp, or what are late nights for?
Smaller Animals Software, Inc.
|
|
|
|
|
I am really interested in C#, but when I have gone and looked at books they seem about 50% based on web interactivity, something which I'm not that interested in.. is C# better, or as good as, C++ for developing full scale apps? C# just looks so much simpler..
-dz
|
|
|
|
|
dazinith wrote:
C# just looks so much simpler..
But overall isn't that a good thing if you can do the same process, without all the addtional overhead?
Nick Parker
|
|
|
|
|
exactly, i would much rather be focusing on C# if it was as viable an option as C++.. i was a java coder for a while, and recently started learning c++ (about 2 mo.).. i would switch to C# in a heartbeat if someone could validate that it is worthy of developing full scale apps..
-dz
|
|
|
|
|
I had heard a rumor that Microsoft was rewriting their Great Plains accounting package entirely in C#. I think that should provide as evidence enough if true. It would be a good question to ask Microsoft, what evidence they can provide to show how viable C# really is/will be.
Nick Parker
|
|
|
|
|
Nick Parker wrote:
But overall isn't that a good thing if you can do the same process, without all the addtional overhead?
Well, so why don't you switch to Visual Basic?
I know, think about all overhead behind things in VB. Which program will run faster, C++ or VB? Of course, depends on the program, but you have to agree that the simple way is not the best way. Why programmers still using Assembler?
So I'm not sure that C# is that good. I think it stands somewhere between C++ and VB.. Almost simple as Basic and almost fast as C++.
But yes, in programs where you don't care about speed, like GUI based, you will pick the simple way
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need ASP hosting? Check out 123HostNow.com
|
|
|
|
|
Me the same as Chris.
I really donn't know why should I use MC++,when C# exist.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Hi Nick
I think I'll use C# till MC++ gets CodeDOM
Nish
I am the Keyboard Smasher
|
|
|
|
|
C# looks like the best bet for writing .NET applications at the moment. C++ doesn't seem to be integrated well enough into the .NET framework for my liking. Hopefully this will change but for now if I have to write any .NET apps then C# is the nearest thing to C++.
VB is not for me, (because I keep putting ; on the end of lines and it complains ). C# is easy to use and seems to meet my needs for writing MIS systems for .NET. C++ will always remain my first choice for Windows apps but until Microsoft improve the .NET support in it C# is the nearst language to my skill set for writing .NET apps.
Michael
|
|
|
|