|
if ur going to declare a variable in the header file and if that header is included from more than one cpp file, u will surely get the error LNK2005.
my suggestion is, u move the delclaration to stdafx.cpp .
nave
|
|
|
|
|
Well, I qoute myself: "In one of your source files" ...
And "In the other source files"
I never said anything about a header file...
|
|
|
|
|
hoooo sorry
I mis-readed the line
"In one of your source files, below #include stdafx.h, "
nave
|
|
|
|
|
That's OK. I'm sorry for being a bit harsh in my answer. It wasn't intended to come out that way. But I was in a hurry. 
|
|
|
|
|
my variable is fedit
i have declared it in a file exdlg.cpp at the top
CString Globalfedit;
and use this varible in the same cpp
GetDlgItemText(IDC_EDIT1,fedit);
but it is showing an error
error C2065: 'fedit' : undeclared identifier
if you undersatnd the problem plz mail me
prashant jain malviya national institute of technology
|
|
|
|
|
Of course, you named your global variable "Globalfedit"
So fedit doesn't exist.
|
|
|
|
|
THANX AND SORRY TO DISTURB U
prashant jain malviya national institute of technology
|
|
|
|
|
No problem. But remember to use "extern" if you want to use the global variable from another source, else it will be defined more than once.
|
|
|
|
|
Hello All,
I have a bit of a dilemma. I am faced with the situation that I need to open the correct version of my product when side-by-side installations exist. The situation occurs in that my file extension has not changed in the two released versions I have; so using Windows file association the last installed version will be the one that always gets associated and therefore, and this is not good enough in my clients eyes. What I looking for is that a version 1 file of extension .xxx will open with version 1 of my product, but opening a version 2 .xxx file will open with version 2 of my product.
I am not sure about a good approach to doing this as I can't seem to find any documentation that would help out here. I have noticed that VS 2005 has a version selector that enables it to figure out which version needs to be opened (and even gets the Icon correct!). But it is not really documented and I am not 100% sure how this would be been implemented.
Does anyone have any ideas on the best method of solving this problem?
Thanks in advance.
Ben
|
|
|
|
|
Hello. A thought:
You could make a third program. And register the extension to that program. The new program determines what version to start, and then starts the correct version.
|
|
|
|
|
can any one tell me how i could set the color of any button
in any dialog based form
Ashish Dobhra
MCA
Noida
|
|
|
|
|
you can derived CButton and use WM_DRAWITEM(set ownerdraw to true in button property)
whitesky
|
|
|
|
|
plz helpme for this
can u tell me an example for this
Please mail me
|
|
|
|
|
 See
