|
please tell me what is the first argument, here and what is its size.
iam very sure that you may be right, but please let me know what is that wrong i have done.
thank you.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
chandu004 wrote: please tell me what is the first argument...
In your example here, the first argument is the string literal "text of letters".
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
yah yah
i got it by seeing the nelek's post.
thank you very much(for both of you) for correcting me.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
In this case won't work, because the tempBufferWrite is 256 chars long, but the string that is being written in the file is "text of letters" (16 chars), and note that there is no string to have length of. The code gives the "..." directly, not going through the buffer.
char tempBufferWrite[256] = "Test of letters" ;
openFile.Write(&tempBufferWrite, strlen(tempBufferWrite)) ;
That should work. What you proposed just changing sizeof with strlength must not.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
thanks for the analysis,
Nelek wrote: char tempBufferWrite[256] = "Test of letters" ; // or {}openFile.Write(&tempBufferWrite, strlen(tempBufferWrite)) ;
That should work
i was thinking that, &tempBufferWrite is used in the write,
i didnt observe some other readstring in that place.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
Thanks,
Than mean strlen get the length of CString.
Eranga
I appreciate your help all the time...
|
|
|
|
|
anyway, just a guess: i see you're coding in C++, so why not using std::string or even CString (if using MFC) ... ?
|
|
|
|
|
Actually that readString defines as CString in my code.
Eranga
I appreciate your help all the time...
|
|
|
|
|
openFile.Write(tempBuffer, amount of data you wrote to tempBuffer); Don't pass the whole buffer length when you didn't fill that much.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Actually that what I've worried about. Couldn't find any way to define the buffer length as the length of string. Actually I tried something like this.
readString.GetLength()
Eranga
I appreciate your help all the time...
|
|
|
|
|
how can i install msdn library in vc++ 6.0 ??? I'm getting a message as "Please reinstall msdn" when i click on help.....
|
|
|
|
|
Can you run MSDN individually. At the installation you have a option to combine both MSDN and Visual C++ together. If you neglect that option you have to work with them separately.
Eranga
I appreciate your help all the time...
|
|
|
|
|
You might be using newer version of MSDN, which cant be taken directly from VC6.
- NS -
|
|
|
|
|
What version of MSDN are you working with?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The newest version of MSDN Library that still integrates with Visual Studio 6.0 is October 2001. It may still be possible to download this if you're an MSDN subscriber (although not right now as the subscriber download site doesn't seem to be working).
A very out-of-date version of MSDN Library accompanied Visual Studio 6.0 itself (labelled 'MSDN Library for Visual Studio 6.0'). However, this predates Windows 2000 and I would not recommend using it. (It was up-to-date in mid-1998 when Visual Studio 6.0 was released!)
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
I want to create a Type-Safe Array with CArray of the following structure
struct structProjectFiles {
CStringArray strDescription;
CStringArray strFiles;
DWORD dDataCode;
};
====================================================================
When I am trying to fill the array with the following code i get a C2582 error. Is there any way to overide the problem ?
//somewhere in the code
structProjectFiles pj;
pj.strDescription.Add("Hello");
pj.strFiles.Add("Files");
pj.dDataCode = 0;
m_cProjectFiles.Add(pj); -->Error afxtempl.h(443) : error C2582: 'structProjectFiles' : 'operator =' function is unavailable
Regards,
sdancer75
|
|
|
|
|
sdancer75 wrote: m_cProjectFiles.Add(pj); -->Error afxtempl.h(443) : error C2582: 'structProjectFiles' : 'operator =' function is unavailable
Look here-> http://support.microsoft.com/kb/231995[^]
Nibu thomas
MVP For VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
sdancer75 wrote: m_cProjectFiles.Add(pj); -->Error afxtempl.h(443) : error C2582: 'structProjectFiles' : 'operator =' function is unavailable
You are missing a copy constructor and/or an assignment operator.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thank you for your reply.
Is that possible to create a constructor or assignment operator to a structure ? I agree with you when a Class is used but what about structures ? Is that possible ?
Regards,
sdancer75
|
|
|
|
|
sdancer75 wrote: Is that possible to create a constructor or assignment operator to a structure ?
Yes.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all
How to display some text in a control which will automatically
adjust it's size according to length of data.
#sanroop#
|
|
|
|
|
IMHO you have to measure the text width via GetTextExtentPoint32 or similar and then resize the control according to it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
When the text is set to your control, you can call GetTextExtent to get the size in logical units.
MoveWindow() your control appropriately.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Hi!
I have a dialog which I painted using 'OnEraseBkgnd' function. I placed a CTransparentStatic ctrl (static ctrl with TRANSPARENT BkMode). I wanted to have the same color as dialog background.
I also used:
<br />
HBRUSH CDialList::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
if( nCtlColor == CTLCOLOR_STATIC )<br />
{<br />
pDC->SetBkColor(BkClr);<br />
pDC->SetTextColor(TxtClr); <br />
}<br />
return hbr;<br />
}
Where BkClr is what I wanted for static ctrl to be painted, and TxtClr is RGB(0,0,0).
When dialog first appear the static control is not painted (it's gray) but on first text placment it gets back colored but only for text lenght, not hole rectangle!!!
I did everything and still cant get static ctrl to get all backround painted and on it's first appear?
Help please!
|
|
|
|
|
P.S.
I tough when setting controls (pDC's) BkMode to TRANSPARENT, control it self's has the color of it's dialog???
|
|
|
|