|
Hi everyone,
Now I'm writing a LaTeX IDE and facing problems with structures parser problem. I'm implementing the the feature of parsing the structure of a project (from multiple files) and produce a hierachy structure.
Anyone can give me suggestion of framework, what need to be done, ...
Best regards.
|
|
|
|
|
hi..
i am working know on project where i build an vc++ application to allow interaction between local server and a client but now i would add a part where two clients can communicate .
so my question is what is the function i will use to define the user name and password for each host to access the client
thanks
|
|
|
|
|
Do you want the user authentication to be done by windows? Otherwise you handle this yourself by saving username / password pairs in a file (hopefully it is encrypted) on the server.
John
|
|
|
|
|
thanks i will try the secound solution
|
|
|
|
|
I am having problems deleting a char string that I created with a new function and added to a node template to use within a double linked list (also a template). I create a string copy the contents into it than add the pointer to a new node item. Later when I pull the string back out and try to delete the string or the node, I get a debug error: "DAMAGE: after block (#53) at mem address". Here is a sample of the basic code.
void TestFunc()
{
char cIn[80];
char *pStr = NULL;
CDblList<char> pList;
bool bDone = false;
while(!bDone)
{
cout << "\n Input Text (E to exit): " << flush;
cin >> cIn;
if(stricmp(cIn, "E") == 0)
break;
pStr = new char[strlen(cIn)];
strcpy(pStr, cIn);
pList.AddNodeToTail(pStr);
if(pList.GetCount() > 0)
{
pStr = pList.RemoveHead();
cout << " Removed from head: " << pStr << endl;
delete [] pStr;
while(!bDone)
{
pStr = pList.RemoveTail();
if(pList.GetCount() + 1 > 0)
{
cout << " Removed from tail: " << pStr;
cout << "\t Count: ";
cout << pList.GetCount() + 1 << endl;
delete [] pStr;
}
else
{
pList.Flush();
bDone = true;
}
}
}
}
//////// Different header file
template <class t=""> class CDblList; // Forward declaration
template <class t=""> class CNode
{
private:
T* pVal;
CNode<t>* pNext;
CNode<t>* pPrev;
public:
CNode() : pVal(0), pNext(0), pPrev(0) {;}
~CNode(void)
{
pVal = NULL;
pNext = NULL;
pPrev = NULL;
}
friend class CDblList<t>;
};
template <class t=""> class CDblList
{
private:
CNode<t>* pNode;
int iCount;
public:
CDblList() : pNode(0)
{
iCount = 0;
pNode = new CNode<t>;
}
~CDblList() { Flush(); }
void Flush()
{
if(pNode)
{
CNode<t>* p = (CNode<t> *) pNode->pPrev;
pNode->pPrev = NULL;
while(p != pNode)
{
p = p->pPrev;
delete p->pVal;
delete p->pNext;
}
p = NULL;
}
iCount = 0;
}
void AddNodeToHead(T* pItem)
{
if(!pItem)
return;
CNode<t>* p = new CNode<t>;
p->pVal = pItem;
if(iCount == 0)
{
pNode->pNext = p;
pNode->pPrev = p;
p->pNext = pNode;
p->pPrev = pNode;
iCount ++;
}
else
{
p->pPrev = pNode;
p->pNext = pNode->pNext;
p->pNext->pPrev = p;
pNode->pNext = p;
iCount++;
}
}
T* RemoveHead()
{
CNode<t>* p = pNode->pNext;
char *pRet = NULL;
if(!p)
return NULL;
else
{
pNode->pNext = p->pNext;
p->pNext->pPrev = pNode;
pRet = p->pVal;
p->pVal = NULL;
iCount --;
if(iCount >= 0)
delete p;
}
return pRet;
}
int GetCount() { return iCount; }
};
A couple of other notes. A couple of functions have been removed to save space. They have nothing to do with adding removing information, unless it is a duplicate of a similar function but operating in the reverse. The linked list is doubly linked and circular. The app is meant to avoid windows headers and is using only <fstream.h> and <string.h>. This is a console app that I amtrying to build and run on an NT based system. I am compiling under VC 6.0. By the way, I don't get any errors saying that I didn't cleanup memory when I comment out all the delete functions.
Thanks for any assistance in helping see what I am doing wrong. I am doing this to learn and understand templates.
Leo T. Smith
|
|
|
|
|
"Damage after block" means you allocated some memory and then wrote past the end of the allocated block. From a quick glance, this looks like the culprit:
pStr = new char[strlen(cIn)];
strcpy(pStr, cIn); You need to alloc 1+strlen(cIn) char s to account for the terminating null.
--Mike--
Personal stuff:: Ericahist Updated Feb 6! | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2
Actual sign at the laundromat I go to: "No tinting or dying."
|
|
|
|
|
I am getting the classic "Object reference not set to an instance of an object." error inside a System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) call.
Before you tell me the canned response about null references, here is the trace:
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at eCandidus.Master.Main() in C:\Enterprise Candidus\eCandidus\eCandidus\Master.cs:line 104
The error happens randomly while scrolling a dropdown list combo box, and happens in different combo boxes in different forms. Note that is being caught in a last resort try/catch at the very outmost call posible.
Anyone run into this one before?
|
|
|
|
|
Sorry guys, this should have been posted in the c# area, but I had just answered a question here...
Still if anyone knows what's up, I'll take it...
|
|
|
|
|
Just bought a version of IP*Works! for VC++, after I successfully tested the evaluation version.
I feel somewhat disappointed about the really sparse documentation and the samples that only contain really basic code. Also, the support options are pretty few, too (e.g. the knowledge base seems to have few entries and there is no discussion forum).
Now I feel that maybe their package isn't as good as I initially thought.
Question:
Are you a user of IP*Works! and can tell me that this IS in deed a usable package, or what experiences you have or had when using it in commercial applications?
--
- Free Windows-based CMS: www.zeta-software.de/enu/producer/freeware/download.html
- See me: www.magerquark.de
- MSN Messenger: uwe_keim@hotmail.com
|
|
|
|
|
Uwe:
I have not used their VC++ version, but have used their VB6 and .NET versions in a commercial package and had zero problems ... What I used was the Ipdaemons and Certmgr modules to develop the SSL layer used in a financial app.
|
|
|
|
|
|
I used their C++ version about two years ago and liked it a lot as did the other developers in our group. My only complaint was that it didn't come in a static link version.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I have a question about the syntax when it comes to templates. What I want to do is to create a pointer to a std::vector which contains pointers to a class called Square. I thought it would look like: std::vector< Square* >*, but obviously my compiler thinks not and gives me "error C2059: syntax error : '>'".
Any help appriacted
|
|
|
|
|
That is correct syntax. Are you using VC6 and have you #include <vector>?
VC6's a bit a wacko when it comes to templates. Try this and see what happens:
typedef Square* SquarePtr;
std::vector<SquarePtr>* pVector;
--
Gott weiß ich will kein Engel sein.
|
|
|
|
|
I use VS.net 2003 and have vector included. What you suggested seems to work though, thx a lot
|
|
|
|
|
That's odd! I haven't seen any weirdness like that from vs.net 2003.
--
Gott weiß ich will kein Engel sein.
|
|
|
|
|
The following line asserts in my program and I do not understand why:
VERIFY(pThread->SetThreadPriority(nPriority));
The code I am using to create the thread is:
m_wtRunningThread = AfxBeginThread(WorkOutEquation, tp, HIGH_PRIORITY_CLASS);
Can anyone help me.
Thanks
|
|
|
|
|
Have you checked the error code? Call GetLastError() when SetThreadPriority() fails, and use the error lookup tool (located in the tools-menu) to see what the error code means. It'll probably help you.
--
Gott weiß ich will kein Engel sein.
|
|
|
|
|
There could be a couple of reasons why you can't alter the priority of a thread after it is set. Can you check GetLastError to see what happened? A common one is that the thread is not ready so changing its priority drops and error.
|
|
|
|
|
Generally the intellisense(autocomletion of the members) property of the Visual studio is very useful for me, but It does not work even though the code does not contain any error and it is active. And I can not find out the reason, i.e. the responsible segment of code and may be other factors, of this. Does Anyone help me with finding the code segment that cause this problem ?
|
|
|
|
|
Try closing visual studio, remove the .ncb file, and start visual studio again. This'll make visual studio rebuild the intellisense database again. It may or may not help.
I've noticed that VS.NET 2003 gets confused when I use namespaces. Then I do what I just described, and most of the time it'll work again.
--
Gott weiß ich will kein Engel sein.
|
|
|
|
|
Thanks, I knew that but sometimes it doesn't work, in fact I try to find that which code segment makes this property not working.
|
|
|
|
|
Is it possible to get MultiByteToWideChar to convert using UTF16 instead of UTF8 for the code page? In the MSDN docs they only show CP_UTF8, and googling didn't turn up much.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
As a side to this, is CP_ACP really UTF16 encoding?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
CP_ACP = ASCII Code Page...?
--
Gott weiß ich will kein Engel sein.
|
|
|
|