|
oops ...thanks Christian
|
|
|
|
|
I created a new toolbar,and want to use ShowWindow(SW_HIDE)to make it invisible.
But actully all the controls inside were invisible,but the frame still existed.How to make them all invisible,including the toolbar frame and all controls in that bar?
Thx ahead.
|
|
|
|
|
Hi,
What you mean?
frame window invisible or toolbar invisible?
If you want whole frame window invisible, do this.
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(SW_HIDE);//m_nCmdShow);
pMainFrame->UpdateWindow();
Best regard.
I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
|
|
|
|
|
Sorry
I mean that I creat a toolbar and in that toolbar I create a dialog.
when the toolbar is not docking on the mainframe,I use
m_wndToolBar.ShowWindow(SW_HIDE) to make the toolbar invisible,
But actually the dialog turns invisible,the toolbar still exists.Why?
|
|
|
|
|
You have to recalculate the layout of your frame window. Just hiding your bar will do just that, hide it. It won't reposition your other bars for instance.
|
|
|
|
|
If you're using MFC, you can do what I think you want by calling CFrameWnd::ShowControlBar
|
|
|
|
|
Hi,
the symbol :: puzzles me. I already know that this is a scope resolution operator which is used to execute a parent class method from within a subclass method.
Plz look here,
return &class_name::class##class_name;
Note: ## is used to connect two separated string.
class##class_name is NOT a method, and &class_name::class##class_name in all means a pointer to a CRuntimeClass struct.
There are others, COjbect::classCObject, CCmdTarget::classCCmdTarget,etc.
What doest :: mean here??
Best regard.
I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
|
|
|
|
|
NicholasCougar wrote:
What doest :: mean here??
It means just what you said
this is a scope resolution operator
In a macro,
#define MYMACRO(class_name)\
class_name::class##class_name
used as MYMACRO(CMyClass); evaluates to
CMyClass::classCMyClass
Of course, classCMyClass has to be declared in CMyClass
|
|
|
|
|
And you'll find the classCMyClass member is declared and defined in the DECLARE/IMPLEMENT_DYNCREATE macros.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Hi,
From MSDN, :: is scope resolution operator for executing METHOD declared in superclass. But classCMyClass is not a METHOD, but a STRUCT.
Can :: be used in this way?
Best regard.
I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
|
|
|
|
|
:: is not only used to specify superclass methods. It can be used to:
Specify methods in your own class, Specify class methods (static) in any class, Resolve namespaces, Reference instance and class member variables, Specify any nested classes, structs, enums, etc. All it really does is give the location of a specific item.
E.g.
std::cout // specifies that cout is in the std namespace
class C { enum E { num1 }; static void sfunc(); };
void func(C::E num); // specifies the type E in class C
func(C::num1); // calling function with class C's enum value num1
C::sfunc(); // calling class C's static function sfunc()
etc...
Hope that helps.
|
|
|
|
|
I need to pass an array to a function. When the array is one dimensional it works. When I try to use two dimensions it doesn't work. What can I do to fix this?
Steve
Not all who wander are lost...
|
|
|
|
|
You should pass the char** and not the char*
Nish
p.s. show some code too.
One little CD gone,
Then two CDs gone,
Then 5 more gone,
For a total 7 gones,
If I was a CD R,
I'd wanna cry,
Cause I'd be just a goner,
For a nasty CD burner.
[funny how frustration wakes up the poet in me]
|
|
|
|
|
Thanks.
the function is as follows. (don't comment on the lack of use of language features. I am not allowed to use them on this project.)
is there a way to do it without using char **?
[code]
void BuildBoard(char *arBoard[], int Rows, int Cols)
{
int inRows,inCols;
char inChar;
for(inRows = 0;inRows < Rows;inRows++)
{
for(inCols = 0;inCols < Cols;inCols++)
{
scanf("%c",&inChar);
arBoard[inCols][inRows] = inChar;
}
}
return;
}
[/code]
Steve
Not all who wander are lost...
|
|
|
|
|
And how are you calling the function? What are you passing as the first arg?
Nish
One little CD gone,
Then two CDs gone,
Then 5 more gone,
For a total 7 gones,
If I was a CD R,
I'd wanna cry,
Cause I'd be just a goner,
For a nasty CD burner.
[funny how frustration wakes up the poet in me]
|
|
|
|
|
int Rows, Cols;//I already have the vales for these
char Board[100][50];
BuildBoard((char **)Board,Rows,Cols);
I need to be able to do this without using the typecast and without making Board a char *. Thanks.
Steve
Not all who wander are lost...
|
|
|
|
|
i'm trying to use the max(int, int) method from stdlib
I'am including stdlib, but the compiler keeps tellling me that the 'max' is an undeclared identifier.
does anyone know how to get me out of this problem?
thank you.
|
|
|
|
|
HI!
Try to use __max(int,int)
#include <stdlib.h>
void main(void)
{
int maxim = __max(20,10);
}
Bye,
Orbital^
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
max is a macro
The Borland C++ compiler define max in stdlib.h, but Visual C++ define max in Windef.h
Antonio
|
|
|
|
|
max is a macro
In Windows it is, in C it is and in "Visual C++" it often is, but in C++ it is not. In C++ it is a template function that is to be found in (IIRC) algorithm.
|
|
|
|
|
How to use datagram sockets?
ie what are the methods to call, to create a server or listening socket nd client socket.
1. create socket
using create method,I creted 2 sockets.
But I dint know,whether two should be on same port or not.
Next what I have to do?
CAll the connect method?
Anyone pl help me to use SOCK_DGRAM option
ie the sequence od opertaions for datagrams.
Thanku
Be creative
Once your mind is streched by a new idea, it will never regain its original dimension
|
|
|
|
|
Datagram sockets don't have a method to connect...
use sendto and recvfrom for send/receive data with this socket
Antonio
|
|
|
|
|
As mrcod said, there's no connect() or accept() for datagram sockets, since they are connectionless socket. Usually what I do is:
the one send data:
socket();
get receiver's address (fill in struct sockaddr_in with the receiver's ip address and port number);
sendto();
the one receive data:
socket();
bind();
set it to a non-blocking socket if you'd like to
recvfrom();
|
|
|
|
|
How i can use CreateMDIWindow(...) in my MFC MDI DOC-VIEW application.
I need create new stream for my new mdi-window.
Thanks
Daniil Ushakov
|
|
|
|
|
Hello.
I have a program running under doc/view single doc architecture. When the user opens a text file, the program displays the data from the text file in its original form. Special thanks to Tychom for the key technique.
When the program first opens the file, it saves data into a CStringList. However, if the user make changes to one or more lines of text, I have not been able to access the updated text.
For example:
Original text:
---
a
b
c
---
Modified text:
---
az
b
cy0
---
I can get the updated text using GetWindowText(), but that function only returns a specific line parallel to the cursor. What if the user add one or more new lines? I have no way to accessing a specific line.
There is a function in CEdit, getline(). The first parameter is the line index. The second is a reference to LPTSTR. I tried to use that function to get a specific line, but the program crashed with an error "bad pointer."
LPTSTR text;
CEditCtrl::getline(1, text); // this program crashes here every time
Is there a way to access a specific line inside CEditView not dependent on where the cursor location?
Thanks,
Kuphryn
|
|
|
|