|
Yes, PreTranslateAccelerator is for ATL control and you can use PreTranslateMessage method
as the another person's suggest.
Please read MSDN following article:
PRB: MFC ActiveX Control Ignores ARROW Keys on VB Container
Good Luck!
|
|
|
|
|
I read the article that you suggest me. But my problem isn't about the accelerator keys, I have the problem with each kind of keys. It seems that the control hasn't the focus (or something similar). If you read the article "MFC ActiveX Control in IE Doesn't Detect Keystrokes" (Q168777) they speak about the activation of the control within IE. I tried their suggestions but I didn't solve my problem. If you have time to check just create an MFC ActiveX control with the wizard (confirm all the default properties and set the "available in insert object dialog"), then add the function OnChar (WM_CHAR) and write inside it AfxMessageBox("Key pressed"). Now insert the object in a VB form and it works, but if you insert in a VC MFC dialog based application (with the wizard) it doesn't work.
I'm using Visual Studio 6.0.
Thanks Paolo.
|
|
|
|
|
isn't it PreTranslateMessage() ?
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Hi,
I have a metafile, which contains some OpenGL information in it. When I display it on the screen, everyhting is fine. But, when I print the metafile I have problems!
If I print it on a RGB printer, then everything's fine. The problem comes when I print the file on a CMYK printer. The Red and blue colors are interchanged.
Any ideas?
NOTE: I am using NT 4.0
|
|
|
|
|
can somebody pls tell me where I can find source code with CHothKeyCtrl
|
|
|
|
|
when ever i made a small chages in the program, builds it. it's giving the following error
E:\Raj\Testing\Testing.cpp(11) : fatal error C1083: Cannot open include file: 'e:\raj\E:\Raj\Testing\Testingadovc\debug\msado15.tlh': Permission denied
Then i have to rebuild it to work with it. I am facing this problem very frequently. Please help me to avoid rebuilding again & again.
My email id is kgrajashekar@usa.net
Thanks in advance.
|
|
|
|
|
I have a dll written by a third pary vendor.
It works perfect in vc5, the linkage import section looks external for
_myfunc@PU8
In VC6 it looks externally for _myfunc@QU8
The dll exports _myfunc@PU8
How can I resolve this name mangling on linkage in VC6?
Gerry.
|
|
|
|
|
Name mangling is implemented in a compiler-specific way. It seems that MS changed the mangling rules between 5 and 6 releases. You'll have to ask the vendor to recompile the code in VC 6. I'm assuming that they gave/sold you the DLL, import library and header files only (no full source).
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Question:-
Vendor DLL has export function _Func@PQU3
I link explicitly to dll in a static library & export this function to my static library, the static lib has _Func@BQU3, bit of a different.
Can I not override my staticlib export to correspond to the dll or drop the mangling extern "C"...let the compiler find the required function?
Gerry.
|
|
|
|
|
Oops - so you're able to compile your code in VC6 and linking with your vendor's import library (compiled in VC5) works?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Note: All the dlls, exe's work well in VC5.
I have a staticlib that all my exe's use, the staticlib links to the vendors dlls' in VC6.
The staticlib compiles/links ok. But if I look a the lib file & the vendor dll,using dumpbin I notice that the name mangling has changed in the lib file.
I then try to recompile one of my exe's with the new lib file. I get an unresolved external, due to the different name mangling....
Gerry.
|
|
|
|
|
Hi,
I am building AciveX control and I need to load MENU onto my Dialog. Any suggestion, sample code ?
Thank you
|
|
|
|
|
Check the DLGCBR32 MFC sample.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
hi
jsut create your menu in your resources
add CMenu m_Menu in your header file
then in the OnInitDialog function of your dialog :
m_Menu.LoadMenu(IDR_MYMENU);
SetMenu(m_Menu);
Hope this helps
manu
|
|
|
|
|
Thanks a lot )
i think it should be SetMenu (&m_Menu).
so simple - Tomasz's previous reply also gave me an answer but I just got lost with this Microsoft sample. Just started with VC++ and such simple solutions i like the most
|
|
|
|
|
Hi!
I have a function in a MFC-based program which allocates a structure on heap, uses it for a while, and then deletes it. At the delete row, I'm getting a "User breakpoint called from code at 0x77f9eea9"
The compiler message is "Heap block at 01390280 modified at 013902F8 past requested size of 160"
The size of this structure is 308. I tried to make it smaller( it has a MAX_PATH member which isn't used to it's full size). When the size of the structure is 76, I get "Heap block at 01390280 modified at 013902F8 past requested size of 70"
Call stack:
NTDLL! 77f9eea9()
NTDLL! 77fcd942()
NTDLL! 77fb54c9()
NTDLL! 77f94801()
KERNEL32! 77e8bc7e()
_CrtIsValidHeapPointer(const void * 0x013902a8) line 1697
_free_dbg_lk(void * 0x013902a8, int 1) line 1044 + 9 bytes
_free_dbg(void * 0x013902a8, int 1) line 1001 + 13 bytes
operator delete(void * 0x013902a8) line 351 + 12 bytes
Idea's?
Kind Regards
Olof Wolgast
|
|
|
|
|
The error says you've modified the block of memory past the allocated size. IOW you overran the buffer. You'll need to step thru your code, and keep the buffer visible in the memory window, and see when you overrun the buffer.
--Mike--
http://home.inreach.com/mdunn/
The Signature, back by popular demand: Buffy. Pajamas.
|
|
|
|
|
Hi everyone,
First let me confess that I am a VC++ dummy.
I am stuck up in a project where i want to display the text / graphics in a window and require to implement to the scrolling (a CWND BASED CLASS and NOT A CVIEW BASED CLASS, we are not using a Doc-View architecture ).
Can anyone illustrate the code with explanation? OR Can anyone direct me to a good tutorial on scrolling the content in a window?
Mangesh
|
|
|
|
|
Universe Technology is just starting out and is looking for programmers. If you have skill in ASP, VBSCRIPT, HTML, Java, JavaScript, C++, C, XML or any other programming language of substance, please send me an e-mail at Alexjfink@aol.com, I will look into each applicant personally, if we like what we see, we will tell you more about Universe Technology.
|
|
|
|
|
Alex J Fink ? Is this an elaborate hoax ? You can program anything you like for these people ? Sounds like they have no idea what they are going to be creating...
P.S. If you're in Australia, have lots of money behind you and are paying top dollar, then someone else wrote this in my name, please contact me for my resume...
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
Any relation to http://www.utechnology.com/ ?
Michael
|
|
|
|
|
They're a consultant company like Robert Half, Inc, or Maxim Group.
I'm not real fond of places like this because of something I'm experiencing right now. I recently relocated from San Diego to San Antonio based partially on Maxim Group's claim that there were "lots of C++ jobs in San Antonio" and that I should "never have a problem staying employed as a C++ programmer". Well, here I sit, and there's not a SINGLE C++ job available in this town - and I've been looking since November.
Take EVERYTHING they say with a HUGE grain of salt.
|
|
|
|
|
Well i made a small dialog based app which calculates x values of the equatation ax2 + bx + c = 0. I made 5 edit boxes 3 for a, b, c values and 2 read-only ones for x values and one button to calculate. I also removed IDOK and IDCANCEL buttons (i don't want users to exit that way,
the only way i want them to exit is to click on the 'x' up in the corner of the title bar). But now if user inserts values and pushes enter, when the calculate button isn't highlighted(i don't know how to call that, may-be you call it something else...), then well the program closes, and i don't like that. Anyhow i'd like to make it so, whenever the user presses enter, the calculations are made, instead of closing the whole bloody thing. I've tried adding enter key to accelerators and call the same function as the calculate button has, but well, it didn't work...
So could someone enlighten me a bit about the subject, please
I'm a real newbie and desperately need your help.
---Thy humble servant Filosofem
|
|
|
|
|
1) Dialog box applications don't have support for accelerators.... at least not by default. You can patch it in like most things, but it can be a chore.
2) A dialog based app handles OnCancel (ESC) and OnOK (Enter) whether you use the button or not. If you want to disable the Enter key from calling OnOK (or ESC). Simply do this:
class CMyDialog : public CDialog
{
...
... (etc)
...
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CMyDialog)
virtual BOOL OnInitDialog();
DECLARE_EVENTSINK_MAP()
//}}AFX_MSG
virtual void OnOK() {}; // Must be overriden to keep ENTER key from exiting out of dialog
virtual void OnCancel(){}; // Must be overriden to keep ESC key from exiting out of dialog
DECLARE_MESSAGE_MAP()
...
...
...
};
|
|
|
|
|