|
What do you mean by different bitmaps? Are these webcams?
|
|
|
|
|
I have a program that sends an email if a certain alarm condition arises. Currently, the email only contains a text message, but I'd like it also to include an xy plot of about 400 points. Trouble is, I don't know how to put that plot into an email. I know I could create an image in a file and attach that to the email, but I prefer not to do that.
Is there some kind of html or something else that can go in an email that will display a plot given the set of xy points? I know that java classes on a web page can plot given the points, but can email clients like Outlook and Outlook Express run java applets? Any other thoughts?
One thing someone suggested to me was to make a plot using ASCII codes. But my plot needs to be very precise for the points given, not some rough approximation, so I don't think that would work.
|
|
|
|
|
there's a client-side graphics package called SVG[^], but i'm not sure if email clients will like it, plus it requires a client-side install (the same way you need a PDF-reader to read PDF)
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
If you do not want to attach, and I would worry security-wise about readers that will just go an automatically execute script and/or applets, I would suggest one of two things:
1: Use some fancy (D)HTML to draw your graph. It might be as simple as a table containing non-whitespace characters with a specific background/fill color.
2: Go old-school and create an ASCII Art drawing. (Anyone remember "The Draw"?)
Peace!
-=- James 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! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
To clarify your question, what is the form of your plot, a hard-copy printout or an electronic file? If saved in an electronic file, is it a raw data format or image format such as BMP, PDF, JPEG, etc?
- It's easier to make than to correct a mistake.
|
|
|
|
|
My old post is somewhere on page 20 and I couldn't bump it by replying. As you can see in the code (as a comment) I tried putting "Hello World" right into the function and it worked fine. I'm trying to use the Win32 WriteConsole() function but it prints out random characters (but it is a number of random characters equal to the length of the string I used in each case). I think it is a problem with the pointers I'm using but I'm not getting any warnings or errors. Please take a look:
Client code:
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
MainConsole.SwitchBuffers(1);<br />
MainConsole.WriteStreamToBuffer(1, "Hi");<br />
MainConsole.SetBufferCursorPos(2, 20, 20);<br />
MainConsole.WriteStreamToBuffer(2, "John!");<br />
MainConsole.SwitchBuffers(2);<br />
cin.get();<br />
<br />
return 0;<br />
}<br />
Class function being called:
<br />
void MainWindowSpecs::WriteBuffer(string TextToWrite)<br />
{<br />
DWORD NumCharsWritten;<br />
string *TextPtr = &TextToWrite;<br />
<br />
WriteConsole(StandardHandles.hOut, &TextPtr, TextToWrite.length(), &NumCharsWritten, NULL);<br />
if(TextToWrite.length() != NumCharsWritten)<br />
cerr<<"All characters were not written."<<endl;<br />
}<br />
|
|
|
|
|
CoffeeAddict19 wrote: WriteConsole(StandardHandles.hOut, &TextPtr, TextToWrite.length(), &NumCharsWritten, NULL);
At this point, what is the value of TextToWrite and TextPtr ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
CoffeeAddict19 wrote:
void MainWindowSpecs::WriteBuffer(string TextToWrite)<br />
{<br />
DWORD NumCharsWritten;<br />
string *TextPtr = &TextToWrite;<br />
<br />
WriteConsole(StandardHandles.hOut, &TextPtr, TextToWrite.length(), &NumCharsWritten, NULL);<br />
if(TextToWrite.length() != NumCharsWritten)<br />
cerr<<"All characters were not written."<<endl;<br />
}
Assuming this is an STL string you are dealing with, try:
void MainWindowSpecs::WriteBuffer(const string &TextToWrite)
{
DWORD NumCharsWritten;
string *TextPtr = &TextToWrite;
WriteConsole(StandardHandles.hOut, TextToWrite.c_str(), TextToWrite.length(), &NumCharsWritten, NULL);
if(TextToWrite.length() != NumCharsWritten)
cerr<<"All characters were not written."<<endl;
} It looks like you are passing the address of the string object [edit] to WriteConsole(...) [/edit], not the pointer to its contents, which is what c_str() returns. The const reference should be a bit more efficient.
Peace!
-=- James 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! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
-- modified at 13:03 Wednesday 14th June, 2006
|
|
|
|
|
^It worked, thanks. I really appreciate the help, both of you. I'm still having trouble flipping buffers but that's another problem for another day.
Thanks!
|
|
|
|
|
how i can change the parent dialog's variables from a child dialog?
erfan
|
|
|
|
|
pass the this pointer of the parent class to the child.
cheers..Milton Kb
|
|
|
|
|
|
Are you sure you want to do this? It's considered bad OO design for a child object to operate on items belonging to its parent. Consider sending the parent a message instead.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
thanks.
i know this is a bad way but i need it
|
|
|
|
|
I have ever seen only the function like this
SomeFuntion(input1,input2);
such as
FindWindow(NULL,m_input);
but I never seen the funtion like this
(Something)SomeProcedure;
such as
(HOOKPROC)KeyboardProc;
What does it mean ?
|
|
|
|
|
(SomeType) is an explicit cast into the SomeType type.
such code line actually changes the type of the expression into the type specified.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
It seems that you see a cast operation. For instance (int)7.2 means that the float-point value is converted to an integer, obtaining 7 . Casting can be applied for function pointers too. Thus, (HOOKPROC)KeyboardProc means that the address of KeyboardProc function is interpreted as a callback function required by the second argument of the SetWindowsHookEx call.
|
|
|
|
|
Max++ wrote: but I never seen the funtion like this
(Something)SomeProcedure;
such as
(HOOKPROC)KeyboardProc;
When you see that you are generally looking at a cast. However, in older code, especially from the U*ix world or from older U*nix developers, you may see something like:
<code>(void)</code>printf( "Some String" );
<code>(void)</code>strcpy( caSomeBuffer, "Some Other String" );
<code>(void)</code>sprintf( caSomeBuffer, "%d-%d-%d", iVal1, iVal2, iVal3 ); In this case, I believe you are seeing a construct that means something along the lines of "I am intentionally ignoring the return value of this function." I believe that some compilers may even complain (or may have complained) about disregarding return results like this(?).
Peace!
-=- James 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! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
|
I've created a Button and what i'm trying to do is when I click the button I want a message box to pop up...
void ksclass::OnBnClickedButton1()
{
::AfxMessageBox(_T("Hello Wolrd !"));
// TODO: Add your control notification handler code here
}
the ::AfxMessageBox(_T("Hello Wolrd !")); helped with the errors but when I run then click the button... nothing happens...
Thanks
Kitty5
|
|
|
|
|
Since i am trying to put text (CDC) on a Cstatic (which looks bluish on my screen) I would like to set the background color of CDC for the TextOut to be the same as the label color. I tried doing the following in the label class but of course its incorrect. HOw do I get the color of the label so I can SetBkColor of the CDC?
COLORREF cl = GetBkColor(GetDC());
GetBkColor' : cannot convert parameter 1 from 'class CDC *' to 'struct HDC__ *'
thanks,
sb
|
|
|
|
|
If this does not help:
COLORREF cl = GetDC()->GetBkColor();
nor
COLORREF cl = m_cMyLabel.GetDC()->GetBkColor();
then you can try this:
COLORREF cl = (COLORREF)GetSysColor(COLOR_3DFACE);
|
|
|
|
|
|
Michael Dunn wrote: Those calls to GetDC() are bad - you need to release every DC you get.
You are right -- explicit releasing should be preferable.
Actually MFC is able to release various handles at idle time. Values returned by GetDC and other functions are temporary objects which are stored in a collection. They a released between message processing.
|
|
|
|
|
Greetings:
I have this application that I'm writing under VS 2003 using C++ and MFC. This one dialog box contains a fixed segment, located in the left-hand part of the dialog, where all of the controls inside will not change. One of the controls is a list box and as the user selects a single item from the list box, the controls on the right automatically change to correspond with the selection. One selection may cause the controls on the right to become a couple of input boxes. Another selection may cause the controls on the right to become a combobox and some check-boxes. Get the picture?
The problem is that I am unsure about how to do this. I thought at first that just using property pages would be the way to go but I am rather sicked by the fact that the property sheet that "holds" the property pages is so inflexable. It is very difficult to resize the property sheet and then place the page part of the sheet into the area that you want. Furthermore, I noticed that the controls that are positioned in the sheet must be placed there programmatically. I hate that idea.
I would prefer to NOT have to paint and repaint my controls programmatically. I would like to draw each of the control sets in the resource editor and then come up with some easy way to just swap them in and out.
Has anybody out there done something like this? Any advice?
Thanks in advance,
Mark
|
|
|
|