|
thank u mike. i will search and get back to u
With Regards,
Sangeetha.
|
|
|
|
|
Yes, but you need to compile a separate executable file for each platform. You need compilers for Solaris and Linux (for example GCC[^]), VC6.0 on Windows isn't enough.
|
|
|
|
|
Hi all,
Through my code i want to check that internet conection is there on a machine or not. If anybody knows the api or method to do this please tell me. It would be very helpful.
Thanks in advance
|
|
|
|
|
Does InternetGetConnectedState helpful?
|
|
|
|
|
i am using InternetGetConnectedState like this..
<br />
DWORD dwType;<br />
if (!InternetGetConnectedState(&dwType, 0))<br />
{<br />
AfxMessageBox("cable unplugged");<br />
}<br />
else<br />
AfxMessageBox("connection is there");<br />
if i disable my connection then also it gives connection is there.
|
|
|
|
|
What happend if you run this code
DWORD dwType;
BOOL m_bConnect;
m_bConnect = InternetGetConnectedState ( &dwType, 0 );
if (m_bConnect)
if ( dwType & INTERNET_CONNECTION_OFFLINE )
bConnect = FALSE;
|
|
|
|
|
its giving this error:-
<br />
error C2065: 'INTERNET_CONNECTION_OFFLINE' : undeclared identifier<br />
|
|
|
|
|
Did you include Wininet.h ?
|
|
|
|
|
ya i have. I have also included lib file( Wininet.lib )but still its giving this error
|
|
|
|
|
Whats your type application and your compiler?
|
|
|
|
|
|
i have a quicker and temporary solution for you.
but not sure, weather it suits your application.
1.go to command prompt and type ipconfig.
2.you will see the ip settings.
3.next, disable the internetconnection and see ipconfig.
4.in my system, it gives win 2000 ip configuration, and that should apply for your system also.
5.so got the difference?
apart from your code which you have previoulsy executed, you can add this ipconfig in a systemcommand (obviously by redirecting the output to a file)
and see weather the connection is enabled or not.
and one more alternative is,
you can google to find some application,(which i studied few days ago) like "how to find the unique ID of the network card in the computer"
in this application, the function returns the ID if the network is enabled
i think this will also be helpful, until some master gives you a simple technique. even iam eagerly waiting for that.
gud luck.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
Hi all,
At runtime how to draw a transparent rectangle on the bitmap, which is loaded from the file using memory DC.
thanks in advance
|
|
|
|
|
surezu wrote: draw a transparent rectangle
Here try the following code:
void DrawTransparentRectangle( CDC& dc, Rect rc)
{
// the next line draws a transparent rectangle
// there now can you see it?
// i'm sure it is there, look again
}
|
|
|
|
|
Ha! I can see right through your reply
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
what is the problem u r facing right now?
if u r problem is that u r rectangle drawn with Rectangle()masks u r bmp then draw 4 lines simple.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
i'm having a CBitmap object, which will contain 2546x3288 size image,loading from bmp file.i need to draw a rectangle on that image witout lossing of background image...
void SFormViewer::OnPaint()<br />
{<br />
CPaintDC dc(this);
<br />
if(flag_iInitPaint)<br />
{<br />
CRect rClient;<br />
GetClientRect(&rClient);<br />
<br />
CPen m_Pen;<br />
m_Pen.CreatePen(PS_SOLID,2,RGB(250,0,0));<br />
<br />
CDC m_memDC;<br />
m_memDC.CreateCompatibleDC(&dc);<br />
m_memDC.SelectObject(&m_FormImage);<br />
m_memDC.SelectObject(&m_Pen);<br />
m_memDC.SetBkMode(TRANSPARENT);<br />
<br />
r_SelectedRect.SetRect(m_iShownImgTopX + p_iTopLeft.x, m_iShownImgTopY + p_iTopLeft.y, m_iShownImgTopX + p_iBottomRight.x, m_iShownImgTopY + p_iBottomRight.y);<br />
<br />
if(flag_Scroll == 0)<br />
{<br />
m_memDC.Rectangle(r_SelectedRect);<br />
<br />
}<br />
<br />
dc.BitBlt(0,0,rClient.Width(),rClient.Height(),&m_memDC,m_iShownImgTopX,m_iShownImgTopY,SRCCOPY);<br />
<br />
}<br />
}
|
|
|
|
|
surezu wrote: r_SelectedRect.SetRect(m_iShownImgTopX + p_iTopLeft.x, m_iShownImgTopY + p_iTopLeft.y, m_iShownImgTopX + p_iBottomRight.x, m_iShownImgTopY + p_iBottomRight.y);
if(flag_Scroll == 0)
{
m_memDC.Rectangle(r_SelectedRect);
}
what i suggest is, instead of using memDC.rectangle,
use like this.
say if you want to draw rectangle from (x1,y1) to (x2,y2)
moveto(x1,y1);
lineto(x2,y1);
moveto(x2,y1);
lineto(x2,y2);
moveto(x2,y2);
lineto(x1,y2);
try to guess the next part of the code.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
chandu004 wrote: what i suggest is, instead of using memDC.rectangle,
Why is 8 lines of code better than 1?
Inquiring minds want to know...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Rectangle draws a rectangle filled with the current selected brush.
Try selecting a null/hollow brush into the memDC instead of setting the background
mode to transparent
CBrush HollowBrush;
HollowBrush.CreateStockObject(HOLLOW_BRUSH);
CBrush *pOldBrush = m_memDC.SelectObject(&HollowBrush);
...
<draw your rectangle>
...
m_memDC.SelectObject(pOldBrush);
It's also a good idea to get into the habit of saving objects
previously selected into DCs so you can select them back in
when you're done with the DC. This will prevent resource leak problems.
Also....what happens if the bitmap isn't compatible with the memDC??
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
See Graphics::DrawRectangle on the MSDN.
|
|
|
|
|
Can any body help me to access printer in VC++
Thanks in advance
|
|
|
|
|
1) Click the top left corner of the page where it has the Bob Image and says "The Code Project"
2) After the home page loads look in the left column for the black bar that says "Sections"
3) Under Sections look for "General C++" and click it. That will open a new list of choices
4) Click "Printing"
Good luck
|
|
|
|
|
if you want to print you can use of StartDoc EndDoc for get name of printers see EnumPrinters .
|
|
|
|
|
Hi All,
I am using MFC Application.I am going to include Existing project in to my Project's Workspace.
I have new project of type static library OK.Noew I got problem when I am going to include header file of that new project in my MFC project's class.I got error like below.......
1>d:\testing_and_download\testing\testrtmp_working\testrtmp\rtmpdesk.h(2) : fatal error C1083: Cannot open include file: 'omnithread.h': No such file or directory
Here,
omnithread is my new project and in that I have omnithread.h file.In this project I have used the thread classes which i want to access here in my MFC project.
Ok. Thanks In Advance.
Ashish
|
|
|
|