|
|
BTW, I like the way you post code . How are you doing that ? You change the color manualy for everything or do you use something special to edit code ?
|
|
|
|
|
hum, actually, manually... (for the moment)...
but i plan to make a little program which gets the text you post and automatically adds the CP CSS tags for the colors :
<SPAN class=cpp-keyword> <span class=cpp-keyword>keyword</span> </SPAN>
<SPAN class=cpp-comment> <span class=cpp-comment>
<SPAN class=cpp-preprocessor> <span class=cpp-preprocessor>#preprocessor</span> </SPAN>
<SPAN class=cpp-string> <span class=cpp-string>"string"</span> </SPAN>
<SPAN class=cpp-literal> <span class=cpp-literal>123</span> </SPAN>
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
toxcct wrote: but i plan to make a little program which gets the text you post and automatically adds the CP CSS tags for the colors :
Sure, sure!
Owner drawn
Jesus Loves
|
|
|
|
|
hello cedric!
actually that what i did!...he is the small snippet!....i get an error!
CObject* pObject1;<br />
pObject1 = myList1->GetAt(myList1->FindIndex( 0 ));
myList1->RemoveAt(myList1->FindIndex( 0 ));<br />
delete pObject1;
error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class CString' (or there is no acceptable conversion)
what do i do?any ideas?
|
|
|
|
|
What is the type of myList1 ??
From the MSDN:
CObject*& GetAt(
POSITION position
);
Are you sure the error comes at this line ?
|
|
|
|
|
yeah!....u see as long as i typecast it to LPCTSTR and that too to an LPCTSTR i dont get an error.....
in teh MSDN it says that for CStringList teh returned parameter will alwayz be replaced from CString* to LPCTSTR.....
so is there a way of getting CString* from LPCTSTR?.....i mean after all LPCTSTR is a pointer inside the CString object!
|
|
|
|
|
I have used Winsock2 for my application to communicate with the device over
TCPIP socket.I get the following sequence of events .
1. The Application that runs the Client socket is alive.But after about 24
hrs. the network connectivity for the Machine is disabled.
2. On further investigation of the issue I found that in the Event viewer
the event has been noted as Event ID -2019 and the note alongside is
"The server was unable to allocate from the system nonpaged pool because the
pool was empty."
Do help me out with this. As I have no clue as to why it behaves so.
|
|
|
|
|
Hi All,
Can anyone tell me where is the memory allocated for a function?. Consider the following example
class A
{
int a;
int b;
void f1();
};
void main()
{
A obj1;
}
Now, in this case, assume that for variable 'a' the address would be 5000 and for 'b' it would be 5004. These 2 varialbes are present in the stack. Now, where does my function lie. Is it placed in the stack? or somewhere else. How do I find the address of the function and know as where it is placed?
can anyone help me on this.
|
|
|
|
|
Take the address of the function. This is a little tricky for member functions. It goes something like this:
class A<br />
{<br />
int a;<br />
int b;<br />
void f1();<br />
};<br />
<br />
void (A::*pAFnPtr)() = &A::f1;<br />
|
|
|
|
|
Right.I can get the address of the function using funtion pointers. It will surely work fine, but I just want to know as where the function is stored. What is the address that I get as the output for the above code snippet that you have given. Is it a stack or some other random memory location or something else?
To the best of my knowledge I feel that functions does not get stored in the stack. Correct me if I am wrong and do let me know your suggestions on this.
Thanks In Advance
|
|
|
|
|
It will be an address within the memory where the loader mapped the .EXE or DLL file. It is not on the stack or the heap. The code above will give the the address of the function (or perhaps a incremental link thunk or an adjustor thunk).
Steve
|
|
|
|
|
Thanks for your information Steve.
|
|
|
|
|
I have an activeX control in a htmal page (say second.htm), when I try to open this page from another htm page (say first.htm) and do some process in ActiveX and close the second.htm. This causes the first.htm also closed. is it due to a crash?
window.open("second.html", "myPage");
What proble forceing the parent page to close?
|
|
|
|
|
If i make a library, consists of two files, for example - foo.h, foo.cpp,
where i described a class foo:
foo.h file:
<br />
class foo<br />
{<br />
...<br />
public:<br />
foo();<br />
void method();<br />
};<br />
<br />
foo.cpp file:<br />
#include "foo.h"<br />
foo::foo()<br />
{<br />
}<br />
foo::method()<br />
{<br />
}<br />
and then i make a new project, copy this files in the project and in file stdafx.h i write next string
#include "foo.h"
the linker says that can't link... What am i doing wrong?
So... I hope i described my problem clearly Sorry for my bad english
-- modified at 1:05 Tuesday 14th February, 2006
|
|
|
|
|
Firstly you're missing a void :
void foo::method()<br />
{<br />
}
I'm not sure about the link error.
Steve
|
|
|
|
|
It is just mistake in forum...
Exactly - i got :
error LNK2001: unresolved external symbol "public: __thiscall CFooClass::~CFooClass(void)" (??1CFooClass@@QAE@XZ)
|
|
|
|
|
It seems as if the destructor (~FooClass()) is present in the .h file, but missing in the cpp file.
Add it to the cpp file.
|
|
|
|
|
|
Looks like like your class has declared a destructor but not defined it. ie:
class CFooClass<br />
{<br />
public:<br />
CFooClass();<br />
~CFooClass();<br />
};<br />
<br />
CFooClass::CFooClass()<br />
{<br />
}<br />
<br />
|
|
|
|
|
Yes, it looks like i don't have a destructor in my cpp file, but i have...
I found a way you can check it - in the wizard you can create a new class, but then delete it from the solution, and include it just in stdafx.h. You'll get the same error as I... So my question is - how to include library, without insertig library in the project
|
|
|
|
|
Are you just including the .H file in your project without the corresponding .CPP file? If this is the case the impementation must come from somewhere...Perhaps you want to build a static library (.LIB file). When you do this you just include the .H file and add the .LIB file to the linker tab (or use a #pragma comment(lib, "libname.lib")).
Steve
|
|
|
|
|
Look at the missing func:
"public: __thiscall CFooClass::~CFooClass(void)"
If it's ment to be a destructor, wouldn't it look like this:
"public: __thiscall CFooClass::~CFooClass()"
That is, without the "void" ?
|
|
|
|
|
Rassul Yunussov wrote: Exactly - i got :error LNK2001: unresolved external symbol "public: __thiscall CFooClass::~CFooClass(void)"
Either you fail to include the .cpp or .library file
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
The question relates only to large projects (defined as >= 100,000 lines of code) compiled with Visual C++ compiler. If you work(ed) on such projects, I would appreciate if you could share your experience. Is it a must in this case? Thanks!
Nick Kisialiou
|
|
|
|