|
Ok I have written an MS Dos exe with visual c++ but whenever I double click the icon the MS dos screen only flashes up for a second and then disappears. The program runs from the command line fine.
At the start the program is designed to simply print a usage message to the scren.
Klara
|
|
|
|
|
This is what it supose to hapen ... the program it's executed, print the usage message and finish. When a program is finsih the window is closed by default
Bye,
Orbital^
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
Its supposed to print the usage message and then wait for the user to type in the arguements it wants the program to use. Thats the way it works when executed from the command line. This is such a pain. I can't figure out how to fix it and I know it's something really simple.
But hey I supose it's only simple if you know how to do it.
Thanks anyway.
|
|
|
|
|
If you set the program not to close on exit [Right-click => Program => Uncheck 'Close on exit'] what is the output? Do you get anything at all?
/moliate
|
|
|
|
|
It won't let me do that, whenever I right click on it I just get to see the general properties and not the others. When run through the command line it prints a usage message and then I type in the file name I want it to perform fopen call on. It then performs writes to this file. Can you see any other possible solution.
In any case thanks for your help.
|
|
|
|
|
Hi
I have taken some code from the code Project page on edit controls but i am having trouble getting it to compile. the code in itself compiles but when I try to add a member variable of that type it I keep getting the following error:
'm_MaskedEdit'
h:\edit\editdlg.h(23) : error C2146: syntax error : missing ';' before identifier 'm_MaskedEdit'
h:\edit\editdlg.h(23) : error C2501: 'CMaskedEdit' : missing storage-class or type specifiers
h:\edit\editdlg.h(23) : error C2501: 'm_MaskedEdit' : missing storage-class or type specifiers
editDlg.cpp
CD
|
|
|
|
|
You need to #include "maskededit.h" in your editdlg.h file.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
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 ...
|
|
|
|