|
|
Boost.Statechart[^] might take the pain away
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
struct FSM{
enum { RAMEN=1,ELICHE,CANNELLONI,FARFALLE,TAGLIATELLE,SPAGHETTI };
unsigned int state;
};
FSM IAm;
...
Iam.state=FSM::ELICHE;
... I imagine his noodliness has a lot more states than that, but this is a start. Good luck figuring out the IFsm createUniverse() method.
a finite state machine is usually a markup language.. the prof wants you to draw some pictures w/ some arrows. You could actually use this struct to keep track of your state, if you wanted...
|
|
|
|
|
Actually the only C data structure you need to implement an FSM is int. Each integer value represents a different state of your machine. It's that simple.
|
|
|
|
|
Hi all,
In my main dialog we have a menu, in this menu we have some options as per the option selected we want the values to be changed in all the other 3 dialog boxes that we have in the application.We have actually created all the 3 dialogs in the main dialog using create hence the value is not getting loaded in the other windows..Plz anyone help me
Kind regards
anitha
|
|
|
|
|
AnithaSubramani wrote: we want the values to be changed in all the other 3 dialog boxes
Use the observer pattern[^] or send a user defined message to the other dialog boxes to inform them that the value should be updated.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
AnithaSubramani wrote: We have actually created all the 3 dialogs...
Are they modal or modeless?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
They are modelless dialog boxes.
|
|
|
|
|
Have you tried posting a message to the other dialogs that need updating?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Dear all,
In my program we have written code to download folders from the server to the PC,When the downloading process is started my dialog box disappears.Actually we have 3 dialog boxes and all these 3 boxes are loaded once our application starts and each and every time when i want a window the corresponding window is hide and displayed using FindWindow() and ShowWindow()... What can be the problem Plz anyone help me...
Kind regards
anitha
|
|
|
|
|
Read what you've written and see if you think it makes sense.
The only thing clear is that you have three dialog boxes. I cannot figure out whether you want them hidden or shown and whether the use of FindWindow() is part of the problem or the solution.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
we have 3 dialog boxes and all these 3 boxes are loaded once our application starts and each and every time when i want a window the corresponding window is found using FindWindow() and displayed using ShowWindow()...In one of the dialog when we click a button it starts downloading the files from the server. When it is downloading i need a progress bar to be ruuning in my dialog box. But in my code the dialog box disappears. Please help me to know what can be the problem why the dialog box disappears when the it starts downloading..
|
|
|
|
|
1. Why do you load all the 3 dialog boxes when your application starts? Can't you just show it when required (with DoModal() ?)
2. Why are you using FindWindow() and ShowWindow() at all? Are the dialogs hidden? Or is it that all dialogs are just shown on the screen? That would be really bad.
3. Your dialog box disappears when a download starts? Can you show that relevant piece of code? Relevant code only, please.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
* I tried domodal() in one of my application but if i use domodal() i can change between dialog only 30 or 40 times after that it shows a message which says resource not available.
|
|
|
|
|
Hi,
May i know how can i change the window style(name of the window...,changing window borders..etc..) in the code ...
i have tried to change in Oncreate function in Mainframe.cpp but no result...
Pls help me regarding the same..
|
|
|
|
|
ex.: remove the ClientEdge style:
LONG windowLong = GetWindowLong(hWnd, GWL_EXSTYLE);
windowLong = windowLong & (~WS_EX_CLIENTEDGE);
SetWindowLong(hWnd, GWL_EXSTYLE, windowLong);
|
|
|
|
|
Thanks for ur reply....
I need to write this code in onpaint()....??
or i need to make changes in oncreate() if not may i know the purpose of oncretae() func in mainframe.cpp..
Please correct me if im wrong...
|
|
|
|
|
you can put it anywhere you need to change the window style.
but PreCreateWindow[^] is a good place if you want to make sure the change happens before the window is drawn.
|
|
|
|
|
ok fine....and may i know what is purpose of Oncreate() func or when
it ill be useful...
|
|
|
|
|
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
I am using the following code:
CString csXmlFile = "MyXML.xml";
CComPtr<msxml::ixmldomdocument xmlns:msxml="#unknown"> fXmlValDocPtr;
HRESULT hr = fXmlValDocPtr.CoCreateInstance( L"Microsoft.XMLDOM" );
VARIANT_BOOL isSuccessful = VARIANT_FALSE;
if( hr == S_OK )
{
fXmlValDocPtr->put_async( VARIANT_FALSE );
BSTR bstrCsXmlFile = csXmlFile.AllocSysString();
_variant_t tempcsXmlFile(bstrCsXmlFile);
hr = fXmlValDocPtr->load(tempcsXmlFile, &isSuccessful);
tempcsXmlFile.Detach();
}
Getting the following exception. Can I know what is the bug in above code.
kernel32!RaiseException+58 e0000001 00000000 00000001
msxml3!Exception::raiseException+5f 800c0006 8fd64972 00000000
msxml3!Document::HandleEndDocument+45 8fd64926 00000000 07ade1a8
msxml3!NodeFactory::abort+34 07ad46a8 00000000 8fd648de
msxml3!NodeFactory::Error+2d 07ad6000 07ad46a8 c00ce551
msxml3!Document::abort+e9 07ad6000 8fd6486a 00000000
msxml3!Document::_load+1b8 07adf000 00000000 00000000
msxml3!Document::load+44 07ade038 00000000 8fd64bf6
msxml3!DOMDocumentWrapper::load+1e4 00000000 00000008 00000030
|
|
|
|
|
How do you figure this has to do with the usage of CComPtr ?
Does it work if you use a raw interface pointer instead?
It looks to me as if the exception is raised because the document you're trying to load fails to do so.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Catch the fricking exception, see what it says.
As the exceptions in the load method....are you sure you're feeding it XML, not your source code?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
okay I've created a program that has a 2D array that I want to display and edit. The class I created is called CChannel.
I'm using SDI to display it, in the View class I have defined this,
m_pChans = GetDocument()->GetChan();
m_chan is defined, CChannel m_chan;
GetChan() is this.
CChannel* GetChan() {
return &m_chan;
}
CChannel has an array defined in it called,
int arr[16][3600];
Okay, so within my View file I run the lines,
m_pChans->arr[i][j]=1;
that works fine and updates the array good, but when I copy this code in a function then try call it called from another file I get problems. First it asks me to make that function static, I'm not sure why,
error C2352: 'CUCPView::UpdateOutputs' : illegal call of non-static member function
so I make the function static, then it has this error,
error C2227: left of '->arr' must point to class/struct/union/generic type
I don't understand why it works within View, but when I try to use it in a function and make it static it doesn't work. I've been trying to look up the error codes and such, but with no luck. Could someone please help me with this.
I'll post more code if needed, but this already is pretty long
Cheers
|
|
|
|
|
Did you include the header file of your CChannel class in the cpp file in which you are using it ?
For your other problem (making the function static), you'll have to show some code where you call the function so that we can help you.
|
|
|
|