|
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
|
|
|
|
|
The problem is that your string is not initialized. From MSDN (edited for readability):
<br />
int CEdit::GetLine( int nIndex, LPTSTR lpszBuffer ) const;<br />
int CEdit::GetLine( int nIndex, LPTSTR lpszBuffer, int nMaxLength ) const;<br />
<br />
lpszBuffer - Points to the buffer that receives a copy of the line. The first word of the buffer must specify the maximum number of bytes that can be copied to the buffer.<br />
nMaxLength - GetLine places this value in the first word of lpszBuffer before making the call to Windows.<br />
Allocate memory for your buffer and make sure the length is inserted, and it should work....
/moliate
|
|
|
|
|
Call UpdateData(TRUE); at first.
Regards
http://www.ucancode.net/ (Xtreme Diagram++ Library with full MFC Source Code)
|
|
|
|
|
Thanks!
I have one question.
In the line:
// CString myString;
CEditCtrl::GetLine(1, myString.GetBuffer(255), 255);
Is 255 the maximun number of characters in *that line*?
I would like to get everything on that line.
In general, is the size (255 in this case) referring to bytes or characters (characters * bytes = maxsize?).
Kuphryn
|
|
|
|
|
Hi
Is there any class or template like CArray not written in c++?
I used CArray, but now I need to write an app without MFC support.
If there exists some subtitute for CArray, could you please explain how to use it?`
Thanks in advance
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I think STL will help you. CArray is not the best analog of stl.
And I don anderstand what you mean Gregor S. wrote:
not written in c++?
|
|
|
|
|
Thanks!
My fault, I meant "not written in MFC".
Could you give me a link or tutorial that explains how to use the STL? I never used it before
modified 12-Sep-18 21:01pm.
|
|
|
|
|
There some articles here
http://www.codeproject.com/vcpp/stl/
It is not very difficult to use STL. It has look nearly as MFC Classes such as CArray
|
|
|
|
|
CArray was written as a substitute for vector while waiting for the C++ standard. Here is a link to the first of my STL articles, which covers vector. You'll find the STL is far superior to CArray.
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
|
|
|
|
|
Christian Graus wrote:
Here is a link to the first of my STL articles, which covers vector
uhhhh where is the link?
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]
|
|
|
|
|
I dunno - I posted it.
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
|
|
|
|
|
Christian Graus wrote:
I dunno - I posted it.
Huh? You mean an entire a-href vanished???
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]
|
|
|
|
|
Well, I typed it in, so I guess so. It probably got typed in wrong, so it's in the page but has not translated to a link.
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
|
|
|
|
|
Hi there,
I have question about using of an Activex which called Microsoft Coolbar control 6.0
One of a functions in this activex is about setting an image list ...
[ccode]
m_Coolbar.SetRefImageList(LPDISPATCH newValue);
[/ccode]
I can make an image list by CImageList class, but how can i use it in SetRefImageList function ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Does anyone know how (if it is possible) to change the client rectangle of a common control (ListBox, EditBox ... etc)? The reason I ask is because I created a skinable scrollbar class and want to add it into the non-client area of an edit box or list box. My thinking is that if I could shrink the client area I could create my new scrollbar window in the non-client space, which would not be painted over.
Any help would be greatly appreciated
|
|
|
|