|
Try using RegisterHotKey(...).
|
|
|
|
|
I am trying to use funcion keys in dialog boxes. I considered trapping the keys or using an accelerator table but have not found enough information to implement either.
What is the best way to accomplish usage of function keys in dialog boxes.
Thanks,
Rick
|
|
|
|
|
Hi
you have 2 possibilities here
if you only want to intercept 1 or 2 function keys use PreTranslateMessage if you want them all use a combination of
LoadAccelTable and PreTranslateMessage.
For the second choice see msdn magazine July 2000
Kurt
|
|
|
|
|
Hello everyone!!!
In my project, I have moved some files around, and all of my classes disappeared from the Class View tree. The Class Wizard only shows objects derived from MFC(no "stand alone" classes and no first siblings of CObject, and I have lots of those). I have discovered that almost any Class Wizard operation(addition of data member, function, message handler, etc.) with any class from Class Wizard's project set would bring that particular class back to the Class View tree. Now, I have all the Class Wizard's classes back in my Class View window, but not those that cannot be seen in Class Wizard.
What is the relationship between Class Wizard and Class View? How can I bring back custom classes to Class View tree?
Thanks.
Kirill.
|
|
|
|
|
Hi Kirill,
try this:
- close your workspace
- delete any .ncb .opt .clw file in your project directory
- re-open the workspace
Cheers,
Paolo.
|
|
|
|
|
Hi ,
supposing that I have two classes : A and B . I declare a nested class in B called C.
class A
{
///
}
class B
{
///
class C
{
///
} ;
}
what is the problem : I want that the C class to be a friend of the A class. I can't write in the def. of class A friend class B::C , because B is not defined .Even if I define the B class before the A def. it's no good . I can't move the code of the B class declaration before the delcaration of A ( some other classes are between them ) .
So , what can I do ?
|
|
|
|
|
Try the following if all three classes are defined in one *.H file.
// forward declaration
class c;
class A
{
friend class C;
///
};
class B
{
///
class C
{
///
};
};
Otherwise, declare all three separately, and include C as the member of B.
|
|
|
|
|
My VC++5 application has eight small toolbars. They're normally docked 4 to a line so that users see 2 rows of toolbars:
[bar1] [bar2] [bar3] [bar4]
[bar5] [bar6] [bar7] [bar8]
This looks great until the user adjusts the width of the main frame window. MFC then takes it upon itself to re-arrange these toolbars so that they all remain visible. For example, halving the window size might give:
[bar1] [bar2]
[bar3] [bar4]
[bar5] [bar6]
[bar7] [bar8]
Does anyone know how to ask/force MFC to stop doing this and leave the docked toolbars alone ?
|
|
|
|
|
|
Does anyone know how to pass a CRecordset pointer thro the clipboard to another application? I am able to pass the pointer using Global memory but the database handle gets screwed up.
|
|
|
|
|
I don't know what you mean with Global memory, as in Win32 you can't access memory owned by other processes. Anyway, you can't pass a pointer to an object to another process, as your application will crash when it tries to use it. Furthermore, you shouldn't pass a pointer to a CRecordset from one thread to another, as many of the CObject derived classes store data in the Thread Local Storage, and your app will crash after some time of well working.
Sorry for my English!
|
|
|
|
|
If you create a shared data segment in a DLL, then you CAN access and share memory among multiple processes in Win32.
Typically, these variables have constant lifetime - the entire time the DLL is loaded by any process.
I have not found a way to make 'dynamically allocated' shared memory available, however, without using memory mapped files.
The way I send data back and forth among threads is to create a data structure that contains the relevant data. Pass the pointer to the data structure to the other thread, and the object should have a member function or else a constructor that can accept a pointer to the data structure for copying the data to itself. So you have this assignment step, which is generally safe, it is just the CObject part of the object that usually does not transfer well among threads.
|
|
|
|
|
I need to disable the CD rom drive during my app runtime.
Does anybody know how can i do it without rebooting? Is there an API call or a registry key to set?
Thanks in advance
|
|
|
|
|
I want to write VxD to access the PCI Card. can anyone help me in DDK usage with Visual C++ 6.0.
if you can tell me the URLs from where i can get something for VxD writing.
|
|
|
|
|
I have created an image list with ILC_COLOR32.It is working propertly when my system supports 16777216 colors.When I change color support to 65536 colors, nothind is displayed.In this case case, the image list ceation is success, but Add() and Draw() fails.
|
|
|
|
|
Hi,
I am experiencing some strange problems. I am getting a whole bunch of access violations when I run
my program. The program doesn't crash but in the debug window you can see about 200 access violation
messages. I tracked this down to CMainFrame::OnCreate(). Infact, all of these access violations occur
at the point where the CToolBar's CreateEx function get called. Here is what App Wizard created for
my project for the CToolBar,
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
The Toolbar get created, but with a whole bunch of access violations along the way. Another thing,
this doesn't happen all the time. I would guess three out of five times I run the program, I get all of these
access violations. Anyway, I hope someone know why this is happening. I would really appreciate the help. Just in case someone was interested, here is a look at what the violation message looks like
First-chance exception in Plas.exe (GDI32.DLL): 0xC0000005: Access Violation.
Thanks
|
|
|
|
|
I don't know if this is the case, but I experieced some problems with AppWizard generated applications if they had a Toolbar but not a StatusBar, because even if I unselected the StatusBar in the Wizard page, some generated code still made use of it. Don't know why, but it's true.
It seems, however, that your problem is a little different. You wrote of the toolbar creation, so I thought of my past troubles with it.
Cheers,
Paolo
|
|
|
|
|
I am surprised that your program continues to run after an access violation. Perhaps VC 6 has something new for debugging that allows a program to continue execution in spite of an access violation; if so, I would not know about it since I still use VC 5. You might check to see if it is possible to get the debugger to stop when an access violation occurs. If you can do that then you can look at the stack and you might get a good indication of the problem.
Are you sure you are working with a debug version of your program? You should, if you are getting errors like that.
|
|
|
|
|
When you get your access violation don't cancel let it go into the debugger and look thru call stack window
and start putting break points in in only the cpp's that you made not the one's from MS.
|
|
|
|
|
sspcmp:
Unless your reply is relevant to my reply, you should reply to the question instead of my reply. I received notification of your reply by email but I already know how to use the debugger.
|
|
|
|
|
Hi, I am stuck...
We use a custom control (yes, THE Grid Control in a big project .
With NT4 everything is running fine, but now someone dared to run it with Win98 and W2k.
The Result: every dialog with the grid in it refused to open!!!
The samples provided with the grid run fine on the same machine, so it is nothing with the grid.
When I setl the custom control in the resource editor to the classname EDIT, the dialog starts (but it looks terrible, of course .
So: what can be wrong in this project?
ANY hints?
Martin
|
|
|
|
|
Did you try to recompile the code under w98 ? I have experienced some similar problems - I can't run the programm compiled in NT under 98 , but the programm compiled under 98 it works fine on both NT & 98.I think some links aren't good ....
|
|
|
|
|
Yes, I tried it, but with no success.
In the meantime I got another hint:
The dialogs don't load when I put the ressources into an external DLL (as it is the case in this project)!
Is there a way to tell the application, that it has to run with such an external DLL AND custom controls?
Did I miss something important to do? Every other dialog works just fine, only the dialogs with custom controls in it refuse to load...
Martin
|
|
|
|
|
Hi, I've got it!!!
When using an external DLL, you have to register the window class for THAT DLL!
So you have to set the hInst of the WNDCLASS-structure via AfxGetResourceHandle() instead of AfxGetInstanceHandle() as it is done most of the time...
Happy greetings, Martin
|
|
|
|
|
Hi, I am stuck...
We use a custom control (yes, THE Grid Control in a big project .
With NT4 everything is running fine, but now someone dared to run it with Win98 and W2k.
The Result: every dialog with the grid in it refused to open!!!
The samples provided with the grid run fine on the same machine, so it is nothing with the grid.
When I setl the custom control in the resource editor to the classname EDIT, the dialog starts (but it looks terrible, of course .
So: what can be wrong in this project?
ANY hints?
Martin
|
|
|
|