|
Hi,
My application interacts with the device through RS232
Data sent/Received over the port should be displayed
while still programming is communicating with the device.
For this I created one modeless dialog class with edit member variable
Now Consider one packet tobe sent, contents of this packet should be assigned to the dialog class member variable and it should be updated but when I tried todo so
my application is crashing. But if I do with Modal Dialog
it is working fine.
can anyone please explain me
Thanks in advance
Uday
|
|
|
|
|
too many about communication.
does ur app crash from comm or modeless dialog box?
normally, modeless must be global or class member, can not be local as modal one because it returns at once then local modeless dialog box is destoyed.
hope hit ur point
includeh10
|
|
|
|
|
It is crashing at modeless, further I have not created this as local.
When communication is happening I wnat to show the data sent/received for which I am using the modeless.
If I assign the packet(CString type) to my edit variable(CString type of modeless dialog class), it is getting crashed.When I tried to assign it to the local variable it is not crashing
|
|
|
|
|
Hello everybody,
I am not sure how hard this is, but I want to add a new configuration based on some #define code. I am trying to follow Paul DiLascia's tutorial on building a File viewer.
So this is my question. He adds a code that turns his SDI bitmap loader into an MDI bitmap loader. I want to do this too. He adds a lot of #ifdef _MDI statements that convert the code to MDI. You have to add a new configuration to do this.
How do I add a configuration to get this #ifdef _MDI to work? I tried to add a new configuration, but it never runs the code in the #ifdef _MDI, but always goes to the #else statements. I added a AfxmessageBox to make sure, and the message box always says "SDI Compilation" and never "MDI Compilation."
How would I go about adding his configuration?
Thanks so much,
NickOne
|
|
|
|
|
If you already created a new configuration for MDI mode, go to the Project Settings for it and look for the preprocessor section. Add _MDI to the list of predefined macros.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thank you!
I appreciate the response. I actually had figured it out after some battling. I am not too familiar with the user interface, so I didn't know this option existed. But you are absolutely correct.
Thanks again for helping me out, I always appreciate it very much.
NickOne
|
|
|
|
|
can i dock CDialogBar as CToolBar to anywhere and resize it as needed?
if yes, what is key to do?
thanks
includeh10
|
|
|
|
|
|
before i study for hrs, hope u give me one more word: can i do it (should be yes, i guess)?
a duke dollar and a for u.
includeh10
|
|
|
|
|
before i study for hrs, hope u give me one more word: can i do it (should be yes, i guess)?
Should be yess. The code needed is nevertheless so little that you'll be better off pasting it into your app and seeing the results.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
i tested both c++ and java socket (under windows), got similar results:
i.e. max 45 sockets in a single machine (clients and server are in the same PC).
i think there is no different between c++ and java socket from efficent, speed or capibility view.
do u have different thinking or experieces?
includeh10
|
|
|
|
|
You are basically right, Java and C++ sockets are mapped to system sockets, so they behave pretty much the same.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Suppose, you have a wizard that has bitmap on top of every page. Then, you want to add a title to the bitmap of every page. You don't want to modify the bitmap itself, rather add a text using something like CStatic. How would you do it?
I have tried adding a transparent CStatic and it doesn't work. I have played with other options on CStatic and they don't seem to work either. Any ideas?
thanks
|
|
|
|
|
Transparent CStatic s aren't really that static. You can use (for instance) Norm Almond's CLabel to have true transparency.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have a window that contains an ActiveMovie4 control. I set the control window to be 500 x 500 originally, then the video resizes itself to suit the file opened. How can I get this new rect?
|
|
|
|
|
With GetWindowRect ?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
yeah, with GetWindowRect. It doesn't get the correct rect.
|
|
|
|
|
Is there a way to put a thread to sleep and wake it up from outside of the thread itself? I have a thread that gets created regardless of what mode I'm in but would like for it to just go to sleep when in one mode and wakeup and goto work in another. When the user makes a menu selection for mode, I want to respond accordingly.
I know there is the sleep command but that is for inside of the thread. I also know about WaitForMultipleObjects and some about events. Since this is already written code, and is already waiting for certain events, i.e. application shutdown, read from serial port, etc., I don't want to have to add new events and code. In one mode (the non-serial mode), I don't want it to wait for these events, I want it to sleep or wait INFINITE until application shutdown. In the other mode, I want it to respond to serial events and application shutdown. I know I can make it work if I recode this section but is there an easier way?
|
|
|
|
|
Nevermind. I found it. SuspendThread(). I don't know why it isn't listed in the "See Also" section of Sleep() but it isn't. Oh well...
|
|
|
|
|
Aehm, sounds not that difficult...
Just use
SuspendThread( HANDLE hThread )
to send the thread to sleeping state, and
ResumeThread( HANDLE hThread )
to awake it.
BTW: SuspendThread()/ResumeThread() maintain an internal counter, which means you could call SuspendThread() for n times, but then have to call ResumeThread() also for n times before the thread reaches READY state again.
--
Daniel Lohmann
http://www.losoft.de
|
|
|
|
|
can any one tell me how to open the msword documents programmatically?
I used an article HOWTO: Use WordBasic Functions in an MFC Automation Client for Word 97, Word 2000, or Word 2002 (Q252719)
as an reference.
the problem is giving me at
<br />
COleVariant vOpt(DISP_E_PARAMNOTFOUND, VT_ERROR);
<br />
_Document document = documents.Open(COleVariant("e:\\APQAD.DOC"), vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt, vOpt);
why i can't open it????
|
|
|
|
|
if creating a CToolBar, there is always a vertical line for each separate button, i think the line is too ugly but i try several hrs (change style or ex style) and still can remove it.
could u give me a hand?
thx
includeh10
|
|
|
|
|
Do you mean the separators, or the actual buttons themselves.
If you're using flat toolbars, separators look like etched vertical lines.
If you're not using flat toolbars, buttons look like... buttons, with two vertical lines and two horizontal ones.
If you're seeing a single vertical line, right down the center of the screen, you've got one of those annoying Trinitron monitors turned on its side...
--------
PMGRE --Shog9 --
|
|
|
|
|
yes, i mean separators and flat tool bar by CreateEx function, but i don't understand ur idea for deleting the vertical line (the separator button is still there and just no the vetical line)
more info please, thx
includeh10
|
|
|
|
|
So, what you want to do, is have a flat toolbar, with separators, but not showing the separators?
You can use the technique described in this article [^] to do so.
--------
PMGRE --Shog9 --
|
|
|
|