|
|
when someone has already posted the right answer about 10 hours before your come to, please don't do that...
you don't provide anything more.
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
Thank-you Anil
|
|
|
|
|
LOL when I right click on one file in the Solution Explorer and hit "Compile", it compiles a different file! Then when I build that project, certain modules seem like they are missing... Sometimes it only compiles a single file when I hit Rebuild.
Anyone seen this behaviour?
I think I've found a way around it --- I create a new project and add all those files into it, but it's a real hassle. I imported these projects from VC6, so maybe that's the problem?
thanks,
swine
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
Hi,
i've included various projects(60) in my workspace and
i've used objectspace-STL within these, since now. I don't know if i have installed
software that damaged the state or something else, but from now i have to set the linker switch "ignore all standard lib.", that it would work - compile and link.
I get following fault, if I don't set it:
: error LNK2001: Nichtaufgeloestes externes Symbol "__declspec(dllimport) public: __thiscall std::_Winit::~_Winit(void)" (__imp_??1_Winit@std@@QAE@XZ)
So I looked for _Winit and find out that my DLL needs msvcp60.dll to work. I know this dll, it's for
MS C++ Runtime Library. But the question is:
How can i use objectspace-stl again and how can i ban this dll ?
Anyone who has experience how could i solve the problem ?
Thanks in advance
Eddy
|
|
|
|
|
Ok, I would guess that HWND is a Handle to a Window and HANDLE is Handle to anything.. but huh, tell me..
|
|
|
|
|
Hi again,
can someone explain the following line to me?
i am also interested in the meaning and sense behine such definition. thanx!
#define SIG_DFL (void (__cdecl *)(int))0
|
|
|
|
|
Ok, I would guess that HWND is a Handle to a Window and HANDLE is Handle to anything.. but huh, tell me..
|
|
|
|
|
I posted this Topic 10 min ago but there seem's something wrong with the forum software. Please delete this Thread. Thanx
|
|
|
|
|
Well that's basically it. An HWND is used to reference API functions that relate to Windows, everything from message processing to device contexts, etc. HWND and HANDLE are not interchangable, although as data types the value of one can certainly be assigned to the other.
The purpose of each is very similar. When you use CreateWindow, the operating system allocates an area that references that Window's characteristics, but essentially puts that area in a "black box", providing access to it through API calls, but not as a direct structure. This gives the writers of the operating system (Microsoft, in this case) the flexibility to change that internal structure any way they want to in the future without impacting the behavior of applications that use it. They only have to change the implementation of the function hooks. Essentially this practice (and other types of handles) was one of the first large-scale implementations of object oriented encapsulation.
Just my thoughts...
-Dethulus
|
|
|
|
|
I can manipulate text and images on a regular device context. When I try, however, to do the same in a memory dc and "blit" it to my display dc all I get is black image.
I am sure it is a simple setting that I am forgeting but I can figure it out, for the life of me.
Any suggestions?
Thanks!
|
|
|
|
|
You have to create a compatible bitmap for the in-memory DC and select it into the one you created. The default bitmap for a newly created device context is (I believe) just a 1x1 monochrome bitmap. The steps necessary are:
hMemDC = CreateCompatibleDC(hDC);
hMyBmp = CreateCompatibleBitmap(hDC, nWidth, nHeight);
hOldBmp = SelectObject(hMemDC, hMyBmp);
... draw some stuff on the in-memory DC ...
BitBlt(hDC, hMemDC, 0, 0, nWidth, nHeight, 0, 0, SRCCOPY);
SelectObject(hMemDC, hOldBmp);
DeleteObject(hOldBmp);
DeleteObject(hMemDC);
... however, I just typed this off the top of my head, so it's possible there's a bug in it.
-Dethulus
|
|
|
|
|
Well done. Only thing is you need to delete hMyBmp , not hOldBmp
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hence my disclaimer. Good catch, BTW! That's why I code in MFC.
-Dethulus
2b|~2b. Why FF, of course.
|
|
|
|
|
I'm going on 10 years of MFC and I'm only 25. I feel sooooooo old
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello Friends
I am back again with a question. I have a dialog based MFC application in which I want to know whether my network cable is connected to my network card or not?
Which function is best for this and how to use it? Or any other idea to do this?
Regards,
Mahesh
|
|
|
|
|
Check out ISensNetwork . Also see here. In addition to a missing cable, there could other reasons for no connectivity.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi David
Thankx a lot for spending time to look at my questions.
With tons of thankx and regards,
Mahesh
|
|
|
|
|
i read IP Address of NIC, if Network Cable is Unplugged,
The Address is 127.127.127.0
|
|
|
|
|
Hi
Thankx a lot to you too......
U'r quote also helped me a lot.
Mahesh
|
|
|
|
|
An ISP connection does not mean the network cable is plugged in but would provide you with similar capabilities. I am assuming you want to see if you have network connectivity which requires you take any IP capable connection into consideration. Checking the routing table for a default route is the best technique I've come across so far as it does not require checking a URL, pinging an IP address, or other techniques that will not be entirely accurate in all contexts.
I got the idea from someone on CodeGuru before they upgraded their website and lost all the legacy comments. Unfortunately, I do not know the name of the person who passed on the idea so I can't give credit where credit is do but I'll pass it on...
The function to use is GetIpForwardTable(). I use a timer to periodically check for connectivity and update my status indicator accordingly. There is a slight delay maybe a second or two if you unplug the cable or plug it in (assuming your timer is set to fire every second). No noticeable delay when disabling the connection using a GUI tool.
Don't forget to include in StdAfx.h...
#include <iphlpapi.h> // For Routing table query
And make sure to reference the Platform SDK lib file...
iphlpapi.lib
BOOL CNetworkConnectionDlg::IsInternetAvailable(void)
{
MIB_IPFORWARDTABLE * pRoutingTable;
DWORD dwBufferSize=0;
BOOL bIsInternetAvailable=FALSE;
DWORD dwResult;
DWORD dwIndex;
DWORD dwRowCount;
// Get the required buffer size
GetIpForwardTable(NULL,&dwBufferSize,FALSE);
pRoutingTable=(MIB_IPFORWARDTABLE*)new BYTE[dwBufferSize];
// Attempt to fill buffer with routing table information
dwResult=GetIpForwardTable(pRoutingTable,&dwBufferSize,FALSE);
if (dwResult==NO_ERROR) {
dwRowCount=pRoutingTable->dwNumEntries; // Get row count
// Look for default route to gateway
for (dwIndex=0;dwIndex<dwRowCount;dwIndex++) {
if (pRoutingTable->table[dwIndex].dwForwardDest==0) { // Default route designated by 0.0.0.0 in table
bIsInternetAvailable=TRUE; // Found it
break; // Short circuit loop
}
}
}
delete pRoutingTable; // Clean up. Just say "No" to memory leaks
return bIsInternetAvailable;
}
|
|
|
|
|
Hi
Thankx thankx thankx thankx........I can't describe it in words...
Any way have a nice time
Mahesh
|
|
|
|
|
Great code, thank you a lot!
|
|
|
|
|
Hello,
I've got a Problem with the "Reusable base class for SplitterWnd" from Daniel Zuppinger:
http://www.codeproject.com/splitter/st_splitterwnd.asp
I splitted the MainFormView vertical and added to each Pane a View in the OnCreateClient Method of the MainFrame:
m_pRightBottomSplitterWnd = m_pRightSplitterWnd->AddSubDivision(BOTTOM_SIDE, RUNTIME_CLASS(CViewChooser), RUNTIME_CLASS(CView1), pContext, true);
Now I click on a Button in the right Pane and going to change the View in the Left Pane. For Example from CFormView to CHTML View or whatever. Therefore I call a Method in the MainFormView Class by clicking the Button, with the following code:
m_pRightBottomSplitterWnd->AddView(RIGHT_SIDE, RUNTIME_CLASS(CView2), NULL);
But that still doesn't work and I got a runt-time-error. The Debugger stops at the following code, from the SplitterWnd Class:
<br />
inline void SideToRowCol(int nSide, int* nRow, int* nCol) <br />
{<br />
if (m_bVertical) {
*nRow = 0;<br />
*nCol = nSide;<br />
}<br />
else {<br />
*nRow = nSide;<br />
*nCol = 0;<br />
}<br />
};
I hope you understand my Problem and can help me.
|
|
|
|
|
hever wrote: I've got a Problem with the "Reusable base class for SplitterWnd" from Daniel Zuppinger:
Has he been able to help?
hever wrote: Now I click on a Button in the right Pane and going to change the View in the Left Pane.
Are you using ST_SplitterWnd::SwitchToView() for this?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|