|
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
|
|
|
|
|
jc0dex wrote: Im not sure how to loop thru the outside _Packetlist, and for each outside _Packetlist loop through all of it's packets
I showed you how to do it in my previous post.
jc0dex wrote: And why the attitude :-P
What?
--
The Blog: Bits and Pieces
|
|
|
|
|
for(std::vector::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;
}
}
}
- What exactly is PacketList representing? I have a vector<_PACKETS> inside another vector called _PacketLists. (_PACKETS is a small struct)
That's the critical piece I'm not understanding to this problem.
Would it be like vector<_PACKET>&packetlist = *listIt?
And then I could use packetlist.begin() to iterate thru the other list?
I'm a still little confused tho ..
thanks for all the help
|
|
|
|
|
Oh and also what would be the template type of the vector in the first for-loop? A vector<vector<_packet> > ?
|
|
|
|
|
Assuming this is what you have:
typedef std::vector< _PACKETS > PacketList;
std::vector< PacketList > _PacketLists; then this is probably what you want:
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)
{
_PACKETS& packets = *packetIt;
if(packets.seqNumber == seqNum)
{
packetList.erase(packetIt);
return;
}
}
} which simply means that you iterate over all elements of the outer vector, and for each inner vector, all elements is iterated until the one matching the seqNum criteria is found. It's then erased from that inner vector and the iteration is stopped.
If you want to continue searching the remaining inner vectors (which I'd guess), then break instead of return .
--
The Blog: Bits and Pieces
|
|
|
|