|
Is it true that
m_childSplitterFrame.CreateView(0,0,RUNTIME_CLASS(CMyView),CSize(100,100),pContext)
means create the view with minimum size of CSize()?
|
|
|
|
|
Yes, this is how it is documented.
But for me it somehow does not work.
So I use SetColumnInfo() and SetRowInfo() the first time OnSize() is called.
Failure is not an option - it's built right in.
|
|
|
|
|
I wanted to move some things around, so i moved two functions from my dialog based MFC program (compiler= VC6.0) into a new cpp file called Functions.cpp
I added the functions, and the #include "stdafx.h" to the new cpp file
And added #include "Functions.cpp" into my "stdafx.h" file.
But now when i attemp to compile i get errors like this for both functions:
error C2084: function 'void __cdecl Func1(void)' already has a body
I looked around, tried some ; on the function definitions, tried some #ifdef things but nothing seemed to work...
So what do I do?
thanks a million!
//Johannes
|
|
|
|
|
Johpoke wrote: I added the functions, and the #include "stdafx.h" to the new cpp file
And added #include "Functions.cpp" into my "stdafx.h" file.
You need to create a Function.h file that contains the prototypes for the functions now contained in Functions.cpp and include the .h, not the .cpp, in the stdafx.h file. Add the Functions.cpp file to the project.
You're getting the "function already has body" because stdafx.h contains the contents of Functions.cpp - you told it to include it, so it did - and now you're trying to define the function again in the body of Functions.cpp.
Judy
|
|
|
|
|
Thanks!
Works perfectly now
//Johannes
|
|
|
|
|
Hi,
I have a trouble to create an Avi using DivX compression in VC++. After getting the DIBSECTION information from the 1st DIB bitmap, the AVIStreamSetFormat() generates an AVIERR_BADFORMAT return (for DivX 6.6.1 Codec).
Does anybody know why this happens and how to fix the problem?
Thanks for the help,
Stanley
|
|
|
|
|
Hey guys,
I'm using "ManualMap" (loads a DLL without calling LoadLibrary, does relocating and everything manually) for loading a DLL into a target process, but as soon as the process is running on Vista, it just crashes. I dont know, if its caused by my module itself or the loader (I dont have Vista myself, so I cant test/debug it), but since I read in "Dynamic TEXT Section Image Verification" (http://www.codeproject.com/useritems/VerifyIntegrity.asp), that base relocating is working differently on Vista, this may be the problem. So, could someone explain what is different on Vista? When I have problems implementing it, I'll ask again^^
Xero|Hawk
|
|
|
|
|
Ok... I am working on C++ in highschool, I only just recently learned it, so I am still a beginner. I need some help with something very simple.
I am makeing a program in Visual C++ 6.0, it needs to have a button that says 'Start', and when clicked it changes to 'Stop'. When clicked the first time, a timer starts, and counts until I click the button again to stop it, in wich case the buttons text changes to 'start'.
I have no idea how to change a buttons text mid program. I know how to do timers, those are easy enough, but this button escapes me. Any help you can give would be GREATLY apreaciated.
|
|
|
|
|
Do you need to SetWindowText(); ?
|
|
|
|
|
Hi,
The best way is to create a member for the button using the class wizard.
As far as I remember, In Visual studio 6.0 , you can open the class wizard with ctrl + W.
After creating the member for the button,you can use all its methods using that member.
For example:
Let say that you called your member m_MyButton.
Using that member,you can change It's caption by calling the SetWindowText(i.e m_MyButton.SetWindowText("STOP")).
Eli
|
|
|
|
|
As WhiteSky mentioned, SetWindowText() will do it. If the button is in a dialog, you can also use SetDlgItemText() .
|
|
|
|
|
Ah! Thank you all SO much! I never would have found that, seeing as I seem to have the codeing skills of a badger. Alright, I will let you know if it works.
|
|
|
|
|
And a more thing if you have a variable for your button you can use m_Button.SetWindowText(""); if you dont have you can use of GetDlgItem(IDC_BUTTON1)->SetWindowText("");
|
|
|
|
|
Alright, well, that code worked perfectly. But now I need some way to make sure the button knows when to switch. I was thinking some code like
'if (counter == 1)
{
m_Counter.SetWindowText("Stop")
counter = 2
}
if (counter == 2)
{
m_Counter.SetWindowText("Start")
counter = 1
}'
The problem with this is, this relys on me setting one as the default value immedietly, and I don't know how to do that =/
|
|
|
|
|
I've used the CreateDibSection function to create a DIB for bitmap...
HWND hWnd = this->GetSafeHwnd();<br />
HDC hdc = ::GetDC(hWnd);<br />
<br />
BITMAPINFO bmpInfo;<br />
<br />
ZeroMemory(&bmpInfo,sizeof(bmpInfo));<br />
bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);<br />
bmpInfo.bmiHeader.biBitCount = 8;<br />
bmpInfo.bmiHeader.biCompression = BI_RGB;<br />
bmpInfo.bmiHeader.biSizeImage = 0;
bmpInfo.bmiHeader.biPlanes = 1;<br />
bmpInfo.bmiHeader.biHeight = 768;<br />
bmpInfo.bmiHeader.biWidth = 1024;<br />
bmpInfo.bmiHeader.biClrUsed = 256;<br />
<br />
hFrameBitmap = CreateDIBSection(hFrameDC, &bmpInfo, DIB_RGB_COLORS, &pBits, NULL, NULL);
I'm wondering how I can set the 4th parameter to point to a FILE* type which I store my raw pixel data, where pBits must be a LPVOID.
Thanks
|
|
|
|
|
Hi folks!
Did you ever use System Console Software?
If no, try it now. Very interesting approach to scalable and amazing features for every day ( www.syscon.tsoftech.com ).
|
|
|
|
|
I use codeblocks + wxdgets
and try a sample
but get the following
:: === t3, Debug ===
D:\wxWidgets-2.8.3\include\wx\platform.h:14: warning: "/*" within comment
D:\wxWidgets-2.8.3\include\wx\platform.h:14: warning: "/*" within comment
D:\wxWidgets-2.8.3\include\wx\platform.h:14: warning: "/*" within comment
D:\wxWidgets-2.8.3\include\wx\msw\dde.h:100: error: `wxDDEConnectionList' declared as an `inline' field
D:\wxWidgets-2.8.3\include\wx\msw\dde.h:100: error: expected `;' before '&' token
D:\wxWidgets-2.8.3\include\wx\msw\dde.h:105: error: expected `;' before "protected"
D:\wxWidgets-2.8.3\include\wx\msw\dde.h:108: error: `wxDDEConnectionList' does not name a type
D:\wxWidgets-2.8.3\include\wx\msw\dde.h:130: error: `wxDDEConnectionList' declared as an `inline' field
D:\wxWidgets-2.8.3\include\wx\msw\dde.h:130: error: expected `;' before '&' token
D:\wxWidgets-2.8.3\include\wx\msw\dde.h:135: error: expected `;' before "protected"
D:\wxWidgets-2.8.3\include\wx\msw\dde.h:137: error: `wxDDEConnectionList' does not name a type
D:\wxWidgets-2.8.3\samples\minimal\minimal.cpp:163: error: `menuBar' undeclared (first use this function)
D:\wxWidgets-2.8.3\samples\minimal\minimal.cpp:163: error: (Each undeclared identifier is reported only once for each function it appears in.)
:: === Build finished: 10 errors, 3 warnings ===
why?
|
|
|
|
|
cform0 wrote: why?
What exactly are you asking "why" to?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
cform0 wrote: why?
Why NOT fix the warnings and errors one by one?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
cform0 wrote: why?
Your question is why you get these errors?
|
|
|
|
|
Hi,
So here's my problem: In certain circumstances, I want to stop my application from being closed when the "X" Windows sysmenu button in the top right corner of the application is pressed.
How can I do this? I tried catching the WM_DESTROY message and not running a PostQuitMessage(0) but this only leaves the process running; the application window is still destroyed.
Thanks in advance!
KR
|
|
|
|
|
If working with a dialog application, you can catch the command notification from the IDCANCEL button, which is what the [X] is on a normal dialog box.
I am not certain, but I think that the [X] generates a WM_SYSCOMMAND message with a SC_CLOSE notification, so you should be able to intercept WM_SYSCOMMAND .
In fact, you might be able to do the same for dialogs...
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Catching WM_SYSCOMMAND with SC_CLOSE works, thank you.
KR
|
|
|
|
|
KellyR wrote: How can I do this? I tried catching the WM_DESTROY message and not running a PostQuitMessage(0)...
Did you try to simply return 0?
KellyR wrote: ...the application window is still destroyed.
That's because the WM_DESTROY message is sent after the window has been removed from the screen. Try WM_CLOSE instead.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
... simply return nothing.
--
=====
Arman
|
|
|
|