|
apejman wrote: I'm trying to make Multiple Tellers, at this time my program assumes the bank has only one teller/counter. I want to modify the program so that it can handle multiple tellers, so that the customers in line will move to any available teller. For example, "Chewbacca steps up to counter #2" or "Vader has left counter #4."
but I have no idea how I can do that:
right now my program works, but I dont know how to add multiple tellers.
I would create an object to represent the set of tellers. Your IsCounterEmpty variable would be replaced by AreAllCountersFull, and AreAllCountersEmpty propertys. When checking for a customer finishing service, you would either loop over the counters in your main function, or provide a member of the teller set that does the looping and removing. When adding a customer, you the teller set could provide a method that would assign a customer to the first available teller.
Nathan
|
|
|
|
|
hi,
i've got a regular dll project with mfc support. project has a dialog resource and a class for that dialog, say CMyDialog. an exported global function of the project shows the dialog by "DoModal"ing it when called.
the problem is, when i put an activex control on the dialog and bind it to a member object(which is an instance of the auto-generated class of that activex control) of CMyDialog, it doesn't show up.
i read the related msdn article(knowledge base Q231591: How To Use a Dialog Template to Create a MFC Dialog with an ActiveX Control) but couldn't figure out how to use it.
another thing which is strange but unrelated to problem above is that, if i don't leave the OnInitdialog function empty and put an afxmessagebox line, the dialog becomes modeless even if i DoModal it. it's not a problem and even something good for me. but i just wanted to know why.
any suggestions, solutions?
thanks.
|
|
|
|
|
The problem is that I used BCGPro and when docking two views together the parent wnd changed to a tabbed wnd which is introduced by BCGPro.
-----------------------------------------------------------------
I have a VC6 project which can be compiled and run.
After I copy the project to a new computer (CPU is AMD 4000+), it report runtime error, when using dynamic_cast (not each, some are right).
Is it the fault of the code?
How to solve it? Will using vs2005 help?
Thanks a lot.
PS: the cpu is already patched
modified on Thursday, February 21, 2008 10:21 PM
|
|
|
|
|
followait wrote: it report runtime error,
who/what is "it" ? the compiler ? the execution of the program ?
Are you using the same version of Visual Studio ?
Are any patch installed on one machine and not the other ?
Are the project settings the same ? have you enable/disabled the RTTI in the project?
...
|
|
|
|
|
"it" is the executive.
All is the same, except hardware.
|
|
|
|
|
most probably a coding error.
|
|
|
|
|
It is so simple, and according to my experience, it should be right.
I've no experience with a dual core cpu.
|
|
|
|
|
followait wrote: I've no experience with a dual core cpu.
I guess it has nothing related with dual-core.
How do you use that dynamic_cast ? Do you mind showing some code snippet?
Maxwell Chen
|
|
|
|
|
CWnd *pWnd=GetParent();
CMainFrame *pMF=dynamic_cast<cmainframe*>pWnd;
</cmainframe*>
And I'm sure, the parent windows is type of CMainFrame, typeid also not work.
The compiler option /GR is specified.
The key problem is that, it works in a single core cpu.
|
|
|
|
|
What is the result, when you make a console application (DOS-box) having RTTI and dynamic_cast with the single-core machine and execute the exe with the dual-core one?
Maxwell Chen
modified on Wednesday, February 20, 2008 12:09 AM
|
|
|
|
|
In this one, it has do dynamic_cast several times correctly, but encounter a runtime error at this one.
|
|
|
|
|
followait wrote: ...it report runtime error, when using dynamic_cast...
How are you verifying this?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Just run it in VC6 debug mode.
Not only dynamic_cast , typeid also has such a problem
|
|
|
|
|
A number of companies offer code signing certificates, for prices from $100-200. I'm wondering if some are better than others, or perhaps the tools some provide make them worth the extra expense.
Anyone have any thoughts on who is the best to go with?
Patrick
|
|
|
|
|
I doubt anyone has a "best of" list... We use a VeriSign code signing certificate, and are happy with it. It works.
I am not sure what else can be said about it.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Whichever authority is recognized automagically by the browser/OS is best.
Otherwise, you may as well make your own certs (which works fine too).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
we just got one from Comodo, this weekend. the process was pretty easy (after a couple of rounds of verification).
they didn't provide any tools, since the things you need (basically just SIGNTOOL.EXE) are all part of MS's SDKs.
|
|
|
|
|
FWIW - I second Comodo. I have a CS cert from them as well and am very happy with it.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi,
I'm presently coding a driver for Windows XP and I'm having an issue: how to detect the keyboard layout?
Actually I need to detect if my driver is running on a computer with an azerty or qwerty keyboard. The best would be to be able to detect the keyboard layout for the current process. I know the GetKeyboardLayoutName API, but I have no idea what would be the equivalent in kernel mode if there is one...
Does someone know how to do that?
Regards
|
|
|
|
|
i never used, a little search on msdn gives,
Manthis wrote: The best would be to be able to detect the keyboard layout for the current process.
HKL GetKeyboardLayout( DWORD idThread
); per thread, its more granular than current process.
Manthis wrote: I have no idea what would be the equivalent in kernel mode
and in wince it has corresponding MDD driver function
typedef HKL (*PFN_LAYOUT_MGR_GET_KEYBOARD_LAYOUT)(
DWORD idThread
);
i think there should be something similar in windows also
modified on Tuesday, February 19, 2008 11:28 PM
|
|
|
|
|
Well I knew these two functions but I'm pretty new to driver developpement, and I'm can't find their equivalent for windows kernel developpement.
I might I've found a hint with this request: IOCTL_KEYBOARD_QUERY_ATTRIBUTES, but I'm really not sure.
Can someone confirm?
|
|
|
|
|
|
Hi,
I have some function that get void* param.
And i want to send CString object.
So - this is my code - and i don't see any reason that my CString would not work when i doing casting back from void* to CString.
<br />
CString sStr("SomeString")<br />
Foo(void*(&sStr) );
<br />
void Foo(void* p)<br />
{<br />
CString __sStr = *(CString*)p;
}<br />
Thanks for any help.
|
|
|
|
|
Actually your code, though not beautyful, works.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Yanshof wrote: CString sStr("SomeString")
may be the objects life time is not in the scope.
Yanshof wrote: void Foo(void* p)
{
CString __sStr = *(CString*)p;
string is copied to __sStr, is for this purpose u troubled urself to pass as pointer. instead u can pass by value;
personally i prefer reference in this situation.
void Foo(CString &str);
|
|
|
|