|
Well definately you should not declare those variables, they should be declared (and inserted into sourcecode) when you create them by wizard.
I dont use VC.NET, just a classical VC 6, but it works this way:
I have main dialog, it is a class, it has two sourcefiles, header classfile.h and code classfile.cpp. When I insert a button and add a function to it it creates a function (OnButton1 for example) which is member of the dialog class (it is defined in header and function code outline is inserted into cpp file). If i create a edit box and associate a variable to it its definition is added to header file. (are you sure you added it ? because if you add it and then click 'cancel' button, then changes are lost, you have to click 'Ok' button in the wizard).
So now we have a function which is member of dialog class and a variables which are members of the dialog class. So they should see each other and they should be able to access each other...
if this does not help then please post a build log or project files, where we can see what is the error.
|
|
|
|
|
i don't understand either, but why should it be different to call a these functions in a user defined function from a non one ???
of course, you cannot call everything (UpdateData() is MFC specific), but you call it the same way...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Does anyone know how to embed a bitmap on the work area of a CMDIFrameWnd?
Jay
|
|
|
|
|
Check this[^]article...Author has painted Logo in the Backgound Window....
Hope this will help you...
|
|
|
|
|
this is EXACTLY what I was looking for. Thanks!!!
|
|
|
|
|
When I write a text file to my hard disk, I add \n to each line and, when viewed in an editor, the file displays as one would expect. But when I upload this file to my host, the text is displayed in one long line. I've found that if I add \r\n instead of just \n at the end of each line, the effect is reversed - my hard disk file is one long line and the remote file is displayed on separate lines. I've tried using both binary and ascii upload modes. I'm currently creating two files with the only difference being the \r in one of them to get around this. Does anyone know of a better solution.
Jack
|
|
|
|
|
I have made my main Dialog resizable . But for some reason i couldnt use
MoveWindow to resize the tab(Member CTabCtrl variable). In other words the elements of the tab are not altered ? Does this have to be resized in a different manner ?
|
|
|
|
|
How can I simplify this:
grid[x][y] == 0 ? grid[x][y] = 1 : grid[x][y] = 0;
I was thinking that I could make a pointer (or address) to that part of the array, then like shift the bits or something (each part of the array is a BYTE), but I couln't figure out how to do it.
Any ideas? thanks
|
|
|
|
|
grid[x][y] == 0 ? grid[x][y] = 1 : grid[x][y] = 0; means basicly :
<font color=#0000FF>if</font> (grid[x][y] == 0) {
grid[x][y] = 1;
}
<font color=#0000FF>else</font> {
grid[x][y] = 0;
}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Oh, yeah, I wasn't talking simplifying like that, I meant something like
BYTE GridPos = &grid[x][y];//might not even need this
GridPos &= GridPos;
(I know thats wrong, but thats what I'm thinking it should look like, just diffrent opperators)
|
|
|
|
|
don't ... it looks ugly, it's unreadable ...
I suggest keeping it as simple as possible and let the compiler do the work for you.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
ok,
if we consider the test (== 0 ) MUST be performed befor doing anything on the matrix, the code is not very "simplifying".
if not, i consider that, if grid[x][y] equal 0, it must be set to 1, and if it equals 1, it must be set to 0. it is then easy to do that with the bitwise not ~= operator :
grid[x][y] ~= grid[x][y];
according to the table :
~ 1 0
-------
= 0 1
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I'm not sure what is non-simple about what you already have, but this is an alternative:
grid[x][y] = ! grid[x][y];
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
hi everyone...
i have this little problem and i hope u can help me with it..
the problem appears when using the following code:
Graphics* pGraphics = new Graphics(hdc);
the previous code doesn't compile:
error C2660: 'Gdiplus::GdiplusBase::operator new' : function does not take 3 parameters
|
|
|
|
|
Did you miss the #define new DEBUG_NEW statement at the top of your .cpp file? To squelch the compiler error, simply undefine the new operator prior to including gdiplus.h .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Or you could use ::new for GDI+ objects. That way you do not loss the DEBUG_NEW functionality in the rest of your code.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Doh! Thanks for reminding me of the scope-resolution operator.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
i undefined new and everything went OK...but what's the functionality of DEBUG_NEW anyway..
|
|
|
|
|
saeedmalas wrote:
what's the functionality of DEBUG_NEW anyway
It implements the ability of the debugger to be able to track the line number and file name of where any memory leaks were allocated.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_debug_new.asp[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
|
I beleave that this will do everything you need.
#pragma push_macro("new")
#undef new
#include <gdiplus.h>
#pragma pop_macro("new")
Thank You
Bo Hunter
|
|
|
|
|
i tried the push_macro but it didn't work!!!i think this is because the "new" in my code should be altered..
|
|
|
|
|
Hi again,
How to set the TAB ORDER of a control in runtime manually?
Can anyone help me plz?
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
in the dialog editor, Ctrl+D ("change the Tab order"), then reorganize...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|