|
Greetings:
I am writing an application with Visual Studio 2003. I am using an C++ MFC Single Document Interface. My work has come to a dead stop because Visual Studio is not allowing me to add an event handler to the CMainFrame class.
It started when I added a push button to the apps main CFormView window. I wanted CMainFrame to handle it. I get an error message from Visual Studio:
"Add/remove of the function is impossible, because the parent class code is read only."
I have also tried adding a Windows message handler to CMainFrame (like WM_SIZE). Same complaint.
The "MainFrm.h" and "MainFrm.cpp" files are NOT read only. I checked their properties under Windows Explorer. Also, if I load either of these files into my editor and make a small change to them, they are saved without complaint. In fact, absolutely NONE of the files associated with this project, including sub-directories, are read only! They are all writable. I have also checked and verified that none of my source or project files have been inadvertently loaded into some other editor application.
Could somebody tell me what is going on?
Thank you,
Mark
|
|
|
|
|
I guess you are referring to using the "Wizards"? Try deleting files like the "Class Wizard" file and other intermediate files. <projectname>.ncb, .clw if they exist.
Jethro63 wrote: They are all writable.
or
Since they are all writable you could use the Text Wizard.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Hi Mike:
Yes, that worked. Thank you.
Suffice to say that this is a bug in Visual Studio?
Mark
|
|
|
|
|
Jethro63 wrote: Suffice to say that this is a bug in Visual Studio?
No... it's a feature designed to make you slow down to increase the quality of your work!
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Hello guys,
I want to pass specific command line parameters to my application, when user
right clicks on a file(of any type), then selects Open with line and
then selects my application.
Which registry entries do I have to add ?
Thanks.
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 16:11 Tuesday 16th May, 2006
|
|
|
|
|
Giorgi Moniava wrote: In this case the command line parameters I have set in the registry, when I registered the file extension are not passed to my app.
Are you sure they are still in the registry?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
|
Odd. I just created an SDI application, modified the registry entry so that additional command-line parameters were passed in, and ran the application. I ran it once by double-clicking the associated file, and again by right-clicking the associated file and selecting Open With. In both cases, the additional command-line parameters were used.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
|
Giorgi Moniava wrote: ...and then select my application then I get the problem.
At this point right here, do the correct registry entries exist? If they do, I'm not sure what the problem is.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
There is any program from Ms Visual Studio 6 or .. ?
|
|
|
|
|
"graphics" ? Please specify.
VS has a Icon and Bitmap editor. Not all that great but without knowing specifically what you are trying to accomplish.....
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
make my own button "picture" (make a button look as Circle or oval) make the whole window of application another shape than rectangle
|
|
|
|
|
This is a very broad topic. The first part would be to get the graphics themselves. You can download them or create them using the VC bitmap editor or use a third party editor depending on your preferences. It is beyond the scope of these forums to discuss graphics creation.
Your best bet will be to get the graphics in .bmp format. Then browse the button classes on this site there are a whole bunch that will display bitmap buttons and select one for your needs and follow the instructions there.
As for reshaping the window, for Win2K or higher you could use layered windows and a transparent color key or you could use SetWindowRgn to set the window to a specific shape.
|
|
|
|
|
Immunity18 wrote: ...make the whole window of application another shape than rectangle
See here.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Hi to all...
I want to create a timer in visual c++ (without using the class CWnd)that periodically send a message (for example a string). How is the best solution?
I thought....create a thread that stay in sleep and after this time sleep send the message...
I'll wait for any suggetion..
thanks!!
|
|
|
|
|
see the API CreateTimerQueueTimer
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
My suggestion is to use a waitable timer.
You create a waitable timer with a call to ::CreateWaitableTimer()[^].
Wait for the timer to be signalled with ::WaitForSingleObject() or similar.
If you're using a secondary thread you may want to stop the timer and exit the thread.
I suggest you signal an event for that, created with ::CreateEvent().
Unless you're familiar with multithreading I suggest you read Joe Newcomer's article[^] on the subject to avoid the most common pitfalls, such as avoiding ::sleep() as the plague and never call GUI related stuff from a worker thread.
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
You could always try timeSetEvent to create a multimedia timer -- I have used that from time to time. That essentially creates the new thread for you and calls a function you specify when it times out. Saves you some of the details about thread management.
|
|
|
|
|
1. U can use the api : SetTimer() / KillTimer()
2. U can use the multimedia timer : timeSetEvent() / timeKillEvent()
Chinese coder.
|
|
|
|
|
Castello07 wrote: I thought....create a thread that stay in sleep and after this time sleep send the message...
I Believe that will be right way, as this will not interrupt your main thread when you call sleep function!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi
I want to put the PC into Standby Mode. When I do that the following error:
System Standby failed
The device driver for the "Alcatel Multimedia Keyboard gateway' device is preventing the machine from entering standby. Please close all applications and try again. If the problem persists, you may need to update this driver."
Could you please resolve this issue.
Thanks in advance.
Raja Ratheesh
|
|
|
|
|
rajanponnalagu wrote: The device driver for the "Alcatel Multimedia Keyboard gateway' device is preventing the machine from entering standby.
Some device drivers are designed not supporting S3 State (Standby). When Windows requests all the devices to enter S3 state, these device drivers reject the request and issue some error code.
1) You may check if there any newer driver released by Alcatel for your keyboard gateway.
2) You may write an email to Alcatel customer support to find out if the driver supports Standby.
Maxwell Chen
|
|
|
|
|
I have a simple MFC Appwizard exe application. I specify the "Release" directory for intermediate files and output files. However I specify altogether different directory,say "OutPut", for output .exe file. and I want that only .exe file should be be generated in this directory. However I observe that .exp file and .lib file are also generated at the same location as the .exe file. I could not find any option in project settings for specifying the path for .exp and .lib file.
This problem doesn't arise if its Appwizard dll.
How can one solve this issue.
Thanks!
Suyash
|
|
|
|
|
Here's one way you could do it
Open the project properties and go to Configuration Properties->Linker->General. Then set "Output File" to $(ProjectDir)OutPut/$(ProjectName).exe
|
|
|
|