|
Im trying to push buttons within a form on a web site. Is there any events or commands that anyone knows of that will allow me to do this? for example ebay has a form with a "Submit Bid" button.. I would like to be able to push the "Submit Bid" Button with my app..
Any help would be appreciated!
Thanks,
Rob
|
|
|
|
|
I know I can use GetDocument->UpdateAllViews(0) to clear the screen in VIEW.CPP ..... but how can i clear the screen if my function is located in another non-MFC file??????? I just use something liked
::InvalidateRect(Handler, NULL, FALSE);
to update the view.....
Can you help me????
What i want to do is keep printing a list of number.....for example,
1
2
3
4
5
6
7
and the program has to compare the previous number....if the previous number is 7...then I have to erase the 7 and put an A there......but I have to display "7" first...then when it's going to display another .....let say 8....then the list should be
1
2
3
4
5
6
A
8
|
|
|
|
|
Hi!
Is there a way to emulate the WinNT VirtualAllocEx() function on WinCE.
In other words, I am trying to reserve and commit a region of memory within
the virtual address space of a specified process in WinCE, but am not able to
do so because WinCE only supports VirtualAlloc().
I am also trying to create a thread that runs in the virtual address space
of another process in WinCE, and since the CreateRemoteThread function is not
defined I am unable to do so.
I would greatly appreciate if a solution to either of the above could be found.!
|
|
|
|
|
Hi!
I want to create a console application that looks like the Lotus Server, i.e. like a normal console but all the input goes on the last row with other things (logs in that case) being updated while I can write commands. Does anyone know how to create an app like this, an example would be great!
|
|
|
|
|
In my MDI app I made a class that derives from CDocument and another that derives from CView. I also added the CMultiDocTemplate in the InitInstance method of the App class.
My problem is in trying to add the GetDocument() function to my new view. This line in the view's header file:
CVideoDoc* GetDocument() {return (CVideoDoc*)CView::GetDocument();}
gives me these compilation errors in the header file:
error C2143: syntax error : missing ';' before '*'
error C2501: 'CVideoDoc' : missing storage-class or type specifiers
error C2501: 'GetDocument' : missing storage-class or type specifiers
I've compared this to working code, and I don't know the problem. It's gotta be something simple that I just didn't think of. Any help is appreciated.
thanks,
Jake
|
|
|
|
|
Include your document class header file in the appropriate file.
you can simply put #include "videodoc.h" in your view class.
HTH
Jignesh
|
|
|
|
|
I had been including VideoDoc.h in the view's .cpp file. I changed that to include it in the view's .h file, and it's good to go. Thanks,
Jake
|
|
|
|
|
I want to use the status bar in my Dialog based app!
but this code doesn't show the status bar!
m_SB.Create(this);
m_SB.Indicator(indicator, sizeof(in..)); // I think the funck was Inicator or spmething!
but there is no control when my app is running!
I wrote it in OnInitDialog
|
|
|
|
|
Here is the codes
float a,b;
a = (( (AlphaTotal - PrevAlphaTotal) / PrevAlphaTotal ) * 100 );
b = (( (BetaTotal - PrevBetaTotal ) / PrevBetaTotal ) * 100 );
CString testing;
CStringList ReturnedData;
testing.Format("Alpha Percentage %f", a );
ReturnedData.AddTail(testing);
testing.Format("Beta Percentage %f", b );
ReturnedData.AddTail(testing);
(--->ReturnedData will be used to output in view class)
The results would be:
If a or b = 65.50...it displays 0.00
If a or b = 180.50...it displays 100.00
Why i know that because.....I try just type some number in the formula...for example,
a = ((700-500)/500)*100;
b = ((81-60)/60)*100;
Then output is:
Alpha Percentage 0.00
Beta Percentage 0.00
How to fix it??????????????????????
|
|
|
|
|
Are AlphaTotal, PrevAlphaTotal, etc. all integral types? Probably so. Use floating point types (or cast the variables to doubles) otherwise the division operator does an integer divide, which throws away any remainder. That's why 200/500*1000 is 0 - 200/500 is an integer divide and returns 0.
--Mike--
http://home.inreach.com/mdunn/
"Holding the away team at bay with a non-functioning phaser was an act of unmitigated gall. I admire gall."
Lt. Cmdr. Worf
|
|
|
|
|
Oh thanks!!!! It works now...
but i have one more question. For example,
a = 180.98763
I just want to display 180.99....and save it to a char or CString because i want to save to my CStringList........what can i do???
can i use:
char Buffer[128];
sprintf(Buffer, " %f %f", a,b);
I have a and b......I want to display liked:
| 180.98 | 123.56 |
??????
|
|
|
|
|
When i use this code to save the result to a char,
char Buffer[128];
sprintf(Buffer, " %f %f", a,b);
my program is forced to terminate....why?
|
|
|
|
|
For example, a = 180.98763 I just want to display 180.99
A format string of "%.2f" will do that. Check the printf() documentation for a full list of the format strings.
--Mike--
http://home.inreach.com/mdunn/
"Holding the away team at bay with a non-functioning phaser was an act of unmitigated gall. I admire gall."
-- Lt. Cmdr. Worf
|
|
|
|
|
I'm currently doing the following to load a bitmap
HBITMAP hBitmap =(HBITMAP) LoadImage(NULL,"c:/activextree/closedfolder.bmp",IMAGE_BITMAP,20,20,LR_LOADFROMFILE);
But need to be able to pull this off a network.
how can I do this?
What Id like to do is something like the following (which doesn't work)
HBITMAP hBitmap =(HBITMAP) LoadImage(NULL,"http://localhost/foo/closedfolder.bmp",IMAGE_BITMAP,20,20,LR_LOADFROMFILE);
thanks for any help
-Jack Mott
jackm@scalablesoftware.com
|
|
|
|
|
You'd need to first make a HTTP connection, then try it. Also you need to make sure that image can be read.
|
|
|
|
|
thanks for the response. What is the easiest way to make an http connection?
-Jack Mott
jackm@scalablesoftware.com
|
|
|
|
|
Well you could connect using the CHttpServer class. I can't help you with it's use, but you should just play around with it, cuz I don't think it's well documented.
|
|
|
|
|
I want to paint small icon part of a bitmap over a Cstatic background image. (and also over another static transparent text)
All is fine if I disable the CStatic bitmap my small icon bitmap
is drawed but when I enable the background my icon does not appear.
I think that it's drawed before the CStatic bitmap an thus erased ?
here is the code that draw the small bmp part: (code from
"Drawing Transparent Bitmap with ease with on the fly masks in MFC
By Raja Segar"
void CMydialogDlg::OnPaint()
{
////////////////////////////////////////////////////
//PAINT THE ICON
CPaintDC dc(this); // device context for painting
CDC dcMem; // memory device context
dcMem.CreateCompatibleDC(&dc);
// Select the bmp into the tmp memory DC
CBitmap* pOldBmp = (CBitmap*) dcMem.SelectObject(&m_bmpPLMain);
DrawTransparentBitmap( &dc, // The destination DC.
0, // Where to draw
0,
16, // Width & Height
16,
&dcMem, // the DC holding the bmp
0, // x & y pos in source bmp
0);
CDialog::OnPaint();
}
seem tricky uh ?
Thanks
|
|
|
|
|
Call the CDialog::OnPaint in the beginning of your function
Bjarne Nielsen
|
|
|
|
|
>Call the CDialog::OnPaint in the beginning of your function
already tried but it don't work at all.
The only things that was able to *draw* over the Cstatic Bitmap was to
deal with the CTlcolor function but the result was at least
very bad and strange (perhaps wrong method ?)
My bmp need to be draw over all the other graphic.
Anyway thanks for the reply
Any other solution ?
|
|
|
|
|
I have a byte array that is allocated with a size of 4096. That is the max, and I will probably never fill up the array. Then I pass this array to a function that needs to send all that data that is in the array to the serial port.
What is the best way to go about this?
My first idea was to create a CString object to represent the data....like so.....
void SendDataToPort(unsigned char * pData)
{
CString StringToSend;
int iCursor = 0;
while(pData[iCursor] != NULL)
{
StringToSend += pData[iCursor];
iCursor++;
}
// Use either CString::GetBuffer() or CString::operator LPCTSTR() to get the string.
// Sent it.
}
I would think there is an easier way to do this to do this. Also, what is the syntax for using CString::operator LPCTSTR(). Last, I noticed when people post code in messages, they can make it appear with a yellow background, and the code format remains in-tact, how is that done?
Thanks,
John
|
|
|
|
|
CString is not a good idea if there are 0 bytes in your array. Can you just pass the array and the # of bytes to send to the function? If not, use MFC's CByteArray class to hold the bytes.
--Mike--
http://home.inreach.com/mdunn/
"Holding the away team at bay with a non-functioning phaser was an act of unmitigated gall. I admire gall."
Lt. Cmdr. Worf
|
|
|
|
|
I need to send the data in this array with the WriteFile() function. The array is passed in like so:
void SendArray(unsigned char * Data)
How come when I send this array using WriteFile() it always sends 4 bytes, versus sending all the data in the array, here's what I use..
WriteFile(hPort, Data, sizeof(Data), &dwBytesSent, NULL);
|
|
|
|
|
> WriteFile(hPort, Data, sizeof(Data), &dwBytesSent, NULL);
The reason it only writes 4 bytes is because your asking it write the size of a pointer, which is only four bytes. You should add another parameter to tell WriteFile how many bytes to write.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Greetings,
I was wondering how I can get a LOGFONT from an IFont without using a CFont.
For I am in a atl object, and I don't have access to a CFont MFC class.
I am interested in getting the actual pixel size of the text, but the IFont's
get_Size() gets me the size in CY*pSize, and I don't know how to convert it
into the LOGFONT's lfHeight.
I assume that the text width is somehow store in the "CY" object, but I am not
sure how to work with it for I am very new to COM.
Thanks for any help.
|
|
|
|