|
Sometimes, a header is named .hh or .hpp to emphasize it's a C++ (not C) header.
Best,
Jun
|
|
|
|
|
But can you call upon a C header when you are working with a C++ Project???
Thanks,
Jay
|
|
|
|
|
Sure. Compilers don't distinguish C from C++ any more.
Best,
Jun
|
|
|
|
|
Does this mean that .h files are definately a C HEADER ?
|
|
|
|
|
No. The standard does not dictate an extension; the use of .h is by convention. The best you can say is that a file with a .h extension is probably a C or C++ header file.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Some people (mostly unix folks), like to name their C++ files with a .cc prefix. Similarly, they use .hh prefix for C++ header files. There are also those to use .C and .H for C++ files, as the unix file system is case sensitive.
I bet someone in your project is or was a unix programmer.
--
A Stern Warning of Things to Come
|
|
|
|
|
i need any cood use thes data repeater pleas send to my email
ahm_goma2002@yahoo.com
|
|
|
|
|
go2go1 wrote: need any cood use ...
i need, i need i need !!!
go2go1 wrote: need any cood use thes data repeater pleas send to my email
where's the punctuation man ?
go2go1 wrote: ahm_goma2002@yahoo.com
noway forums are to share. go die with your email
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Hi,
I have a dialogbox containing a textbox.
In order to set the content of the textbox i do.
dialogbox temp; (dialog is the name of the class i added)
temp.textbox.SetWindowText("text"); (textbox is the name of the textbox)
temp.DoModal();
i have problems with the line
temp.textbox.SetWindowText("text");
even if when i use that line for textbox in the parent form
there's no problem.
Where i go wrong ?
Another thing, if i wanna raise a non-modal dialogbox
what should i write instead of temp.DoModal() ?
Thanx,
Desmo16.
|
|
|
|
|
You can't call SetWindowText() on a window that hasn't been created yet. Set the text in OnInitDialog() in your dialog.
If you want a modeless dialog use Create() instead of DoModal().
|
|
|
|
|
I haven't an OnInitDialog as i have in the parent window.
Maybe i go wrong in adding the dialog box.
I add a resource whose kind is IDD_DIALOGBAR,
then i add a class called xxx of kind IDD_DIALOGBAR
having CDialog as baseclass, but there's no OnInitDialog method.
Is that the correct way ?
Generally which is the procedure to create another form ?
Thank you so much,
David.
|
|
|
|
|
You are supposed to override OnInitDialog() yourself if you need to. Go to the Class View and select your new dialog. Right click and select properties. In VC7.1, along the bar there is a button labelled Overrides. Find OnInitDialog, click on the drop list and add the function.
|
|
|
|
|
It worked great ! Thanx !
|
|
|
|
|
Another little question:
the string i use to write in the textbox show all in 1 line
and there is a strange simbol where it should go to a new line.
In the strings i tryed to use "\n" and also "\n\r" to obtain a newline,
and in the MessageBox it works.
Any suggestion ?
|
|
|
|
|
And what is this "textbox"? A static text control? An edit control? A rich edit control? A custom control? If you are using an edit control you need one that is set to multiline. If you want to type in one that accepts the enter key, set it to want return.
The standard line endings for windows is "\r\n" so use that when you want a line ending on a windows system.
|
|
|
|
|
i was meant to say an edit control.
anyway, the mistake was mine, 'cause i wrote
\n\r instad of \r\n. Sorry
|
|
|
|
|
I was reading about this compile-time computation stuff and quickly found a limitation where according to c++ standard, and vs2005 restrictions , that you can only pass an int as a parameter... so all these metaprograms would be taking in either typename's or ints in the <>'s and returning ints as with enum
<br />
template<int N> <br />
struct Pow3 <br />
{ <br />
enum { result=3*Pow3<N-1>::result }; <br />
}; <br />
<br />
template<> <br />
struct Pow3<0> <br />
{ <br />
enum { result = 1 }; <br />
}; <br />
or static const int
<br />
template<int N> <br />
struct Pow2 <br />
{ <br />
static const int result = 3*Pow3<N-1>::result; <br />
}; <br />
<br />
template<> <br />
struct Pow2<0> <br />
{ <br />
static const int result = 1;<br />
}; <br />
My question is i've seen code that used a function to accept parameters of other types...would these be compile-time initialized/optimized to?
<br />
template <int value, typename returnType><br />
struct DividePi<br />
{<br />
static returnType Result(float SomeFloat)<br />
{<br />
return Pi / value;<br />
}<br />
};<br />
<br />
template <typename returnType><br />
struct DividePi <0, returnType><br />
{<br />
static returnType Result(float SomeFloat)<br />
{<br />
return 0;<br />
}<br />
};<br />
|
|
|
|
|
|
If I create an application using CFormView, not CView, and do not want to draw on the form directly, where can I draw on? Is there a visual control for that?
Thank you!
modified 9-Mar-17 17:20pm.
|
|
|
|
|
Daniel Kanev wrote: If I create an application using CFormView,
First create it.
Daniel Kanev wrote: do not want to draw on the form directly, where can I draw on? Is there a visual control for that?
What do you want to draw?
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
What do you need to draw(color,picture,...)
do you want to know events
whitesky
|
|
|
|
|
I want to draw lines, rectangles, everything that is supported by CDC. I would like to capture events too.
Thank you!
modified 9-Mar-17 17:20pm.
|
|
|
|
|
for draw line and rec,... use from WM_PAINT and use from dc for draw line CPaint dc(this);
whitesky
|
|
|
|
|
I've a problem using std::string in a VC6 application. As I've to connect to Oracle, so I use OCCI (Oracle C++ Call Interface), and link with OCCI LIB's. However, their functions are using std::string as parameters, but my most of my application is using LPCTSTR stuff to pass parameters.
When I add the lines below, without do any other coding. It throws SmartHeap memory exception
BOOL OCCI_Database::Open(LPCTSTR lpszServiceName, LPCTSTR lpszUserID,
LPCTSTR lpszPasswd)
{
.....
string userName = W2A(lpszUserID);
string password = W2A(lpszPasswd);
string connectString = W2A(lpszServiceName);
.....
}
I think the implementation of STL has itself heap allocator, and smartheap is a different one? But I don't know how to solve the issue.
Hiya, Everybody ^^
|
|
|
|
|
How can i make resident program in visual c++?
nothing is impossible
|
|
|
|