|
Before posting my code, I'm wondering if I'm missing something obvious here...
I have a small C++ app that interacts with the Windows Scheduler to schedule small tasks that interact with the serial port. These tasks are being installed using the SYSTEM account. When I run these tasks manuall (i.e. right-click > Run), everything works great. However, when the task runs at its specified time, it crashes when trying to send an EscapeCommFunction(...) command that controls the DTR & RTS lines. The call to CreateFile(...) on the port returns a valid file handle.
Any thoughts? Thanks!
|
|
|
|
|
Dear all,
I developed a little program and I wish to run it using a script file. I want to run it (standby)but not to start processing until it receives the file. Any help on how to do this?
|
|
|
|
|
islheg wrote: I want to run it (standby)but not to start processing until it receives the file.
This makes no sense (at least to me it doesn't). Can you be a bit more specific?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
This is a network traffic analyzer. I created it using winpcap library and MFC. I don't want the program to start traffic analysis until it receives a script file.
|
|
|
|
|
islheg wrote: I don't want the program to start traffic analysis until it receives a script file.
Ok, so how does it receive such a file?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
That what I am asking about.
|
|
|
|
|
"Accepting a file" really makes no sense without some sort of context. I'm not sure how others could be expected to know how your application is handling files. Provide some more information.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I have tab control with many property pages, I want to update only selected property page at a time when it is visible.
What message have to handle from the property page class when the page is selected?
Is it possible to handle any message from the property page class, not from the tab control class, which hold the page?
thanks.
|
|
|
|
|
The only thing I am aware of is CPropertyPage::OnSetActive() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
thanks, this seems to work good
|
|
|
|
|
Hi,
I've developed an application in which I've 2 dialog boxes(not property sheets) and they are all modeless dialogs .By clicking a button in the dialog1 the user can move to dialog2 and he can also move back to dialog1 by clicking another button in dialog2.
In dialog1 after the button is clicked i'm creating dialog2 overloading the "Create" function and the code for that is something like....
DestroyWindow(); //to destroy dialog1
d2=new dialog2; //d2 is apointer of class belongong to dialog1
d2->Create(IDD_DIALOG2,NULL); //dialog2 is created
the problem here is, I'm not able to delete the pointer d2,because if i delete it within the destructor of class dialog1 then the dialog2 wont be visible .If i dont delete it it leads to a "MEMORY LEAK" .Same is the case with dialog2.........
So I'd like to know which will be the right place to delete the pointer so that the dialogs are created properly and there wont be any memory leak.Anxiously waiting for a reply....thanks in advance.
Rajeev
|
|
|
|
|
You need a readily accessible instance of a third class that contains the pointers to both dialogs. Each dialog can call functions in this class to free the memory when the dialog is being destroyed.
|
|
|
|
|
Hi,
in my work i have to take data from VC++ GUI and send them to c51 programs and receive data from c51 and display them in GUI.
I need some idea about how to cooinet VC with c51.
Thanking you
sheshidar patnam
|
|
|
|
|
and is supposed to be this famous "C51" ??
Pastis ? (Pastis 51 )
don't mind if you don't understand...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20]
-- modified at 9:53 Monday 5th December, 2005
|
|
|
|
|
|
It all depends where the VC++ program is running and where the C51 program is running.
There must be some physical interface between the processors (for example, the 8051 is on a PCI-bus card in the PC, and the interface is memory mapped, or the 8051 is in an external box which connects to the PC via serial port.) Look at the definition of that interface - that should tell you how to send data to the 8051 and receive data from the 8051.
I suggest you split the problem of sending and receiving data from the problem of entering and displaying data.
|
|
|
|
|
Hi,
in my work i have to take data from VC++ GUI and send them to c51 programs and receive data from c51 and display them in GUI.
I need some idea about how to cooinet VC with c51.
Thanki
|
|
|
|
|
1- You could read about PC's serial ports. There are a number of samples available here on CP about Serial Ports.
2- And as for the hardware part, you will need to study the C8051 microcontroller, and how to connect it to a PC, which is the hard part.
this is this.
|
|
|
|
|
Hi Khan, Thx for your message,
my question is we are having program for microcontroller, and we developed a GUI to control the microcontroler program, and this GUI has nothing to do with microcontroller, and only thing it should do is communicate with c51 programs in keil. User has to select some data in GUI and this data should send to micrrocontroller programs in same PC dynamically.
And i have to make two way communication between VC and keil.
Thanking you
|
|
|
|
|
The thing you are trying to do could be hard to implement, since the C51 program running in the Keil compiler is in Keil's own address space etc, and not running independently, because it is not an executable program; It only runs inside the Microcontroller.
My personal opinion:
If you need to create communication between two different programs, then write them both in VC++.
If you really need to communicate with a C51 program, then you would have to take a look at:
Inter-process communication. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipc/base/interprocess_communications.asp[^]
API Hooking. (Maybe too.) http://www.codeproject.com/system/hooksys.asp[^]
Also you could do some research on emulating the Keil compiler ; (i.e, writing a program which in turn runs a Keil's C51 program).
this is this.
|
|
|
|
|
Hi folks,
I've got a need to re-route printing based on a given condition. Basically, when the user selects file | print in my MDI doc/view, I need to open a different doc (of the same type) and print that instead. So far, I've been opening the other document in view::DoPreparePrinting (after the call to the base class, so the user can select their desired printer), calling newView->OnBeginPrinting, newView->OnPrint & newView->OnEndPrinting manually and then closing the document. This prints the original view though.
Anyone had to do this before? Could you point me in the right direction? It would be great if I could get print preview to preview the other document too.
-Dy
|
|
|
|
|
Hi,
Override OnPrint( CDC* pDC, CPrintInfo* pInfo) virtual function and draw whatever u want in that DC. The default implementation calls the OnDraw member function and passes it the printer device context. Thats why you r getting the original view.
Bye
Cool Ju
Dream Ur Destiny
|
|
|
|
|
After a proper nights sleep I've taken another look at the problem.... What I should have been doing is opening, printing / print previewing and closing the document in question in the OnFilePrint and OnFilePrintPreview handlers - not in DoPreparePrinting!
Do'h, so simple when you think about it properly...
-Dy
|
|
|
|
|
|
what does the post build event do ? register any service or ... ?
|
|
|
|