I have a class (CVidCap) that I developed to grab frames from a Webcam and I want to make this a "dialog independent" class. When this class is created it populate a CMenu (MFC) object with all Webcam available in the system and i design a function that append this CMenu object in an application MenuBar. The problem is that when the CMenu object is attached, it is alweys GRAYED, and I can't handle any mouse button press in my class.
I'm trying to handle the application events in my independent class without insert any code in the application MESSAGE_MAP. I was clearly?
I´m programming my application with MFC from VC++. Unfontunly, I have a serious memory problem in my application. with every each any operation the memory grows 4k. Also, the application has to make a big numer of operations, So the memory grows until the application crash.
Any operation is made in a separate thread. The thread is created and later destroyed after each operation. It uses a pointer which references the ado connection. The entity of the connection is created in the main thread. Inside the thread, I create , open, use and close a new Recorset. The recorset uses the connection pointer to access the database.
The creation and destruction of the thread is fine, because in operations without recorset, the memory is stable. However, the threads that use recordset prevent the memory being released appropiately.
This is the code that i use to create the connection:
To add information, now , i´m looking that the application grows 4k(in ram memory) with each: pConn->Execute(.....); , that happend when the execution is inside a child thread, but not when it´s in the main thread.....
I have developed an MFC application which reads data from a Joystick (x, y, z and 4 buttons).
All the data regarding the joystick is displayed on the dialog.
However what I would like to do is convert this Joystick EXE into a DLL with some functions calls to access the Joystick data. This would allow other applications to obtain the Joystick data.
What I did not want to do was include all the bits required (from the original MFC Joystick application) into any applications that needed the Joystick information.
Now my question is can this Joystick MFC application be converted into a DLL; can you include function calls to make the dialog visiable or hidden as required from the EXE applications that use this DLL.
i.e. are they any limitations on the DLL that I have to take into account. The Joystick code uses Windows Messages JOY1MOVE, JOY1BUTTONUP etc and timers.
i have a list box,edit box and a button named add.
The problem is the code i wrote for the add button which takes the string entered in the edit box keeps it in the list box.
My problem is when i double-click on a item in the listbox,i should be able to edit that string and when i am done,the new string should be there instead of the previous one.
How can a listbox get the properties of an edit box?
I have a small contract to slightly alter a piece of software that I own to adapt it to the needs of a client. Does anyone know if there is any precedent for who by default has the intellectal property in this case? Would I have to specify this in the invoice that it in no way represents a transfer of IP if I wanted to keep control of the software even after the modification were made? The client is in Europe.
Unless otherwise stipulated, you would likely retain ownership of the intellectual property. For safety, however, you should create a contract that clearly specifies this.
(If the creative forces reside in the contractee and you work exclusively for them, even if a contractor, the work would likely be classified as "work-for-hire" and the contractee would own the copyright and intellectual property, but that doesn't sound like your situation.)
Also be aware that any translations are copyrighted separate from the code by the translator. Be sure you get a signed contract assigning copyright back to you in this case.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
I'm wondering about a behaviour with MFC application on a CDialog concerning the mnemonic.
I always thought that an object(e.g. a CButton)'s
function is executed when pressing ALT+Mnemonic.
Now I saw that the function is executed if the focus is in a non-entry control (like a CButton) without pressing the ALT key.
Is there a chance to avoid this behaviour and only execute the function by using ALT+Mnemonic?
I am trying to write a browser monitor. If i could get a handle to the current open windows then I can decide whether it is a browser , if it it - then look on the window control to look for the site that is currently being viewd.
As the same way I can turn off the display programmatically, I will turn it back on programmatically. I don't want the user can turn on the screen. That's why I tried to lock mouse moves, but it does not work.
Unless you can convince me otherwise, I consider that to be very non user-friendly. If I'm working on the computer and some application decides that the monitor needs to go off and I can't turn it back on by moving the mouse, I would seriously consider removing that application.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
Yes, you're right for this point, but my application is targeting PC which displays multimedia messages on screens (LCD or Plasma) and, normally, there are no interactive users on these machines.
My application must turn off/on screens when no messages are displayed in order to save LCD/Plasma life time. My solution works well because, for that kind of PC, there are no users, but I want to develop my application properly, and I cannot accept that the screen could turn on without my application.
Maybe this is not possible on Windows platform to turn off properly the screen.
The last thing I would say is that I could do that on Atari ST platform, and fifteen years later, I could not do the same thing on Windows platform fifteen years old ?!! I think this is the progress...
Yes you are right, but my purpose is to use this power-saving feature from my application. I want to be able to turn on/off monitor when I need, and no turn back on of the display when the mouse is moving.
CopyFile("c:\\boot.ini","\\\\127.0.0.1\\e:\\boot.ini",FALSE);when I use the copyfile function after I have established a ipc$ connection with the target machine which I'd like to copy file to ,I receive a error code 67(using getlasterror),the error remains even when I change the ip address of the targe machine,and I think there is no syntax error ,what's the reason?
I've not tried this before, so this is just a guess, but shouldn't e: be mapped to a server\share on the target machine? In other words, if e: were mapped to \\127.0.0.1\someshare, then the target would simply be e:\boot.ini. Yes?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
I inject a mfc dll inside a process, after i create a windows a windows using CWnd::CreateEx inside CWinApp::InitInstance but when InitInstance finished my windows is closed. I tried to solve this problem creating a new thread and inside this thread a create my windows but when i call CWnd::CreateEx my process crash. how can i solve this problem? how can i create a new windows in a MFC Dll injected inside another process?
I am practising writting a windows application purely by hand and by using windows API , as I am a beginner in windows programming and want to do some studying.
In almost all the explanations to the provided facilities, I find in the header section such statements as "declared in..., include windows.h", so I thought the facilities would be availabe so long as windows.h was included.
But that immediately proved wrong in compiling.
Yet more embarrassing is the function WinMain, I wrote it with returning type int, as is stated in MSDN, but the compiler(VC 6.0)reported errors for this.
Can you tell me how I can use the API functions and how to handled this problem?
Thank you for your help!
I debugged the program again and solved some of the problems by myself. But the following one is really puzzling:
VC6.0 reported after compiling:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
The WinMain function is written as follows:
int _stdcall WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
//register the window class and carry out things like that
I used the appWizard to create a win32 application and all the problems were gone. However, I still don't understand why the error was reported. _main is not defined in the win32 application either.
i use a CDialog with a couple of CustomCtrls arrange vertical. My CustomCtrl uses a CToolTipCtrl to display ctrl states.
When the Tooltip appears the control "under" the tooltip would not be repainted up to to the time the dialog call invalidate or the control gets the focus.
I want to open multiple childs windows inside one of the childframe window of an MDI application. Any idea about how to achieve this?.
Details is like below:
I have my mainframe window derived from CMDIFrameWnd. Now in one of the childframe ( derived from CMDIChildWnd ) I want to open mutiple child windows i.e my child frame should behave as a parent to another child windows. Please let me know how to achieve this.
Have a wierd one. One of our customers recently purchased a new computer with XP PRO installed. Out software prints fine on others customer's pcs running XP PRO, but this one wants to print everything upside down and backwards. Has anyone ever seen this happen. Would appreciate anyone's input.
Have you tried putting the paper in the other way around?
More seriously, I would look at differences in printer / printer drivers rather than XP.
I used to have a lot of problem with Epson drivers when HP ones worked just fine.
Does the problem happen when you change printers? Does it happen on a known-good-system
with the suspect printer?
Does the issue happen if you print from another application? Or just yours? I usually
use Wordpad as a simple should-be-fine application.
This is likely some really obscure print driver option that is running amuck, but if you solve it, I'd love to hear the reason. This sounds like a great trick to play on some of my evil co-worker's PC. :mwaahaaha:
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
Last Visit: 31-Dec-99 18:00 Last Update: 24-Oct-16 2:14