<br />
CMyButton m_Button1;<br />
<pre><br />
class CMyButton : public CButton<br />
{<br />
public:<br />
CMyButton();<br />
virtual ~CMyButton();<br />
protected:<br />
virtual void DrawItem( LPDRAWITEMSTRUCT lpDrawItem );<br />
<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
<br />
<br />
<br />
CMyButton::CMyButton()<br />
{<br />
}<br />
<br />
CMyButton::~CMyButton()<br />
{<br />
}<br />
<br />
BEGIN_MESSAGE_MAP(CMyButton, CButton)<br />
END_MESSAGE_MAP()<br />
<br />
<br />
void CMyButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItem) <br />
{<br />
CDC dc;<br />
CString Str;<br />
CRect Rect(lpDrawItem->rcItem);<br />
<br />
dc.Attach(lpDrawItem->hDC);<br />
GetWindowText(Str);<br />
dc.SetBkMode(0);<br />
<br />
if ( (lpDrawItem->itemState& ODS_SELECTED) )<br />
{<br />
dc.FillRect(Rect,&CBrush(RGB(255,255,255)));<br />
dc.FrameRect(Rect,&CBrush(RGB(0,0,255)));<br />
<br />
dc.SetTextColor(RGB(0,0,0));<br />
dc.DrawText(Str,Rect,DT_CENTER|DT_SINGLELINE);<br />
}<br />
else<br />
{<br />
dc.FillRect(Rect,&CBrush(RGB(53,97,200)));<br />
dc.FrameRect(Rect,&CBrush(RGB(0,0,0)));<br />
<br />
dc.SetTextColor(RGB(255,255,255));<br />
dc.DrawText(Str,Rect,DT_CENTER|DT_SINGLELINE);<br />
}<br />
<br />
dc.Detach();<br />
}<br />
change property OwnerDraw from button to true in property window
whitesky
|
|
|
|
|
I want to get information about ports on my system including the following:
- ports that are used
- processes that use the ports
- what data (binary) the processes send via the ports
Are there any APIs that can help me?
Thank you!
modified 9-Mar-17 17:21pm.
|
|
|
|
|
Are you looking for a toool or code?
for information about ports, you can use "tcpview" tool from sourceforge.net
Just google it.
anyway the task you specified will not work with an API or two
Daniel Kanev wrote: what data (binary) the processes send via the ports
especially this one! look for some sniffers.
SaRath.
"Do Next Thing..."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
|
|
How to change Group box background color???
|
|
|
|
|
and use WM_CTLCOLOR
whitesky
|
|
|
|
|
I dont know what do you need but see here i write this ocde for you i check this code with a GroupBox and in GroupBox i have radio buttons and...
<br />
CMyStatic m_GroupBox;<br />
<pre><br />
class CMyStatic : public CStatic<br />
{<br />
DECLARE_DYNAMIC(CMyStatic)<br />
<br />
public:<br />
CMyStatic();<br />
virtual ~CMyStatic();<br />
<br />
protected:<br />
DECLARE_MESSAGE_MAP()<br />
public:<br />
afx_msg void OnPaint();<br />
};<br />
<br />
<br />
IMPLEMENT_DYNAMIC(CMyStatic, CStatic)<br />
CMyStatic::CMyStatic()<br />
{<br />
}<br />
<br />
CMyStatic::~CMyStatic()<br />
{<br />
}<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CMyStatic, CStatic)<br />
ON_WM_PAINT()<br />
END_MESSAGE_MAP()<br />
<br />
void CMyStatic::OnPaint()<br />
{<br />
CPaintDC dc(this);
CRect rect;<br />
GetWindowRect(rect);<br />
ScreenToClient(rect);<br />
dc.FillSolidRect(rect,RGB(0,0,200));<br />
<br />
dc.SetBkColor(RGB(0,0,100));<br />
dc.SetBkMode(0);<br />
CString str;<br />
GetWindowText(str);<br />
dc.FrameRect(rect,&CBrush(RGB(255,255,255)));<br />
dc.SetTextColor(RGB(255,255,255));<br />
<br />
dc.DrawText(str,rect,DT_TOP);<br />
}<br />
whitesky
|
|
|
|
|
If i don't want to install the MSDN for the second time, what should i do?
It says that my system is installed on C: and all files of MSDN are installed on D:, after i reinstall my operating system, of course, all registry infos of MSDN were gone. But all files are still exist on drive D:, and i don't want to install MSDN again, what should i do for my purpose?
Nobody trust it, but it is true.
|
|
|
|
|
I strongly suggest you to re-install MSDN.
Actually document explorer is loading the help collection. the exe will be available at Microsoft Shared folder.
The command line information for the the exe is as follows.
"C:\Program Files\Common Files\Microsoft Shared\Help\dexplore.exe" /helpcol ms-help://MS.MSDNQTR.2004OCT.1033
Try this way but im not sure whether it will work properly or not
SaRath.
"Do Next Thing..."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
Thanks, but i am just wanna know that if there is a way to use the data files of MSDN, all data file(*.chm) is on the disk, why we can't use?? Why we must re-install the MSDN, that's so boring to re-install it! If we can do it, just copy all data file to a disk and invoke these data at wherever we want, don't you think that's great? such as, win98,win2k,winXP and so on.
I mean if you setup multi OS on your PC, and you need only install MSDN for one time, and then can use it under any OS you installed.
Can this become true?
Go go go, enemy sighted! Roger that!
|
|
|
|
|
Hi,
I can able to create controls for a dialog box at run time. But how to create controls that are created automatically when scrolled. The help i need is that i will create some 10 buttons in a dialog while in its initialization. All the 10 buttons each will have one edit box beside. On clicking one button some text will get displayed on its associated edit box. Initially the scroll bar will be disabled. But if one button is clicked, the scroll bar should get enabled, and one more button and edit box have to be created (that is, 11th button and its edit box...). Please help me in this!!
Thanks in advance,
Sangeetha.
|
|
|
|