|
Thanks whiteSky - you've helped me before. It's a standrd checkbox. No special effects and stuff only it sits on a white window and it's defualt color is grey.
Anyway i've solved with the white brush:
HBRUSH OnCtlColor( CDC* pDC, CWnd* pWnd, UINT ctlColor )
{
return (HBRUSH)GetStockObject(WHITE_BRUSH);
}
|
|
|
|
|
|
Hi,
I have created a class for implementing a doubly linked list. The problem I having is when I'm inserting a new node into the list.
First off, in a function in my class, I create a temporary node and copy the data into it like so:
<br />
PNODE pTempNode;<br />
pTempNode = new NODE;<br />
pTempNode->pNext = NULL;<br />
pTempNode->pPrev = NULL;<br />
pTempNode->pData = new double[dataSize];<br />
<br />
<br />
pTempList->Insert(pTempNode);
The insert function then adds this node to the list like so:
<br />
if(pHead == NULL)
{<br />
pHead = pNew;<br />
pTail = pNew;<br />
return;<br />
}<br />
else<br />
{<br />
<br />
pPrev->pNext = pNew;<br />
pNew->pNext = pCurr;<br />
pNew->pPrev = pPrev;<br />
<br />
}<br />
Problem is though the head always changes to the new node I pass before I have passed it so the new node is not replacing the head.
Thanks for any help and I hope this makes sense!
Dave
|
|
|
|
|
sheepdonkey wrote: so the new node is not replacing the head.
You don't seem to be re-assigning your pHead pointer, so pHead will continue to point to the original head of the list (the first item you added)
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
Thanks,
Pointers are my downfall I don't understand them fully!
How would I re-assign a pointer?
|
|
|
|
|
|
Is is possible to create DLL to automate MSword?
I have done exe version and it works fine but when developing the dll,
if(!WdocApp.CreateDispatch(_T("Word.Application")))
{
AfxMessageBox(_T("Could Not Create The Application Object"));
return false;
}
it is unable to createdispatch and exited ... y???
thks
|
|
|
|
|
You can try to create the CON Addin for Microsoft Addin.
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Hello!
I've got a problem.
I want to do a single exception handler in my MFC application.
It should work the following way. At any place of my project
I can write: trow e (where e is the object of my Exception class).
And my single exception handler must catch this exception (so the
block try catch would be written only once).
Thanks for any help!
|
|
|
|
|
Simply catch the excpetion on your "main" function. i.e.
int main()
{
try
{
YourRealCode();
}
catch (const std::exception &e)
{
}
Steve
|
|
|
|
|
No, this is an MFC application so you don't have access to the "main" fuction.
|
|
|
|
|
This is a good way. But the problem is that my application doesn't have
main function because it is MFC application.
|
|
|
|
|
Overide CWinApp::Run and do the same - You can use ClassWizard to overide then make it look like the following:
</code>int CMFCDialogApp::Run()
{
try
{
return CWinApp::Run();
}
catch ( CException *pE )
{
pE->Delete();
return 1;
}
}</code>
Steve
|
|
|
|
|
Look at this thread[^]
I didn't test it but I think this is what you are looking for.
|
|
|
|
|
My system(ist16) and remote system(ist14) are connected in LAN.
when i type ping ist14 in my system i get replay.
when i type ping ist16 in remote system i didnt get replay.
what is the reason.
can any one help me....?
thanks in advance...!!!!!!!!
JAYARAJ
|
|
|
|
|
|
I want to run batch file through vc++ code.
can anyone help me please?
nirmal
|
|
|
|
|
|
I have successfully been able to enumerate all items under Desktop folder and get the name and path for each item inside the desktop folder.
I have also logged the name and path of all items in a log file.
The problem is: i have to be able to launch each item inside Desktop folder e.g. "My Documents", "WinZip" etc since i have resp path for each as "C:\Documents and Settings\Administrator\My Documents",
"C:\Documents and Settings\All Users\Desktop\WinZip.lnk" etc.
Pls suggest me a way to launch each of the window e.g "My Documents" using the path.
Awaiting a reply soon.
Sincerely
Giftsana
|
|
|
|
|
I got a solution to it using ShellExecute() and specifying the path since i already have the path for each item!
Giftsana
|
|
|
|
|
|
Hey guys,
Alright I've got a simple double for-loop here using the stl's vector.
// go thru the vector of Critical Packet lists
for(int i=0; i<_PacketLists.size(); i++)
{
// go thru the specified Critical Packet list
for(int j=0; j<_PacketLists[i].size();j++)
{
if(_PacketLists[i][j].seqNumber == seqNum)
{
Erase Vector here ......
}
}
}
The vector class has an erase function, but it only takes iterators. Is there any way to get around using iterators?I've tried using them with a vector inside a vector and has proven troublesome to me in the past.
Any help would be much appreciated!!!
Thanks in advance,
Jay
www.jdaigner.com
jay@jdaigner.com
|
|
|
|
|
There is a clear() method that will erase all vector contents.
|
|
|
|
|
I took the liberty of rewriting your vague snippet:
for(int i = 0; i < _PacketLists.size(); ++i)
{
PacketList& packetList = _PacketLists[i];
for(int j = 0; j < packetList.size(); ++j)
{
Packet& packet = packetList[j];
if(packet.seqNumber == seqNum)
{
}
}
} If that's what you meant, then this is how I would have done it from the beginning:
for(std::vector<PacketList>::iterator listIt = _PacketLists.begin(); listIt != _PacketLists.end(); ++listIt)
{
PacketList& packetList = *listIt;
for(PacketList::iterator packetIt = packetList.begin(); packetIt != packetList.end(); ++packetIt)
{
Packet& packet = *packetIt;
if(packet.seqNumber == seqNum)
{
packetList.erase(packetIt);
return;
}
}
}
jc0dex wrote: Is there any way to get around using iterators
Why should you?
--
The Blog: Bits and Pieces
|
|
|
|
|
Yea my snippet was very vague I apologize.
I have a vector<vector<_packet> _PacketList ... Im not sure how to loop thru the outside _Packetlist, and for each outside _Packetlist loop through all of it's packets. Inside that loop is where I need to check each individual packet's sequence number against the one passed in.
I hope this clarifies things because the sample code given doesn't really match what I'm trying to do.
And why the attitude :-P
|
|
|
|