|
Hi folks,
here's the problem:
I have an internet-explorer-control in a dialog to retrieve a webpage. What I want is getting the webpage as a bitmap snapshot into the clipboard an then paste this into another document (in that case a MS Office Imaging file - tiff or mdi). Maybe, there are some other ideas to get the content of the webpage into the document (w/o usage of clipboard)?
With this document I do some OCR (with MS Modi-Component included in MS Office 2003).
Are there any ideas, code snippets etc. to do this job?
TIA
Mathefreak
|
|
|
|
|
|
Hi..
I have a problem with line that I draw using mouse click (LButtonDown). I use VC++ and MFC.
The problem is whenever I maximize or minimize the window the lines that I draw dissapear.
Below is my code for LButtonDown :
struct LINE
{
int xp[2];
int yp[2];
};
LINE L[100];
int Lnum = 0;
int icoord = 0;
int isline =0;
int psize = 1;
if(bLineFlag)
{
CPen penRed(PS_SOLID,1,RGB(250,0,0));
CPen *pOldPen = NULL;
pOldPen = pDC->SelectObject(&penRed);
CRect rcClient;
GetClientRect(&rcClient);
CPoint xpoint,ypoint;
L[Lnum].xp[icoord] = point.x / psize;
L[Lnum].yp[icoord] = point.y / psize;
if(icoord ==0)
{
icoord++;
isline = 0;
}
else
{
isline =1;
pDC->MoveTo(L[Lnum].xp[0],L[Lnum].yp[0]);
t.x = L[Lnum].xp[0];
t.y = L[Lnum].yp[0];
pDC->LineTo(L[Lnum].xp[1],L[Lnum].yp[1]);
p.x = L[Lnum].xp[1];
p.y = L[Lnum].yp[1];
icoord =0;
}
DrawCross(point,RGB(0,255,0),5,pDC->m_hDC);
}
Could anyone help me with the problem..
mafuza
|
|
|
|
|
You need to store your lines in memory (just the points coordinates) and then redraw everyting when the window is repainted. You will need to add the code for redrawing in OnDraw function
|
|
|
|
|
Hi cedric moonen..
thank you for your reply..so what's you saying is i have to transfer my coordinates from Lbuttondown to OnDraw?
I'm a newbie with MFC so the windows is repainted at the OnDraw function?
please reply thank you!!
|
|
|
|
|
What you can do is on the LButtonDown event, take the coordinates of the lines and store them somewhere (in your view or doc, I think document is better because it is designed for containing the data). Then invalidate the view (I think by calling Invalidate but not sure anymore), this will force your window to be redrawn (and will call OnDraw). Then in the OnDraw function, you draw all the lines that you have stored.
But there is an example of exactly the same case in the MSDN I think. This is called the scribble example (but I'm not sure)...
|
|
|
|
|
Hi all,
I want to add proxy support to my application. Now I know how to get the Automatic Proxy URL, but how do I get the right data from this file?
Thanks!
Geert
http://geert.yoki.org
|
|
|
|
|
Hello All!
Have a problem with changing font color in static. I do like this:
<br />
LRESULT CPage::OnHandleAll(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)<br />
{<br />
if ((uMsg == WM_CTLCOLORSTATIC) && (HWND)lParam == GetDlgItem (IDC_STATIC_TEXT_ABONENT_TYPE))<br />
{<br />
ModifyStyle( 0, SS_NOTIFY );<br />
HBRUSH hBr = NULL;<br />
HDC hDC = (HDC)wParam;<br />
SelectObject( hDC, GetFont() );
SetTextColor( hDC, RGB(255,255,0));<br />
SetBkMode( hDC, TRANSPARENT );<br />
hBr = (HBRUSH)GetStockObject( HOLLOW_BRUSH );<br />
return (LRESULT)hBr;<br />
}<br />
}<br />
But color not changing in IDC_STATIC_TEXT_ABONENT_TYPE =(
|
|
|
|
|
|
|
Shouldn't you be doing this in the OnCtlColor() method. See MSDN article Q115087 for an example.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hiho@ll
i try to do a statistic prog, for host load
the problem is, i want this prog to be very generic, to use it for as many statistics data as possible
this means, there can be about 10 lines in my statistics diagram
my problem is, that i have a very poor algorithm for choosing the right color for the lines
anyone has an idea how the algorigthm for the linecolor would be, if i only know a linenumber
and i want the colors be very strong
my algorithm tends to use very bright colors, which isn't really nice to look at
it also would be nice if i could tell the function, if the linecolor should be bright or dark for a less or more interesting statistic lines
the color values i could use are standard RGB (0-255) values and an alpha value (0-127)
anybody has an idea?
thx@ll
|
|
|
|
|
could anybody plz tell me that how to convert a string value to double or a string to its corresponding ascii value in vc++???
|
|
|
|
|
Nehathoma,
It seems like you are struggling with data conversion for past few days. Here is a list of data conversion routines that I copy pasted from MSDN. May be you can find answers to your future queries also from the table below.
Data-Conversion Routines : msdn [^]
abs Find absolute value of integer <br />
atof Convert string to float <br />
atoi, _atoi64 Convert string to int <br />
atol Convert string to long <br />
_ecvt Convert double to string of specified length <br />
_fcvt Convert double to string with specified number of digits following decimal point <br />
_gcvt Convert double number to string; store string in buffer <br />
_itoa, _i64toa, _itow, _i64tow Convert int to string <br />
labs Find absolute value of long integer <br />
_ltoa, _ltow Convert long to string <br />
_mbbtombc Convert 1-byte multibyte character to corresponding 2-byte multibyte character <br />
_mbcjistojms Convert Japan Industry Standard (JIS) character to Japan Microsoft (JMS) character <br />
_mbcjmstojis Convert JMS character to JIS character <br />
_mbctohira Convert multibyte character to 1-byte hiragana code <br />
_mbctokata Convert multibyte character to 1-byte katakana code <br />
_mbctombb Convert 2-byte multibyte character to corresponding 1-byte multibyte character <br />
mbstowcs Convert sequence of multibyte characters to corresponding sequence of wide characters <br />
mbtowc Convert multibyte character to corresponding wide character <br />
strtod, wcstod Convert string to double <br />
strtol, wcstol Convert string to long integer <br />
strtoul, wcstoul Convert string to unsigned long integer <br />
strxfrm, wcsxfrm Transform string into collated form based on locale-specific information <br />
__toascii Convert character to ASCII code <br />
tolower, towlower, _mbctolower Test character and convert to lowercase if currently uppercase <br />
_tolower Convert character to lowercase unconditionally <br />
toupper, towupper, _mbctoupper Test character and convert to uppercase if currently lowercase <br />
_toupper Convert character to uppercase unconditionally <br />
_ultoa, _ultow Convert unsigned long to string <br />
wcstombs Convert sequence of wide characters to corresponding sequence of multibyte characters <br />
wctomb Convert wide character to corresponding multibyte character <br />
_wtof Convert wide-character string to a double <br />
_wtoi, _wtoi64 Convert wide-character string to int or __int64 <br />
_wtol Convert wide-character string to long
suhredayan There is no spoon.
|
|
|
|
|
hai friends any body help me in my problem?i want to convert my string to double or to ascii?can any one give code for that?pls..
shan
|
|
|
|
|
Someone posted working string to double code before, then deleted the post, I guess they realised their question was non-existant.
This code requires you to include cstdlib.
char *stop = 0;
char * testvar="123.4";
double x=strtod(testvar, &stop);
What do you mean by string to ASCII ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi All,
I have an application which uses automation to prepare a Word Document....
When i am placing the text i want to obtain the width that it would occupy with the selected Font and Size...
I have tried using GetTextExtent but the value that i get seems to be incorrect (thats visible from the output i get).
I have the Font size in points and the required width in Twips ....
So please suggest how can i achieve this by using a self created DC, i do ot want to depend on any Window ( my app is console based )..
Thanks and Regards,
ashwinder
|
|
|
|
|
ashwinder wrote:
I have tried using GetTextExtent...
You are on the right track but without seeing exactly how you are doing it, it's hard to say.
ashwinder wrote:
...but the value that i get seems to be incorrect (thats visible from the output i get).
How are you verifying the results?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
I am working with VC++ 6.0 (MFC).
Normally an ActiveX control is binding with an application
exe) dynamically. We need to ship the "ocx" file with the "exe" file, for distribution.
My question is :
Is there any way to bind the "ocx" statically with the "exe" so that I can distribute the "exe" alone?
TIA,
Regards,
Jahfer V P
|
|
|
|
|
Jahfer V P wrote:
Is there any way to bind the "ocx" statically with the "exe" so that I can distribute the "exe" alone?
AFAMK to avoid the OCX file and get its functionality in your application, you will have to get the source code from the OCX vendor and include in you project. But this also may not be possible if the ocx and ur application are developed in different languages.
suhredayan There is no spoon.
|
|
|
|
|
The idea of OCXs is that they are seperate.
I suggest using an installer to create an install disc and make sure it has the OCX as part of the installation.
I have done simple installations with InstallShield that came with VC++6.0 Enterprise and this collected the OCXs automatically from the project.
I'm sure that others can advise you on current packages that would suit your needs.
Elaine
The tigress is here
|
|
|
|
|
Hi All,
I stuck with a small problem in RichEditControl.My Requirement is i have a dialog box.I need to add a button naming UNDO.i have done some operations(copy,paste,delete) on RichEditCtrl placed on that Dialog,If i pressed that UNDO button the last change should be undone.This is my Requirement.
I Used Like this:
if(richeditobj.CanUndo())
{
richeditobj.Undo())
}
For me CanUndo is not returning Correct return Value.
Thanks in Advance
Aravind
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
|
I am currently working out a project using Digital Gates, we've done the implementation of the circuit and the results will all ok. But there was a problem that i am facing currently, my Digital Gates will always disappear when i minimize or maximize the screen of my program.
I know that i can use CWnd::UpdateWindow to refresh the screen, but i do not know how and also what are the parameters and arguments should i add in?
Can anyone guide me through this difficult stage thank you.
From: Guilbert
|
|
|
|
|
popo84 wrote:
my Digital Gates will always disappear when i minimize or maximize the screen of my program.
you have two solution to this problem :- either create your window with CS_SAVEBITS Class style which make your drawing on screen persistent! (look for more detail about above property in RegisterClass documentation)
or Handle WM_PAINT message to draw your Image Every Time the Windows Refreshes. also you can manually refresh your window by using CWnd::Invalidate()
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|