|
Surround your code snippet with <pre> tags, check indentation, make sure #include directives are visible, and lastly, click the Preview button first before posting.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
JarethAshaer wrote: error C2228: left of '.append' must have class/struct/union type line 25
error C2228: left of '.chop' must have class/struct/union type line 35
error C2228: left of '.print' must have class/struct/union type line 45
Makes me think that something is wrong with your declaration of ar1.
JarethAshaer wrote: Array ar1 (int array[], int elem);
get rid of the two int keywords in this declaration.
|
|
|
|
|
no go with the int. I forgot to put in that if I use the default constructor (I.E. Array ar1();) the program works.
|
|
|
|
|
I am not sure we are talking about the same thing. This is the code that I am referring to
<br />
...<br />
array = &pointedArray[0];<br />
Array ar1 (int array[], int elem);<br />
completion = ar1.append();<br />
...<br />
remove those int keywords.
|
|
|
|
|
I did. I changed it to Array ar1 (array[], elem); and it didn't work
also, if I just have Array ar1; the program works
|
|
|
|
|
First, looking at your code, I think if you examine the content of ar1 after you use the default constructor you will find that the 10 elements you wanted to add are not there. You may want to change your print statements to give better confirmation that your program worked.
Second, if you find what I said correct, I think you should find that
Array ar1(array, elem);
is the proper declaration for what it appears that you are trying to do.
Third, keep up the good work.
|
|
|
|
|
well, yes, the program worked, but I got long strings of memory cell locations. Scientific notation is a good sign something didn't work I just meant that the rest of the program was in working order.
|
|
|
|
|
Hi
especially i want to know what .lib file is ,what information it contains.
When does compiler generate .dll file and what we done so compiler generate .lib file?I really don't understand the differences.(for example gdi32.dll and gdi32.lib)
I am looking for your answers.
Thanks.
-- modified at 11:13 Tuesday 25th April, 2006
|
|
|
|
|
gdi32.lib is a static library that contains simple functions that simply pass the parameters through to the gdi32 DLL. it lets programmers link to the DLL as if it was a static library, so they don't have to worry about LoadLibrary/GetProcAddress/etc..
rotorcli wrote: When does compiler generate .dll file and what we done so compiler generate .lib file?
if you have a DLL project, there's a compiler/linker setting you can use to turn on .LIB generation.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hmm so when we use cout() we use static library but when we use Rectangle() in gdi32.dll we use dynamic library and dynamic binding.
So can we say if we use static libnrary we need libraries header file(.h)because compiler must see the function's parameter list but when we use we do not need header files?
Is it true?
|
|
|
|
|
rotorcli wrote: So can we say if we use static libnrary we need libraries header file(.h)because compiler must see the function's parameter list but when we use we do not need header files?
yes, that's true. the compiler doesn't know anything about functions you load with GetProcAddress.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Thanks for answers.
I have one more and last question.
I know that we can linking dlls by staticly or by dynamicly.(If this is not true please warn me).
When Linking dynamic linking libraries dynamicly(at run-time) we do not need header files of that dll.
But if we lnking dynamic linking libraries by staticly(compile-time), do we need header files too(like linking static library)?Or dont we need header file?
Can you give me please some information about that.(about linking dll staticly , dynamicly and header files)
Thanks again.
|
|
|
|
|
I'm trying to compile my first console app with VC++ 2005 Std and it has the following error
c:\program files\development_tools\microsoft visual studio\vc\platformsdk\include\winnt.h(3857) : error C2146: syntax error : missing ';' before identifier 'ContextRecord'<br />
Any ideas ?
|
|
|
|
|
Defenestration wrote: Any ideas ?
Yes, a ';' is missing before the identifier 'ContextRecord'.
If you don't provide more information (like some code around the line at which the error occur) we won't be able to provide you with a solution.
Error message in general are very explicit. If you get a message like that, I'm almost sure it is not because you forgot to plug your computer
|
|
|
|
|
When I look at the winnt.h include file, the struture where PCONTEXT is defined is greyed out, which means that it's being conditionally compiled out. This is defined differently depending on whether the preprocessor constant _X86_ or _AMD64_ is set. In my case neither is being set.
Would I be right in thinking that this needs to be manually set depending on whether you are targetting 32-bit or 64-bit ?
|
|
|
|
|
Solved the problem... It was because I had
#include <windef.h>
before
#include <windows.h>
I just removed the windef.h one and everything's OK
|
|
|
|
|
Please help me to understand the commands:
{{AFX_INCLUDES()
#include "Mylibrary.h"
//}}AFX_INCLUDES
Thank you!
Le Van Long
|
|
|
|
|
please specify more details, how did u get this? what project type do you work in?
in order to help you we need more details....
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
#include is a preprocessor directive that instructs the preprocessor to insert the named file as if it had appeared in the source program at the point where the directive appears.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
I think he ment where did the remark of AFX_INCLUDE comes from...or did i missunderstand him???
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
YaronNir wrote: I think he ment where did the remark of AFX_INCLUDE comes from...
It all depends on how you interpreted the question. Technically, AFX_INCLUDE is not a command. In any case, it is added by ClassWizard.
YaronNir wrote: ...or did i missunderstand him???
Your reply to him implied there was no understanding at all.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Hi all
i have adialog -based application.when a button is pushed a user defined function has to be called which will have to read every word from (one word in one line)notepad to the CString varaible used in my VC++6.0 program.
how can i do that
is there any built-in methods or is it necessary to use the database connection?
Thanks in advance
--lekshmi
|
|
|
|
|
not sure i undestand correctly what you mean but,
if you find the notepad window, one of its child is the rich edit control (where the words are in place) from there all you have to do is read them line by line into a CString....
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
YaronNir wrote: if you find the notepad window, one of its child is the rich edit control (where the words are in place)...
I'm not sure what OS you are using, but with Windows XP, Notepad does not use a richedit control.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
"I'm not sure what OS you are using, but with Windows XP, Notepad does not use a richedit control."
my bad, it uses a Edit....
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|